Skip to content

Commit 9a51043

Browse files
psadipsadiSamueru-sama
authored
add parallel matrix builds on CI (#5)
Speeds up building * ci: use matrix strategy * test * ci: use matrix build strategy * fix: typo duh * ci: update action versions * revert original style --------- Co-authored-by: psadi <[email protected]> Co-authored-by: Samuel <[email protected]>
1 parent feb3547 commit 9a51043

File tree

3 files changed

+237
-181
lines changed

3 files changed

+237
-181
lines changed

.github/workflows/blank.yml

Lines changed: 199 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,212 @@
1-
name: Appimage
1+
name: Build & Release Citron AppImage
22
concurrency:
33
group: build-${{ github.ref }}
44
cancel-in-progress: true
55

66
on:
77
schedule:
88
- cron: "0 14 * * 0"
9-
workflow_dispatch:
9+
workflow_dispatch: {}
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-22.04
13+
name: "${{ matrix.name }}"
14+
runs-on: ${{ matrix.runs-on }}
15+
strategy:
16+
matrix:
17+
include:
18+
- runs-on: ubuntu-latest
19+
script: "./*-appimage.sh"
20+
optimized: false
21+
name: "Citron build (Normal)"
22+
- runs-on: ubuntu-latest
23+
script: "./*-appimage.sh v3"
24+
optimized: true
25+
name: "Citron Build (Optimized)"
1426
container: artixlinux/artixlinux:latest
1527
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Install dependencies
19-
if: always()
20-
run: |
21-
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
22-
pacman -Syu --noconfirm base-devel strace patchelf curl wget \
23-
desktop-file-utils git artix-archlinux-support llvm mesa xorg-server-xvfb \
24-
vulkan-radeon vulkan-intel vulkan-nouveau pulseaudio pulseaudio-alsa pipewire
25-
pacman-key --init && pacman-key --populate archlinux
26-
printf "\n[extra]\nInclude = /etc/pacman.d/mirrorlist-arch\n" | tee -a /etc/pacman.conf
27-
sudo pacman -Syu --noconfirm \
28-
zsync \
29-
catch2 \
30-
enet \
31-
gamemode \
32-
cmake \
33-
gcc13 \
34-
glslang \
35-
glu \
36-
hidapi \
37-
xcb-util-wm \
38-
xcb-util-image \
39-
xcb-util-renderutil \
40-
libxkbcommon-x11 \
41-
libxi \
42-
nasm \
43-
qt6-tools \
44-
qt6-base \
45-
qt6-multimedia \
46-
qt6-wayland \
47-
mbedtls2 \
48-
fmt \
49-
nlohmann-json \
50-
aom \
51-
libass \
52-
haskell-gnutls \
53-
sdl2 \
54-
libva \
55-
meson \
56-
ninja \
57-
x264 \
58-
x265 \
59-
numactl \
60-
libvpx \
61-
libfdk-aac \
62-
libopusenc \
63-
ffmpeg \
64-
svt-av1 \
65-
dav1d \
66-
boost \
67-
clang \
68-
vulkan-headers \
69-
ffmpeg4.4 \
70-
zip \
71-
unzip \
72-
boost-libs \
73-
doxygen \
74-
python-pip \
75-
libzip \
76-
mbedtls \
77-
libzip \
78-
qt6ct
79-
80-
echo "Hacking makepkg to allow building as root in the container..."
81-
sudo sed -i 's|EUID == 0|EUID == 69|g' /usr/bin/makepkg
82-
mkdir -p /usr/local/bin
83-
cp /usr/bin/makepkg /usr/local/bin
84-
85-
echo "its -O3 the letter, not -03 the number"
86-
sudo sed -i 's|-O2|-O3|; s|MAKEFLAGS=.*|MAKEFLAGS="-j$(nproc)"|; s|#MAKEFLAGS|MAKEFLAGS|' /etc/makepkg.conf
87-
cat /etc/makepkg.conf
88-
89-
- name: Install debloated llvm-libs
90-
run: |
91-
LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-nano-x86_64.pkg.tar.zst"
92-
wget "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst
93-
pacman -U --noconfirm ./llvm-libs.pkg.tar.zst
94-
rm -f ./llvm-libs.pkg.tar.zst
95-
96-
- name: Install iculess libxml2 and qt6-core
97-
run: |
98-
QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-x86_64.pkg.tar.zst"
99-
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-x86_64.pkg.tar.zst"
100-
wget "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst
101-
wget "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst
102-
pacman -U --noconfirm ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
103-
rm -f ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
104-
105-
- name: Compile Citron
106-
run: |
107-
chmod +x ./*-appimage.sh && ./*-appimage.sh
108-
mkdir -p dist
109-
mv *.AppImage* dist/
110-
111-
- name: Compile Citron Optimized
112-
run: |
113-
rm -rf ./AppDir || true
114-
sudo pacman -R --noconfirm citron || true
115-
chmod +x ./*-appimage.sh && ./*-appimage.sh v3
116-
mkdir -p dist
117-
mv *.AppImage* dist/
118-
119-
- name: Check version file
120-
run: |
121-
cat ~/version
122-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
123-
124-
- name: Upload artifact
125-
uses: actions/[email protected]
126-
with:
127-
name: AppImage
128-
path: 'dist'
129-
130-
- name: Upload version file
131-
uses: actions/[email protected]
132-
with:
133-
name: version
134-
path: ~/version
135-
28+
- uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
32+
- name: Install dependencies
33+
if: always()
34+
run: |
35+
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
36+
pacman -Syu --noconfirm base-devel strace patchelf curl wget \
37+
desktop-file-utils git artix-archlinux-support llvm mesa xorg-server-xvfb \
38+
vulkan-radeon vulkan-intel vulkan-nouveau pulseaudio pulseaudio-alsa pipewire
39+
pacman-key --init && pacman-key --populate archlinux
40+
printf "\n[extra]\nInclude = /etc/pacman.d/mirrorlist-arch\n" | tee -a /etc/pacman.conf
41+
sudo pacman -Syu --noconfirm \
42+
zsync \
43+
catch2 \
44+
enet \
45+
gamemode \
46+
cmake \
47+
gcc13 \
48+
glslang \
49+
glu \
50+
hidapi \
51+
xcb-util-wm \
52+
xcb-util-image \
53+
xcb-util-renderutil \
54+
libxkbcommon-x11 \
55+
libxi \
56+
nasm \
57+
qt6-tools \
58+
qt6-base \
59+
qt6-multimedia \
60+
qt6-wayland \
61+
mbedtls2 \
62+
fmt \
63+
nlohmann-json \
64+
aom \
65+
libass \
66+
haskell-gnutls \
67+
sdl2 \
68+
libva \
69+
meson \
70+
ninja \
71+
x264 \
72+
x265 \
73+
numactl \
74+
libvpx \
75+
libfdk-aac \
76+
libopusenc \
77+
ffmpeg \
78+
svt-av1 \
79+
dav1d \
80+
boost \
81+
clang \
82+
vulkan-headers \
83+
ffmpeg4.4 \
84+
zip \
85+
unzip \
86+
boost-libs \
87+
doxygen \
88+
python-pip \
89+
libzip \
90+
mbedtls \
91+
libzip \
92+
qt6ct
93+
94+
echo "Hacking makepkg to allow building as root in the container..."
95+
sudo sed -i 's|EUID == 0|EUID == 69|g' /usr/bin/makepkg
96+
mkdir -p /usr/local/bin
97+
cp /usr/bin/makepkg /usr/local/bin
98+
99+
echo "its -O3 the letter, not -03 the number"
100+
sudo sed -i 's|-O2|-O3|; s|MAKEFLAGS=.*|MAKEFLAGS="-j$(nproc)"|; s|#MAKEFLAGS|MAKEFLAGS|' /etc/makepkg.conf
101+
cat /etc/makepkg.conf
102+
103+
- name: Install debloated llvm-libs
104+
run: |
105+
LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-nano-x86_64.pkg.tar.zst"
106+
wget "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst
107+
pacman -U --noconfirm ./llvm-libs.pkg.tar.zst
108+
rm -f ./llvm-libs.pkg.tar.zst
109+
110+
- name: Install iculess libxml2 and qt6-core
111+
run: |
112+
QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-x86_64.pkg.tar.zst"
113+
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-x86_64.pkg.tar.zst"
114+
wget "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst
115+
wget "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst
116+
pacman -U --noconfirm ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
117+
rm -f ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
118+
119+
- name: Compile Citron (Normal)
120+
if: ${{ matrix.optimized == false }}
121+
run: |
122+
chmod +x ./*-appimage.sh && ./*-appimage.sh
123+
mkdir -p dist
124+
mv *.AppImage* dist/
125+
126+
- name: Compile Citron (Optimized)
127+
if: ${{ matrix.optimized == true }}
128+
run: |
129+
rm -rf ./AppDir || true
130+
sudo pacman -R --noconfirm citron || true
131+
chmod +x ./*-appimage.sh && ./*-appimage.sh v3
132+
mkdir -p dist
133+
mv *.AppImage* dist/
134+
135+
- name: Upload artifact
136+
uses: actions/[email protected]
137+
with:
138+
name: citron-${{ matrix.optimized && 'optimized' || 'normal' }}-appimage
139+
path: "dist"
140+
141+
- name: Check version file
142+
if: ${{ matrix.optimized == false }}
143+
run: |
144+
cat ~/version
145+
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
146+
147+
- name: Upload version file
148+
if: ${{ matrix.optimized == false }}
149+
uses: actions/[email protected]
150+
with:
151+
name: version
152+
path: ~/version
153+
136154
release:
137-
needs: [build]
138-
permissions: write-all
139-
runs-on: ubuntu-latest
140-
141-
steps:
142-
- uses: actions/[email protected]
143-
with:
144-
name: AppImage
145-
- uses: actions/[email protected]
146-
with:
147-
name: version
148-
149-
- name: Read version
150-
run: |
151-
cat version
152-
export VERSION="$(<version)"
153-
echo "APP_VERSION=${VERSION}" >> "${GITHUB_ENV}"
154-
155-
#Version Release
156-
- name: Del Previous Release
157-
run: |
158-
gh release delete "${APP_VERSION}" --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y
159-
sleep 5
160-
env:
161-
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
162-
continue-on-error: true
163-
- name: Continuous Releaser
164-
uses: softprops/action-gh-release@v2
165-
with:
166-
name: "Citron AppImage ${{ env.APP_VERSION }}"
167-
tag_name: "${{ env.APP_VERSION }}"
168-
prerelease: false
169-
draft: false
170-
generate_release_notes: false
171-
make_latest: true
172-
files: |
173-
*.AppImage*
174-
continue-on-error: false
175-
176-
#Snapshot Release
177-
- name: Get Date
178-
run: |
179-
SNAPSHOT_TAG="$(date --utc +'%Y%m%d-%H%M%S')"
180-
echo SNAPSHOT_TAG="${SNAPSHOT_TAG}" >> "${GITHUB_ENV}"
181-
continue-on-error: false
182-
- name: Snapshot Releaser
183-
uses: softprops/action-gh-release@v2
184-
with:
185-
name: "Snapshot ${{ env.APP_VERSION }}"
186-
tag_name: "${{ env.SNAPSHOT_TAG }}"
187-
prerelease: false
188-
draft: false
189-
generate_release_notes: false
190-
make_latest: false
191-
files: |
192-
*.AppImage*
193-
continue-on-error: false
155+
name: "release"
156+
needs: [build]
157+
permissions:
158+
actions: read
159+
security-events: write
160+
contents: write
161+
runs-on: ubuntu-latest
162+
steps:
163+
- uses: actions/[email protected]
164+
with:
165+
name: citron-optimized-appimage
166+
167+
- uses: actions/[email protected]
168+
with:
169+
name: citron-normal-appimage
170+
171+
- uses: actions/[email protected]
172+
with:
173+
name: version
174+
175+
- name: Read version
176+
run: |
177+
cat version
178+
export VERSION="$(<version)"
179+
SNAPSHOT_TAG="$(date --utc +'%Y%m%d-%H%M%S')"
180+
echo "APP_VERSION=${VERSION}" >> "${GITHUB_ENV}"
181+
echo SNAPSHOT_TAG="${SNAPSHOT_TAG}" >> "${GITHUB_ENV}"
182+
183+
- name: Del Previous Release
184+
run: |
185+
gh release delete "${APP_VERSION}" --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y
186+
sleep 5
187+
env:
188+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
189+
continue-on-error: true
190+
- name: Continuous Releaser
191+
uses: softprops/action-gh-release@v2
192+
with:
193+
name: "Citron AppImage ${{ env.APP_VERSION }}"
194+
tag_name: "${{ env.APP_VERSION }}"
195+
prerelease: false
196+
draft: false
197+
generate_release_notes: false
198+
make_latest: true
199+
files: |
200+
*.AppImage*
201+
202+
- name: Snapshot Releaser
203+
uses: softprops/action-gh-release@v2
204+
with:
205+
name: "Snapshot ${{ env.APP_VERSION }}"
206+
tag_name: "${{ env.SNAPSHOT_TAG }}"
207+
prerelease: false
208+
draft: false
209+
generate_release_notes: false
210+
make_latest: false
211+
files: |
212+
*.AppImage*

0 commit comments

Comments
 (0)