-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (52 loc) · 1.5 KB
/
release.yml
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
name: Release
on:
release:
types: created
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: ${{ matrix.platform.target }}
strategy:
fail-fast: false
matrix:
platform:
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
bin: rgl
- target: aarch64-apple-darwin
os: macOS-latest
bin: rgl
- target: x86_64-apple-darwin
os: macOS-latest
bin: rgl
- target: x86_64-pc-windows-msvc
os: windows-latest
bin: rgl.exe
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
7z a ../../../rgl-${{ matrix.platform.target }}.zip ${{ matrix.platform.bin }}
- name: Generate SHA-256
run: shasum -a 256 ${{ matrix.platform.name }}
if: matrix.platform.os == 'macOS-latest'
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
files: "rgl-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}