-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.05 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (70 loc) · 2.05 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
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-windows:
name: Build Windows exe
runs-on: windows-latest
# Needed so softprops/action-gh-release can create/update the GitHub
# Release on tag pushes. Default GITHUB_TOKEN perms are read-only.
permissions:
contents: write
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Cache cargo registry + target
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
- name: Build release
run: cargo build --release --locked
- name: Smoke-test doctor subcommand
run: cargo run --release -- doctor
- name: Stage artefacts
run: |
mkdir dist
copy target\release\silentwitness.exe dist\
copy ..\LICENSE.md dist\
copy ..\README.md dist\
shell: cmd
- uses: actions/upload-artifact@v4
with:
name: silentwitness-windows-x86_64
path: rust/dist
- name: Create release (on tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: rust/dist/*
build-linux:
name: Build Linux (dev-only)
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
- name: System deps for eframe + rdev
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev libxdo-dev libayatana-appindicator3-dev \
libx11-dev libxi-dev libxtst-dev libxkbcommon-dev \
libssl-dev pkg-config
- name: cargo check
run: cargo check --all-targets
- name: cargo test
run: cargo test