-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 1.67 KB
/
release.yml
File metadata and controls
73 lines (57 loc) · 1.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
name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
CARGO_TARGET: x86_64-pc-windows-gnu
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libssl-dev
- name: Test
run: cargo test
build-windows:
name: Build (Windows cross-compile)
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-gnu
- uses: Swatinem/rust-cache@v2
with:
key: windows-gnu
- name: Install MinGW cross-compiler
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64
- name: Build release
run: cargo build --release --target x86_64-pc-windows-gnu
- name: Rename binary
run: |
mv target/x86_64-pc-windows-gnu/release/simtrace.exe \
target/x86_64-pc-windows-gnu/release/simtrace-${{ github.ref_name }}-windows-x86_64.exe
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: target/x86_64-pc-windows-gnu/release/simtrace-${{ github.ref_name }}-windows-x86_64.exe
generate_release_notes: true