-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.97 KB
/
release.yml
File metadata and controls
71 lines (60 loc) · 1.97 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
name: Build and Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build applet
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwayland-dev \
libxkbcommon-dev \
libudev-dev \
libinput-dev \
libdbus-1-dev \
libpipewire-0.3-dev \
libclang-dev \
pkg-config
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry and build
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
applet/target
key: ${{ runner.os }}-cargo-${{ hashFiles('applet/Cargo.lock', 'applet/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Verify Cargo.toml version matches tag
working-directory: applet
run: |
TAG_VERSION="${{ github.ref_name }}"
TAG_VERSION="${TAG_VERSION#v}"
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo "Tag version: $TAG_VERSION, Cargo.toml version: $CARGO_VERSION"
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "ERROR: tag ${{ github.ref_name }} does not match Cargo.toml version $CARGO_VERSION"
exit 1
fi
- name: Build release binary
working-directory: applet
run: cargo build --release
- name: Rename binary with version tag
run: |
cp applet/target/release/vial-layer vial-layer-${{ github.ref_name }}-linux-x86_64
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
files: vial-layer-${{ github.ref_name }}-linux-x86_64
generate_release_notes: true