Skip to content

Commit d7c554f

Browse files
authored
simplify CI and dolphin build process (#33)
* test * test * Update dolphin-emu-appimage.sh * Update get-dependencies.sh * Update get-dependencies.sh * Update dolphin-emu-appimage.sh * Update get-dependencies.sh * Update get-dependencies.sh * Update get-dependencies.sh * Update dolphin-emu-appimage.sh * Update stable.yml * Update nightly.yml
1 parent c259bcf commit d7c554f

File tree

4 files changed

+116
-169
lines changed

4 files changed

+116
-169
lines changed

.github/workflows/nightly.yml

Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,87 +16,58 @@ jobs:
1616
matrix:
1717
include:
1818
- runs-on: ubuntu-latest
19-
name: "Dolphin build"
19+
name: Build AppImage
2020
arch: x86_64
2121
- runs-on: ubuntu-24.04-arm
22-
name: "Dolphin build"
22+
name: Build AppImage
2323
arch: aarch64
2424
container: ghcr.io/pkgforge-dev/archlinux:latest
2525
steps:
2626
- uses: actions/checkout@v4
27-
with:
28-
persist-credentials: false
2927

3028
- name: Get dependencies
31-
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
29+
run: chmod +x ./get-dependencies.sh && DEVEL=true ./get-dependencies.sh
3230

3331
- name: Make AppImage
34-
run: |
35-
export DEVEL=true
36-
chmod +x ./dolphin-emu-appimage.sh && ./dolphin-emu-appimage.sh
37-
mkdir dist
38-
mv *.AppImage* dist/
39-
40-
- name: Check version file
41-
run: |
42-
cat ~/version
43-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
32+
run: chmod +x ./*-appimage.sh && ./*-appimage.sh
4433

4534
- name: Upload artifact
4635
uses: actions/[email protected]
4736
with:
4837
name: AppImage-${{ matrix.arch }}
49-
path: 'dist'
50-
51-
- name: Upload version file
52-
uses: actions/[email protected]
53-
with:
54-
name: version
55-
path: ~/version
56-
overwrite: true
38+
path: dist
5739

5840
release:
5941
if: ${{ github.ref_name == 'main' }}
6042
needs: [build]
6143
permissions: write-all
6244
runs-on: ubuntu-latest
63-
6445
steps:
65-
- uses: actions/[email protected]
66-
with:
67-
name: AppImage-x86_64
68-
69-
- uses: actions/[email protected]
70-
with:
71-
name: AppImage-aarch64
46+
- uses: actions/[email protected]
47+
with:
48+
pattern: AppImage-*
49+
merge-multiple: true
7250

73-
- uses: actions/[email protected]
74-
with:
75-
name: version
51+
- name: Read version and Get date
52+
run: |
53+
cat ./version
54+
echo "VERSION=$(cat ./version)" >> "${GITHUB_ENV}"
55+
echo "DATE=$(date +'%Y-%m-%d_%s')" >> "${GITHUB_ENV}"
7656
77-
- name: Read version
78-
run: |
79-
cat version
80-
export VERSION="$(cat version)"
81-
export SNAPSHOT_TAG="$(date --utc +'%Y-%m-%d')"
82-
echo "APP_VERSION=${VERSION}" >> "${GITHUB_ENV}"
83-
echo SNAPSHOT_TAG="${SNAPSHOT_TAG}" >> "${GITHUB_ENV}"
84-
85-
#Version Release
86-
- name: Del Previous Release
87-
run: gh release delete "nightly" --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y && sleep 5
88-
env:
89-
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
90-
continue-on-error: true
57+
- name: Del Previous Release
58+
run: gh release delete "nightly" --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y && sleep 5
59+
env:
60+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
61+
continue-on-error: true
9162

92-
- name: Release nightly build
93-
uses: softprops/[email protected]
94-
with:
95-
name: "Nightly Build (${{ env.SNAPSHOT_TAG }})"
96-
tag_name: "nightly"
97-
prerelease: true
98-
draft: false
99-
generate_release_notes: false
100-
make_latest: false
101-
files: |
102-
*.AppImage*
63+
- name: Release nightly build
64+
uses: softprops/[email protected]
65+
with:
66+
name: "Nightly Build (${{ env.DATE }})"
67+
tag_name: "nightly"
68+
prerelease: true
69+
draft: false
70+
generate_release_notes: false
71+
make_latest: false
72+
files: |
73+
*.AppImage*

.github/workflows/stable.yml

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -16,86 +16,62 @@ jobs:
1616
matrix:
1717
include:
1818
- runs-on: ubuntu-latest
19-
name: "Dolphin build"
19+
name: Build AppImage
2020
arch: x86_64
2121
- runs-on: ubuntu-24.04-arm
22-
name: "Dolphin build"
22+
name: Build AppImage
2323
arch: aarch64
2424
container: ghcr.io/pkgforge-dev/archlinux:latest
2525
steps:
2626
- uses: actions/checkout@v4
27-
with:
28-
persist-credentials: false
2927

3028
- name: Get dependencies
3129
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
3230

3331
- name: Make AppImage
34-
run: |
35-
chmod +x ./dolphin-emu-appimage.sh && ./dolphin-emu-appimage.sh
36-
mkdir dist
37-
mv *.AppImage* dist/
32+
run: chmod +x ./*-appimage.sh && ./*-appimage.sh
3833

39-
- name: Check version file
40-
run: |
41-
cat ~/version
42-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
43-
4434
- name: Upload artifact
4535
uses: actions/[email protected]
4636
with:
4737
name: AppImage-${{ matrix.arch }}
48-
path: 'dist'
49-
50-
- name: Upload version file
51-
uses: actions/[email protected]
52-
with:
53-
name: version
54-
path: ~/version
55-
overwrite: true
38+
path: dist
5639

5740
release:
58-
if: ${{ github.ref_name == 'main' }}
59-
needs: [build]
60-
permissions: write-all
61-
runs-on: ubuntu-latest
62-
63-
steps:
64-
- uses: actions/[email protected]
65-
with:
66-
name: AppImage-x86_64
67-
68-
- uses: actions/[email protected]
69-
with:
70-
name: AppImage-aarch64
71-
72-
- uses: actions/[email protected]
73-
with:
74-
name: version
41+
if: ${{ github.ref_name == 'main' }}
42+
needs: [build]
43+
permissions: write-all
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/[email protected]
47+
with:
48+
pattern: AppImage-*
49+
merge-multiple: true
7550

76-
- name: Read version and Get date
77-
run: |
78-
echo "VERSION=$(cat version)" >> "${GITHUB_ENV}"
79-
echo "DATE=$(date +'%Y-%m-%d_%s')" >> "${GITHUB_ENV}"
51+
- name: Read version and Get date
52+
run: |
53+
cat ./version
54+
echo "VERSION=$(cat ./version)" >> "${GITHUB_ENV}"
55+
echo "DATE=$(date +'%Y-%m-%d_%s')" >> "${GITHUB_ENV}"
8056
81-
- name: Release Artifacts
82-
uses: softprops/[email protected]
83-
with:
84-
name: "Dolphin Emulator: ${{ env.VERSION }}"
85-
tag_name: "${{ env.VERSION }}@${{ env.DATE }}"
86-
prerelease: false
87-
draft: false
88-
generate_release_notes: false
89-
make_latest: true
90-
files: |
91-
*.AppImage*
57+
- name: Release Artifacts
58+
uses: softprops/[email protected]
59+
with:
60+
name: "Dolphin Emulator: ${{ env.VERSION }}"
61+
tag_name: "${{ env.VERSION }}@${{ env.DATE }}"
62+
prerelease: false
63+
draft: false
64+
generate_release_notes: false
65+
make_latest: true
66+
files: |
67+
*.AppImage*
9268
93-
- uses: actions/checkout@v4
94-
- name: Update LATEST_VERSION
95-
run: |
96-
echo "${{ env.VERSION }}" > ./LATEST_VERSION
97-
git config user.name "github-actions[bot]"
98-
git config user.email "github-actions[bot]@users.noreply.github.com"
99-
git add ./LATEST_VERSION
100-
git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]'
101-
git push
69+
- uses: actions/checkout@v4
70+
- name: Update LATEST_VERSION
71+
run: |
72+
echo "${{ env.VERSION }}" > ./LATEST_VERSION
73+
git config user.name "github-actions[bot]"
74+
git config user.email "github-actions[bot]@users.noreply.github.com"
75+
git add ./LATEST_VERSION
76+
git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]'
77+
git push

dolphin-emu-appimage.sh

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,28 @@
22

33
set -ex
44

5-
REPO="https://github.com/dolphin-emu/dolphin.git"
6-
GRON="https://raw.githubusercontent.com/xonixx/gron.awk/refs/heads/main/gron.awk"
75
export APPIMAGE_EXTRACT_AND_RUN=1
86
export ARCH="$(uname -m)"
97

10-
# Determine to build nightly or stable
11-
if [ "$DEVEL" = 'true' ]; then
12-
echo "Making nightly build of dolphin-emu..."
13-
VERSION="$(git ls-remote "$REPO" HEAD | cut -c 1-9 | head -1)"
14-
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
15-
git clone "$REPO" ./dolphin
16-
else
17-
echo "Making stable build of dolphin-emu..."
18-
wget "$GRON" -O ./gron.awk
19-
chmod +x ./gron.awk
20-
VERSION=$(wget https://api.github.com/repos/dolphin-emu/dolphin/tags -O - | \
21-
./gron.awk | grep -v "nJoy" | awk -F'=|"' '/name/ {print $3}' | \
22-
sort -V -r | head -1)
23-
git clone --branch "$VERSION" --single-branch "$REPO" ./dolphin
24-
fi
25-
26-
# BUILD DOLPHIN
27-
(
28-
cd ./dolphin
29-
mkdir ./build
30-
cd ./build
31-
32-
git submodule update --init --recursive
33-
cmake .. -DLINUX_LOCAL_DEV=true -DCMAKE_POLICY_VERSION_MINIMUM=3.5
34-
make -j $(nproc)
35-
sudo make install
36-
37-
sudo cp -r ../Data/Sys /usr/local/bin
38-
sudo cp -r ./Source/Core/DolphinQt /usr/local/bin
39-
)
40-
418
# Deploy AppImage
42-
[ -n "$VERSION" ] && echo "$VERSION" > ~/version
9+
VERSION="$(cat ~/version)"
4310
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
4411
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
4512
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
4613

4714
export ADD_HOOKS="self-updater.bg.hook"
4815
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*dwarfs-$ARCH.AppImage.zsync"
4916
export OUTNAME=Dolphin_Emulator-"$VERSION"-anylinux.dwarfs-"$ARCH".AppImage
17+
export PATH_MAPPING_RELATIVE=1 # Dolphin is hardcoded to /urs/share
18+
export DEPLOY_LOCALE=1
5019
export DEPLOY_OPENGL=1
5120
export DEPLOY_VULKAN=1
5221
export DEPLOY_PIPEWIRE=1
5322

5423
# Bundle all libs
5524
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
5625
chmod +x ./quick-sharun
57-
./quick-sharun /usr/local/bin/dolphin-*
58-
59-
# copy locales, the dolphin binary expects them here
60-
mkdir -p ./AppDir/Source/Core
61-
cp -r /usr/local/bin/DolphinQt ./AppDir/Source/Core
62-
find ./AppDir/Source/Core/DolphinQt -type f ! -name 'dolphin-emu.mo' -delete
63-
64-
# when compiled portable this directory needs a capital S
65-
cp -rv /usr/local/bin/Sys ./AppDir/bin/Sys
26+
./quick-sharun /usr/bin/dolphin-*
6627

6728
# Force C locale due to issues with gconv causing crashes
6829
# See https://github.com/pkgforge-dev/Dolphin-emu-AppImage/issues/28
@@ -91,4 +52,7 @@ wget --retry-connrefused --tries=30 "$APPIMAGETOOL" -O ./appimagetool
9152
chmod +x ./appimagetool
9253
./appimagetool -n -u "$UPINFO" "$PWD"/AppDir "$PWD"/Dolphin_Emulator-"$VERSION"-anylinux.squashfs-"$ARCH".AppImage
9354

55+
mkdir -p ./dist
56+
mv -v ./*.AppImage* ./dist
57+
mv -v ~/version ./dist
9458
echo "All Done!"

get-dependencies.sh

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ pacman -Syu --noconfirm \
2121
lz4 \
2222
lzo \
2323
mesa \
24-
patchelf \
2524
pipewire-audio \
2625
pulseaudio \
2726
pulseaudio-alsa \
2827
qt6ct \
2928
sdl2 \
3029
speexdsp \
31-
strace \
3230
vulkan-headers \
33-
vulkan-nouveau \
34-
vulkan-radeon \
3531
wget \
3632
xcb-util-cursor \
3733
xorg-server-xvfb \
@@ -44,4 +40,44 @@ echo "Installing debloated packages..."
4440
echo "---------------------------------------------------------------"
4541
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
4642
chmod +x ./get-debloated-pkgs.sh
47-
./get-debloated-pkgs.sh --add-common
43+
sed -i 's|set -e|set -ex|' ./get-debloated-pkgs.sh
44+
./get-debloated-pkgs.sh --add-mesa llvm-libs-nano libxml2-mini qt6-base-mini gtk3-mini opus-mini
45+
46+
echo "Building dolphin..."
47+
echo "---------------------------------------------------------------"
48+
REPO="https://github.com/dolphin-emu/dolphin.git"
49+
GRON="https://raw.githubusercontent.com/xonixx/gron.awk/refs/heads/main/gron.awk"
50+
51+
# Determine to build nightly or stable
52+
if [ "$DEVEL" = 'true' ]; then
53+
echo "Making nightly build of dolphin-emu..."
54+
VERSION="$(git ls-remote "$REPO" HEAD | cut -c 1-9 | head -1)"
55+
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
56+
git clone "$REPO" ./dolphin
57+
else
58+
echo "Making stable build of dolphin-emu..."
59+
wget "$GRON" -O ./gron.awk
60+
chmod +x ./gron.awk
61+
VERSION=$(wget https://api.github.com/repos/dolphin-emu/dolphin/tags -O - | \
62+
./gron.awk | grep -v "nJoy" | awk -F'=|"' '/name/ {print $3}' | \
63+
sort -V -r | head -1)
64+
git clone --branch "$VERSION" --single-branch "$REPO" ./dolphin
65+
fi
66+
echo "$VERSION" > ~/version
67+
68+
# BUILD DOLPHIN
69+
cd ./dolphin
70+
mkdir ./build
71+
cd ./build
72+
git submodule update --init --recursive
73+
cmake .. \
74+
-DDISTRIBUTOR=pkgforge-dev \
75+
-DCMAKE_INSTALL_PREFIX=/usr \
76+
-DENABLE_ANALYTICS=OFF \
77+
-DENABLE_LLVM=OFF \
78+
-DUSE_DISCORD_PRESENCE=OFF \
79+
-DENABLE_AUTOUPDATE=OFF \
80+
-DENCODE_FRAMEDUMPS=OFF \
81+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
82+
make -j $(nproc)
83+
sudo make install

0 commit comments

Comments
 (0)