-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (123 loc) · 4.28 KB
/
linux.yml
File metadata and controls
125 lines (123 loc) · 4.28 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build on Linux
on:
push:
branches:
- master
jobs:
build:
strategy:
matrix:
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
runs-on: ${{ matrix.os }}
env:
ARCH: "${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'x86_64' }}"
BIN_CHICKEN_SIGNATURE_PUBLIC_KEY: ${{ vars.MINISIGN_PUBLIC_KEY }}
steps:
- name: Generate build UUID
id: build_uuid
run: |
BUILD_UUID=$(uuidgen)
echo "BUILD_UUID=$BUILD_UUID" >> $GITHUB_OUTPUT
echo "BIN_CHICKEN_UUID=$BUILD_UUID" >> $GITHUB_ENV
echo "The UUID for this build is $BUILD_UUID"
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libx11-xcb-dev \
desktop-file-utils \
libasound2-dev \
libssl-dev libx11-dev \
libgl1-mesa-dev \
libxext-dev \
libva-dev \
libdrm-dev \
libnvidia-compute-570 \
libnvidia-decode-570 \
nvidia-cuda-dev \
libdrm-dev \
libgbm-dev \
libxfixes-dev \
libxdamage-dev \
libxrandr-dev \
libxcomposite-dev \
libglib2.0-dev \
libdbus-1-dev \
libpipewire-0.3-dev \
libfontconfig-dev
rustup update
rustup default 1.93
- uses: Swatinem/rust-cache@v2
- uses: r7kamura/rust-problem-matchers@v1
- name: Install libcontemporary utils
run: |
cargo install --git https://github.com/vicr123/contemporary-rs.git cargo-cntp-bundle
cargo install --git https://github.com/vicr123/contemporary-rs.git cargo-cntp-deploy
- name: Build
run: cargo build --verbose --release
- name: Bundle
run: cargo cntp-bundle
working-directory: thegrid
- name: Deploy
run: cargo cntp-deploy --output-file "$HOME/theGrid-$ARCH.AppImage"
working-directory: thegrid
- uses: actions/upload-artifact@v4
with:
name: theGrid-linux-${{ env.ARCH }}
path: "~/theGrid-${{ env.ARCH }}.AppImage"
- name: Print build UUID
env:
BUILD_UUID: ${{ steps.build_uuid.outputs.BUILD_UUID }}
run: echo "$BUILD_UUID" > build_uuid.txt
- uses: actions/upload-artifact@v4
with:
name: build_uuid-${{ env.ARCH }}
path: build_uuid.txt
bin-chicken:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
env:
ARCH: "${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'x86_64' }}"
steps:
- name: Install minisign
run: |
sudo apt-get update
sudo apt-get install -y minisign
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: theGrid-linux-${{ env.ARCH }}
- name: Download build UUID
uses: actions/download-artifact@v4
with:
name: build_uuid-${{ env.ARCH }}
- name: Sign artifact
env:
MINISIGN_PRIV_KEY: ${{ secrets.MINISIGN_KEY }}
run: |
printf '%s' "$MINISIGN_PRIV_KEY" > minisign.key
minisign -S -s minisign.key -m theGrid-${{ env.ARCH }}.AppImage
- name: Upload to bin-chicken
env:
BIN_CHICKEN_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BIN_CHICKEN_CHANNEL: blueprint
BIN_CHICKEN_TARGET: ${{ env.ARCH }}-unknown-linux-gnu
BIN_CHICKEN_REPOSITORY: thegrid
UPLOAD_FILE: theGrid-${{ env.ARCH }}.AppImage
run: |
curl -v --fail-with-body -T $UPLOAD_FILE \
-H "Authorization: Bearer $BIN_CHICKEN_TOKEN" \
-H "Content-Type: application/octet-stream" \
-H "X-Bin-Chicken-Channel: $BIN_CHICKEN_CHANNEL" \
-H "X-Bin-Chicken-Target: $BIN_CHICKEN_TARGET" \
-H "X-Bin-Chicken-Original-Filename: $UPLOAD_FILE" \
-H "X-Bin-Chicken-UUID: $(cat build_uuid.txt)" \
-H "X-Bin-Chicken-Signature: $(cat $UPLOAD_FILE.minisig | base64 -w 0)" \
https://binchicken.vicr123.com/api/repositories/$BIN_CHICKEN_REPOSITORY