-
-
Notifications
You must be signed in to change notification settings - Fork 40
102 lines (86 loc) · 2.86 KB
/
Copy pathrelease_linux.yml
File metadata and controls
102 lines (86 loc) · 2.86 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
name: Build Electron App (Linux)
on:
workflow_dispatch:
permissions:
contents: write
packages: none
actions: read
pull-requests: none
issues: none
jobs:
electron-build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.12.0"
cache: npm
cache-dependency-path: |
package-lock.json
GSM_Overlay/package-lock.json
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: |
GSM_Overlay/input_server -> GSM_Overlay/input_server/target
- name: Cache Electron binaries
uses: actions/cache@v4
with:
path: |
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-electron-cache-${{ hashFiles('package-lock.json', 'GSM_Overlay/package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-cache-
- name: Install Linux native build deps
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libudev-dev \
libx11-dev \
libxtst-dev
- name: Build gamepad server (Linux)
run: |
cargo build --release --manifest-path GSM_Overlay/input_server/Cargo.toml
mkdir -p GSM_Overlay/input_server/bin/linux
cp GSM_Overlay/input_server/target/release/gsm_overlay_server GSM_Overlay/input_server/bin/linux/gsm_overlay_server
chmod +x GSM_Overlay/input_server/bin/linux/gsm_overlay_server
- name: Build Overlay
id: build_overlay_linux
working-directory: ./GSM_Overlay
run: |
npm ci --prefer-offline --no-audit --fund=false
npm run package
- name: Install dependencies
run: |
npm ci --prefer-offline --no-audit --fund=false
- name: Get version from package.json
id: version_check
run: |
echo "Fetching version from package.json..."
PACKAGE_VERSION=$(jq -r .version < ./package.json)
if [ -z "$PACKAGE_VERSION" ]; then
echo "Error: Could not extract version from package.json"
exit 1
fi
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
- name: Build Electron app for Linux
run: |
npm run app:dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release
uses: actions/upload-artifact@v4
with:
name: linux-build-artifacts
path: dist/*.AppImage