Skip to content

Commit 06de6b7

Browse files
authored
refactor, use wrapper scripts, add aarch64 releases (#15)
1 parent 638da4f commit 06de6b7

File tree

3 files changed

+118
-162
lines changed

3 files changed

+118
-162
lines changed

.github/workflows/blank.yml

Lines changed: 59 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,92 +5,74 @@ concurrency:
55

66
on:
77
schedule:
8-
- cron: "0 15 * * 0"
9-
workflow_dispatch:
8+
- cron: "0 7 1/21 * *"
9+
workflow_dispatch: {}
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-22.04
14-
container: artixlinux/artixlinux:latest
13+
name: "${{ matrix.name }} (${{ matrix.arch }})"
14+
runs-on: ${{ matrix.runs-on }}
15+
strategy:
16+
matrix:
17+
include:
18+
- runs-on: ubuntu-latest
19+
name: Build AppImage
20+
arch: x86_64
21+
- runs-on: ubuntu-24.04-arm
22+
name: Build AppImage
23+
arch: aarch64
24+
container: ghcr.io/pkgforge-dev/archlinux:latest
1525
steps:
16-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v4
1727

18-
- name: build
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 xcb-util-cursor \
23-
desktop-file-utils git artix-archlinux-support llvm mesa xorg-server-xvfb
24-
pacman-key --init && pacman-key --populate archlinux
25-
printf "\n[extra]\nInclude = /etc/pacman.d/mirrorlist-arch\n" | tee -a /etc/pacman.conf
26-
pacman -Syu --noconfirm zsync strawberry qt6ct qt6-wayland pulseaudio pulseaudio-alsa pipewire-audio
28+
- name: Get dependencies
29+
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
2730

28-
- name: Install iculess libxml2 and qt6-core
29-
run: |
30-
QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-x86_64.pkg.tar.zst"
31-
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-x86_64.pkg.tar.zst"
32-
wget --retry-connrefused --tries=30 "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst
33-
wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst
34-
pacman -U --noconfirm ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
35-
rm -f ./qt6-base-iculess.pkg.tar.zst ./libxml2-iculess.pkg.tar.zst
31+
- name: Make AppImage
32+
run: chmod +x ./*-appimage.sh && ./*-appimage.sh
3633

37-
- name: Install ffmpeg mini
38-
run: |
39-
FFMPEG_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/ffmpeg-mini-x86_64.pkg.tar.zst"
40-
wget --retry-connrefused --tries=30 "$FFMPEG_URL" -O ./ffmpeg-mini-x86_64.pkg.tar.zst
41-
pacman -U --noconfirm ./ffmpeg-mini-x86_64.pkg.tar.zst
42-
rm -f ./ffmpeg-mini-x86_64.pkg.tar.zst
34+
- name: Upload artifact
35+
uses: actions/[email protected]
36+
with:
37+
name: AppImage-${{ matrix.arch }}
38+
path: dist
4339

44-
- name: Make AppImage
45-
run: |
46-
chmod +x ./*-appimage.sh && ./*-appimage.sh
47-
mkdir dist
48-
mv *.AppImage* dist/
49-
50-
- name: Check version file
51-
run: |
52-
cat ~/version
53-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
54-
55-
- name: Upload artifact
56-
uses: actions/[email protected]
57-
with:
58-
name: AppImage
59-
path: 'dist'
60-
61-
- name: Upload version file
62-
uses: actions/[email protected]
63-
with:
64-
name: version
65-
path: ~/version
66-
6740
release:
68-
needs: [build]
69-
permissions: write-all
70-
runs-on: ubuntu-latest
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
7150

72-
steps:
73-
- uses: actions/[email protected]
74-
with:
75-
name: AppImage
76-
- uses: actions/[email protected]
77-
with:
78-
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}"
7956
80-
- name: Read version and Get date
81-
run: |
82-
echo "VERSION=$(cat version)" >> "${GITHUB_ENV}"
83-
echo "DATE=$(date +'%Y-%m-%d_%s')" >> "$GITHUB_ENV"
57+
- name: Release Artifacts
58+
uses: softprops/[email protected]
59+
with:
60+
name: "strawberry: ${{ 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*
68+
*.AppBundle*
8469
85-
- name: Release Artifacts
86-
uses: softprops/[email protected]
87-
with:
88-
name: "strawberry: ${{ env.VERSION }}"
89-
tag_name: "${{ env.VERSION }}@${{ env.DATE }}"
90-
prerelease: false
91-
draft: false
92-
generate_release_notes: false
93-
fail_on_unmatched_files: false
94-
make_latest: true
95-
files: |
96-
*.AppImage*
70+
- uses: actions/checkout@v4
71+
- name: Update LATEST_VERSION
72+
run: |
73+
echo "${{ env.VERSION }}" > ./LATEST_VERSION
74+
git config user.name "github-actions[bot]"
75+
git config user.email "github-actions[bot]@users.noreply.github.com"
76+
git add ./LATEST_VERSION
77+
git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]'
78+
git push

get-dependencies.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
ARCH="$(uname -m)"
6+
EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh"
7+
8+
pacman -Syu --noconfirm \
9+
base-devel \
10+
curl \
11+
git \
12+
libxcb \
13+
libxcursor \
14+
libxi \
15+
libxkbcommon \
16+
libxkbcommon-x11 \
17+
libxrandr \
18+
libxtst \
19+
pipewire-audio \
20+
pulseaudio \
21+
pulseaudio-alsa \
22+
qt6ct \
23+
qt6-wayland \
24+
strawberry \
25+
wget \
26+
xorg-server-xvfb \
27+
zsync
28+
29+
echo "Installing debloated packages..."
30+
echo "---------------------------------------------------------------"
31+
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
32+
chmod +x ./get-debloated-pkgs.sh
33+
./get-debloated-pkgs.sh --add-mesa --prefer-nano qt6-base-mini libxml2-mini opus-mini
34+
35+
pacman -Q strawberry | awk '{print $2; exit}' > ~/version

strawberry-appimage.sh

Lines changed: 24 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,31 @@
11
#!/bin/sh
22

3-
set -eu
4-
5-
PACKAGE=strawberry
6-
DESKTOP=org.strawberrymusicplayer.strawberry.desktop
7-
ICON=strawberry.png
8-
9-
export ARCH="$(uname -m)"
10-
export APPIMAGE_EXTRACT_AND_RUN=1
11-
export VERSION=$(pacman -Q "$PACKAGE" | awk 'NR==1 {print $2; exit}')
12-
echo "$VERSION" > ~/version
13-
14-
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
15-
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
16-
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
17-
18-
# Prepare AppDir
19-
mkdir -p ./AppDir/shared/lib
20-
cd ./AppDir
21-
22-
cp -v /usr/share/applications/"$DESKTOP" ./
23-
cp -v /usr/share/icons/hicolor/128x128/apps/"$ICON" ./
24-
cp -v /usr/share/icons/hicolor/128x128/apps/"$ICON" ./.DirIcon
3+
set -eux
4+
5+
ARCH="$(uname -m)"
6+
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
7+
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
8+
VERSION="$(cat ~/version)"
9+
10+
export ADD_HOOKS="self-updater.bg.hook"
11+
export DESKTOP=/usr/share/applications/org.strawberrymusicplayer.strawberry.desktop
12+
export ICON=/usr/share/icons/hicolor/128x128/apps/strawberry.png
13+
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
14+
export OUTNAME=strawberry-"$VERSION"-anylinux-"$ARCH".AppImage
15+
export DEPLOY_OPENGL=1
16+
export DEPLOY_PIPEWIRE=1
17+
export DEPLOY_GSTREAMER=1
2518

2619
# ADD LIBRARIES
27-
wget "$LIB4BN" -O ./lib4bin
28-
chmod +x ./lib4bin
29-
xvfb-run -a -- ./lib4bin -p -v -s -k -e \
30-
/usr/bin/strawberry* \
31-
/usr/lib/libgst* \
32-
/usr/lib/gstreamer-*/*.so \
33-
/usr/lib/qt6/plugins/iconengines/* \
34-
/usr/lib/qt6/plugins/imageformats/* \
35-
/usr/lib/qt6/plugins/platforms/* \
36-
/usr/lib/qt6/plugins/platformthemes/* \
37-
/usr/lib/qt6/plugins/styles/* \
38-
/usr/lib/qt6/plugins/sqldrivers/* \
39-
/usr/lib/qt6/plugins/tls/* \
40-
/usr/lib/qt6/plugins/xcbglintegrations/* \
41-
/usr/lib/qt6/plugins/wayland-*/* \
42-
/usr/lib/pulseaudio/* \
43-
/usr/lib/pipewire-*/* \
44-
/usr/lib/spa-*/*/*
45-
46-
# DEPLOY GSTREAMER
47-
echo "Deploying Gstreamer binaries..."
48-
cp -vn /usr/lib/gstreamer-*/* ./shared/lib/gstreamer-* || true
49-
50-
# Patch a relative interpreter for the gstreamer plugins
51-
echo "Sharunning Gstreamer bins..."
52-
rm -f ./shared/lib/gstreamer-1.0/libgstopengl* || true
53-
for plugin in ./shared/lib/gstreamer-1.0/gst-*; do
54-
if file "$plugin" | grep -i 'elf.*executable'; then
55-
mv "$plugin" ./shared/bin && ln -s ../../../sharun "$plugin"
56-
echo "Sharan $plugin"
57-
else
58-
echo "$plugin is not a binary, skipping..."
59-
fi
60-
done
61-
62-
# Prepare sharun
63-
ln ./sharun ./AppRun
64-
./sharun -g
65-
66-
# Remove bloats
67-
echo "Removing bloats..."
68-
rm -f ./shared/lib/libLLVM* ./shared/lib/libgallium* || true
20+
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
21+
chmod +x ./quick-sharun
22+
./quick-sharun /usr/bin/strawberry*
6923

7024
# MAKE APPIMAGE WITH URUNTIME
71-
cd ..
72-
wget -q "$URUNTIME" -O ./uruntime
73-
chmod +x ./uruntime
74-
75-
#Add udpate info to runtime
76-
echo "Adding update information \"$UPINFO\" to runtime..."
77-
printf "$UPINFO" > data.upd_info
78-
llvm-objcopy --update-section=.upd_info=data.upd_info \
79-
--set-section-flags=.upd_info=noload,readonly ./uruntime
80-
printf 'AI\x02' | dd of=./uruntime bs=1 count=3 seek=8 conv=notrunc
81-
82-
echo "Generating AppImage..."
83-
./uruntime --appimage-mkdwarfs -f \
84-
--set-owner 0 --set-group 0 \
85-
--no-history --no-create-timestamp \
86-
--compression zstd:level=22 -S26 -B8 \
87-
--header uruntime \
88-
-i ./AppDir -o "$PACKAGE"-"$VERSION"-anylinux-"$ARCH".AppImage
25+
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage
26+
chmod +x ./uruntime2appimage
27+
./uruntime2appimage
8928

90-
echo "Generating zsync file..."
91-
zsyncmake *.AppImage -u *.AppImage
92-
echo "All Done!"
29+
mkdir -p ./dist
30+
mv -v ./*.AppImage* ./dist
31+
mv -v ~/version ./dist

0 commit comments

Comments
 (0)