-
-
Notifications
You must be signed in to change notification settings - Fork 107
106 lines (89 loc) · 2.68 KB
/
release-engine.yml
File metadata and controls
106 lines (89 loc) · 2.68 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release Intiface Engine
on:
push:
tags:
- 'intiface-engine-[0-9]*'
jobs:
build:
name: Build ${{ matrix.platform }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
platform: linux
arch: x64
exe: intiface-engine
artifact: linux-x64
- runner: ubuntu-24.04-arm
platform: linux
arch: arm64
exe: intiface-engine
artifact: linux-arm64
- runner: windows-latest
platform: win
arch: x64
exe: intiface-engine.exe
artifact: win-x64
- runner: macos-latest
platform: macos
arch: arm64
exe: intiface-engine
artifact: macos-arm64
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
if: matrix.platform == 'linux'
run: |
sudo apt-get -y update
sudo apt-get -y install libudev-dev libusb-1.0-0-dev libdbus-1-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform }}-${{ matrix.arch }}
- name: Build release binary
run: cargo build --release -p intiface-engine
- name: Prepare artifact
shell: bash
run: |
mkdir -p staging
cp target/release/${{ matrix.exe }} staging/
cp crates/intiface_engine/README.md staging/
cp crates/intiface_engine/CHANGELOG.md staging/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: staging/
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF_NAME#intiface-engine-}" >> "$GITHUB_ENV"
- name: Zip release packages
run: |
cd artifacts
for dir in */; do
slug="${dir%/}"
zip_name="intiface-engine-v${VERSION}-${slug}.zip"
(cd "$dir" && zip -j "../${zip_name}" *)
done
ls -la *.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}