-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.41 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (47 loc) · 1.41 KB
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
name: Release
on:
release:
types: [created]
permissions:
contents: write
jobs:
build:
name: Build and Upload Release Assets
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
artifact_name: rat
asset_name: rat_linux_x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: rat.exe
asset_name: rat.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: rat
asset_name: rat_macos_x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: rat
asset_name: rat_macos_arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream