@@ -310,3 +310,104 @@ jobs:
310310 if-no-files-found : error
311311 retention-days : 30
312312 compression-level : 0
313+
314+ - name : Build Arch Linux package (.pkg.tar.zst)
315+ if : matrix.label == 'modern'
316+ run : |
317+ set -euo pipefail
318+
319+ VERSION=$(grep 'projectVersionName' gradle/libs.versions.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
320+ PKG_NAME="github-store"
321+ PKG_DIR="pkg-root"
322+
323+ # Find the app directory produced by packageAppImage
324+ APP_ROOT=""
325+ for candidate in \
326+ composeApp/build/compose/binaries/main/app/GitHub-Store \
327+ composeApp/build/compose/binaries/main/app-image/GitHub-Store; do
328+ if [ -f "$candidate/bin/GitHub-Store" ]; then
329+ APP_ROOT="$candidate"
330+ break
331+ fi
332+ done
333+
334+ # Fall back to the AppDir we created earlier if still present
335+ if [ -z "$APP_ROOT" ] && [ -f "GitHub-Store.AppDir/bin/GitHub-Store" ]; then
336+ APP_ROOT="GitHub-Store.AppDir"
337+ fi
338+
339+ if [ -z "$APP_ROOT" ]; then
340+ echo "ERROR: Could not find app directory for Arch packaging"
341+ exit 1
342+ fi
343+
344+ # Build the package tree
345+ mkdir -p "$PKG_DIR/opt/github-store"
346+ cp -a "$APP_ROOT"/. "$PKG_DIR/opt/github-store/"
347+
348+ # Launcher symlink
349+ mkdir -p "$PKG_DIR/usr/bin"
350+ ln -s "/opt/github-store/bin/GitHub-Store" "$PKG_DIR/usr/bin/github-store"
351+
352+ # Desktop entry
353+ mkdir -p "$PKG_DIR/usr/share/applications"
354+ cat > "$PKG_DIR/usr/share/applications/github-store.desktop" << 'EOF'
355+ [Desktop Entry]
356+ Type=Application
357+ Name=GitHub Store
358+ Exec=/opt/github-store/bin/GitHub-Store
359+ Icon=github-store
360+ Categories=Development;
361+ Comment=Cross-platform app store for GitHub releases
362+ StartupWMClass=github-store
363+ EOF
364+ sed -i 's/^ //' "$PKG_DIR/usr/share/applications/github-store.desktop"
365+
366+ # Icon
367+ if [ -f "$PKG_DIR/opt/github-store/lib/GitHub-Store.png" ]; then
368+ mkdir -p "$PKG_DIR/usr/share/icons/hicolor/256x256/apps"
369+ cp "$PKG_DIR/opt/github-store/lib/GitHub-Store.png" \
370+ "$PKG_DIR/usr/share/icons/hicolor/256x256/apps/github-store.png"
371+ fi
372+
373+ # .PKGINFO (pacman metadata — must be a flat file at archive root)
374+ INSTALLED_SIZE=$(du -sb "$PKG_DIR" | cut -f1)
375+ cat > "$PKG_DIR/.PKGINFO" << EOF
376+ pkgname = ${PKG_NAME}
377+ pkgver = ${VERSION}-1
378+ pkgdesc = Cross-platform app store for GitHub releases
379+ url = https://github.com/OpenHub-Store/GitHub-Store
380+ builddate = $(date +%s)
381+ packager = GitHub Actions
382+ arch = x86_64
383+ license = GPL-3.0
384+ size = ${INSTALLED_SIZE}
385+ depend = java-runtime>=21
386+ depend = hicolor-icon-theme
387+ EOF
388+ sed -i 's/^ //' "$PKG_DIR/.PKGINFO"
389+
390+ # Create .pkg.tar.zst
391+ sudo apt-get install -y zstd
392+ OUTPUT_DIR="composeApp/build/compose/binaries/main/arch"
393+ mkdir -p "$OUTPUT_DIR"
394+ ARCHIVE="${PKG_NAME}-${VERSION}-1-x86_64.pkg.tar.zst"
395+
396+ cd "$PKG_DIR"
397+ # .PKGINFO must come first in the archive
398+ tar --zstd -cf "../${OUTPUT_DIR}/${ARCHIVE}" .PKGINFO opt usr
399+ cd ..
400+
401+ echo "Created Arch package:"
402+ ls -lh "${OUTPUT_DIR}/${ARCHIVE}"
403+ shell : bash
404+
405+ - name : Upload Arch Linux package
406+ if : matrix.label == 'modern'
407+ uses : actions/upload-artifact@v4
408+ with :
409+ name : linux-arch
410+ path : composeApp/build/compose/binaries/main/arch/*.pkg.tar.zst
411+ if-no-files-found : error
412+ retention-days : 30
413+ compression-level : 0
0 commit comments