-
Notifications
You must be signed in to change notification settings - Fork 88
68 lines (67 loc) · 2.86 KB
/
build_artifacts.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
57
58
59
60
61
62
63
64
65
66
67
68
name: Build artifacts
on:
workflow_dispatch:
workflow_call:
jobs:
build:
name: Building ${{ matrix.build_target }} [${{ matrix.update_feature }}]
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_target: [linux, macos, windows]
update_feature: [self-update, no-self-update]
exclude:
- build_target: windows
update_feature: no-self-update
include:
- build_target: linux
os: ubuntu-latest
- build_target: macos
os: macos-latest
- build_target: windows
os: windows-latest
- update_feature: self-update
update_name: "" # we don't want this in the binary filename
- update_feature: no-self-update
update_name: "-noselfupdate"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: rui314/setup-mold@v1 # faster linker
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.OS }}-release-
if: matrix.os == 'ubuntu-latest'
- name: Building
run: cargo build --release --no-default-features --features wgpu,${{ matrix.update_feature }}
- name: Creating ./bin directory
run: mkdir -p bin
- name: Renaming binaries [Windows]
if: matrix.os == 'windows-latest'
run: mv target/release/uad-ng.exe bin/uad-ng-${{ matrix.build_target }}.exe
- name: Renaming binaries [Others]
if: matrix.os != 'windows-latest'
run: mv target/release/uad-ng bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}
- name: Tarball Linux/MacOS binary
if: matrix.os != 'windows-latest'
run: tar -czf bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}{.tar.gz,}
- name: Create checksums for binaries and archives [Windows]
if: matrix.os == 'windows-latest'
run: sha256sum bin/uad-ng-${{ matrix.build_target }}.exe | tee bin/uad-ng-${{ matrix.build_target }}-checksum.txt
- name: Create checksums for binaries and archives [Others]
if: matrix.os != 'windows-latest'
run: >
sha256sum bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }} | tee bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}-checksum
sha256sum bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}.tar.gz | tee bin/uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}.tar.gz-checksum
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: uad-ng${{ matrix.update_name }}-${{ matrix.build_target }}
path: bin/uad-ng-*