This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.75 KB
/
rust-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: netchat-server
asset_name: netchat-server-linux-amd64
# - os: ubuntu-latest
# artifact_name: netchat-server
# asset_name: netchat-server-linux-arm64
# architecture: arm64
- os: windows-latest
artifact_name: netchat-server.exe
asset_name: netchat-server-windows-amd64.exe
- os: macos-latest
artifact_name: netchat-server
asset_name: netchat-server-macos-amd64
# - os: macos-latest
# artifact_name: netchat-server
# asset_name: netchat-server-macos-arm64
# architecture: arm64
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: brew install pkg-config openssl
- name: Build
run: cargo build --release --locked
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}