-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.67 KB
/
Copy pathbuild.yml
File metadata and controls
86 lines (73 loc) · 2.67 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build
on:
push:
branches: ["**"]
pull_request:
# Allows release.yml to reuse this exact build matrix.
workflow_call:
concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
bin: decryptd
archive: decryptd-linux-x86_64.tar.gz
target: x86_64-unknown-linux-gnu
- name: windows-x86_64
os: windows-latest
bin: decryptd.exe
archive: decryptd-windows-x86_64.zip
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# No GUI system packages needed: the `gui` feature uses ldtray, which loads
# every platform toolkit at runtime — nothing is linked at build time.
# Provides the link-time CUDA driver library: the libcuda.so stub on Linux and
# cuda.lib on Windows. The runtime libcuda is the NVIDIA driver on the volunteer
# machine; CI only needs it to resolve symbols at link time. build.rs picks up
# the install via the CUDA_PATH the action exports.
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.35
id: cuda
with:
cuda: "12.6.0"
- name: Build
# The `gui` feature (ldtray tray) is on by default; the one binary runs on
# both desktops and headless servers.
run: cargo build --release --locked
- name: Package (Linux → tar.gz)
if: runner.os == 'Linux'
run: |
mkdir -p dist
tar -czf "dist/${{ matrix.archive }}" -C target/release "${{ matrix.bin }}"
- name: Package (Windows → zip)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist | Out-Null
Compress-Archive -Path "target/release/${{ matrix.bin }}" -DestinationPath "dist/${{ matrix.archive }}"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: dist/${{ matrix.archive }}
if-no-files-found: error
# Raw binary named after its Rust target triple — the layout
# `rsupd publish --ci` consumes to stage target/<triple>/release/ and
# build the signed update package.
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: target/release/${{ matrix.bin }}
if-no-files-found: error