diff --git a/.gitea/workflows/app_builder.yaml b/.gitea/workflows/app_builder.yaml index e32d76b..3f9a55c 100644 --- a/.gitea/workflows/app_builder.yaml +++ b/.gitea/workflows/app_builder.yaml @@ -163,7 +163,7 @@ jobs: ARCH_PACKAGES=( base-devel curl git nodejs npm openssh rust webkit2gtk-4.1 gtk3 hicolor-icon-theme - fuse2 libappindicator-gtk3 librsvg xdotool + libappindicator-gtk3 librsvg xdotool ) for ARCH_INSTALL_ATTEMPT in 1 2 3; do @@ -242,15 +242,22 @@ jobs: runuser -u builder -- \ bash -lc "cd '$AUR_SOURCE_DIR' && makepkg --cleanbuild --noconfirm && makepkg --printsrcinfo > .SRCINFO" - echo "AUR_SOURCE_DIR=$AUR_SOURCE_DIR" >> "$GITHUB_ENV" + ARCH_PACKAGE_PATH="$(find "$AUR_SOURCE_DIR" -maxdepth 1 -type f -name 'gitty-desktop-*.pkg.tar.zst' -print -quit)" + if [ -z "$ARCH_PACKAGE_PATH" ]; then + echo "The native Arch package was not created" >&2 + exit 1 + fi - - name: Generate and build binary AUR package + echo "AUR_SOURCE_DIR=$AUR_SOURCE_DIR" >> "$GITHUB_ENV" + echo "ARCH_PACKAGE_PATH=$ARCH_PACKAGE_PATH" >> "$GITHUB_ENV" + + - name: Attach native Arch package to Gitea release run: | set -euo pipefail TOKEN="${GITEA_TOKEN:-${GITEA_FALLBACK_TOKEN:-}}" if [ -z "$TOKEN" ]; then - echo "A Gitea token is required to download the AppImage" >&2 + echo "A Gitea token is required to upload the native Arch package" >&2 exit 1 fi @@ -258,29 +265,54 @@ jobs: --header "Authorization: token $TOKEN" \ "$GITEA_API/repos/$OWNER/$REPO/releases/tags/$RELEASE_TAG")" export RELEASE_JSON - APPIMAGE_URL="$(node -e "const r=JSON.parse(process.env.RELEASE_JSON); const a=(r.assets || []).find(a => String(a.name || '').toLowerCase().endsWith('.appimage')); if (!a?.browser_download_url) process.exit(1); process.stdout.write(a.browser_download_url)")" - APPIMAGE_NAME="$(node -e "const r=JSON.parse(process.env.RELEASE_JSON); const a=(r.assets || []).find(a => String(a.name || '').toLowerCase().endsWith('.appimage')); if (!a?.name) process.exit(1); process.stdout.write(a.name)")" + RELEASE_ID="$(node -e "const r=JSON.parse(process.env.RELEASE_JSON); if (!r.id) process.exit(1); process.stdout.write(String(r.id))")" + PACKAGE_NAME="${ARCH_PACKAGE_PATH##*/}" + export PACKAGE_NAME + + if node -e "const r=JSON.parse(process.env.RELEASE_JSON); process.exit((r.assets || []).some(a => a.name === process.env.PACKAGE_NAME) ? 0 : 1)"; then + echo "Release asset $PACKAGE_NAME already exists; skipping upload." + else + curl --fail --location --silent --show-error \ + --request POST \ + --header "Authorization: token $TOKEN" \ + --form "attachment=@$ARCH_PACKAGE_PATH;type=application/octet-stream" \ + "$GITEA_API/repos/$OWNER/$REPO/releases/$RELEASE_ID/assets?name=$PACKAGE_NAME" + echo + echo "Attached $PACKAGE_NAME to Gitea release $RELEASE_TAG." + fi + + - name: Generate and build binary AUR package + run: | + set -euo pipefail + + TOKEN="${GITEA_TOKEN:-${GITEA_FALLBACK_TOKEN:-}}" + if [ -z "$TOKEN" ]; then + echo "A Gitea token is required to locate the native Arch package" >&2 + exit 1 + fi + + RELEASE_JSON="$(curl --fail --location --silent --show-error \ + --header "Authorization: token $TOKEN" \ + "$GITEA_API/repos/$OWNER/$REPO/releases/tags/$RELEASE_TAG")" + export RELEASE_JSON + PACKAGE_NAME="${ARCH_PACKAGE_PATH##*/}" + export PACKAGE_NAME + PACKAGE_URL="$(node -e "const r=JSON.parse(process.env.RELEASE_JSON); const a=(r.assets || []).find(a => a.name === process.env.PACKAGE_NAME); if (!a?.browser_download_url) process.exit(1); process.stdout.write(a.browser_download_url)")" AUR_BIN_DIR="$(mktemp -d)" cp PKGBUILD-bin "$AUR_BIN_DIR/PKGBUILD" - APPIMAGE_PATH="$AUR_BIN_DIR/$APPIMAGE_NAME" + PACKAGE_PATH="$AUR_BIN_DIR/$PACKAGE_NAME" curl --fail --location --silent --show-error \ --header "Authorization: token $TOKEN" \ - --output "$APPIMAGE_PATH" "$APPIMAGE_URL" - APPIMAGE_CHECKSUM="$(sha256sum "$APPIMAGE_PATH" | cut -d ' ' -f 1)" - ICON_PATH="$AUR_BIN_DIR/gitty-desktop.png" - curl --fail --location --silent --show-error \ - --output "$ICON_PATH" \ - "https://git.cbsk-tech.de/Christoph/GitLite/raw/tag/$RELEASE_TAG/src-tauri/icons/icon.png" - ICON_CHECKSUM="$(sha256sum "$ICON_PATH" | cut -d ' ' -f 1)" + --output "$PACKAGE_PATH" "$PACKAGE_URL" + PACKAGE_CHECKSUM="$(sha256sum "$PACKAGE_PATH" | cut -d ' ' -f 1)" sed -i \ -e "s/^pkgver=.*/pkgver=$PACKAGE_VERSION/" \ -e "s/^pkgrel=.*/pkgrel=1/" \ - -e "s|^_appimage=.*|_appimage=\"$APPIMAGE_NAME\"|" \ - -e "s|^_artifact_url=.*|_artifact_url=\"$APPIMAGE_URL\"|" \ - -e "s/^_tag=.*/_tag=$RELEASE_TAG/" \ - -e "/^sha256sums=/,/^[[:space:]]*'SKIP')$/c\\sha256sums=('$APPIMAGE_CHECKSUM'\\n '$ICON_CHECKSUM')" \ + -e "s|^_package=.*|_package=\"$PACKAGE_NAME\"|" \ + -e "s|^_artifact_url=.*|_artifact_url=\"$PACKAGE_URL\"|" \ + -e "s/^sha256sums=.*/sha256sums=('$PACKAGE_CHECKSUM')/" \ "$AUR_BIN_DIR/PKGBUILD" chown -R builder:builder "$AUR_BIN_DIR" diff --git a/PKGBUILD-bin b/PKGBUILD-bin index 8b581e9..6c91d04 100644 --- a/PKGBUILD-bin +++ b/PKGBUILD-bin @@ -3,43 +3,23 @@ pkgname=gitty-desktop-bin pkgver=2026.8.4 pkgrel=1 -pkgdesc="A lightweight, modern Git client built with Tauri (prebuilt AppImage)" +pkgdesc="A lightweight, modern Git client built with Tauri (prebuilt Arch package)" arch=('x86_64') url="https://git.cbsk-tech.de/Christoph/GitLite" license=('MIT') -depends=('fuse2' 'git' 'webkit2gtk-4.1' 'gtk3' 'hicolor-icon-theme' 'libappindicator-gtk3' 'librsvg' 'xdotool') +depends=('git' 'webkit2gtk-4.1' 'gtk3' 'hicolor-icon-theme' 'libappindicator-gtk3' 'librsvg' 'xdotool') provides=('gitty-desktop') conflicts=('gitty-desktop') options=('!strip') -_appimage="Gitty_${pkgver}_amd64.AppImage" -_artifact_url="https://cdn.cbsk-tech.de/gitty/${pkgver}/${_appimage}" -_tag=2026.8.4 -source=("${_appimage}::${_artifact_url}" - "gitty-desktop.png::${url}/raw/tag/${_tag}/src-tauri/icons/icon.png") -sha256sums=('SKIP' - 'SKIP') +_package="gitty-desktop-${pkgver}-1-x86_64.pkg.tar.zst" +_artifact_url="https://git.cbsk-tech.de/Christoph/GitLite/releases/download/${pkgver}/${_package}" +source=("${_package}::${_artifact_url}") +noextract=("${_package}") +sha256sums=('SKIP') package() { - install -Dm755 "$srcdir/$_appimage" \ - "$pkgdir/opt/$pkgname/gitty-desktop.AppImage" - install -d "$pkgdir/usr/bin" - ln -s "/opt/$pkgname/gitty-desktop.AppImage" \ - "$pkgdir/usr/bin/gitty-desktop" - - install -Dm644 "$srcdir/gitty-desktop.png" \ - "$pkgdir/usr/share/icons/hicolor/512x512/apps/gitty-desktop.png" - - install -d "$pkgdir/usr/share/applications" - cat > "$pkgdir/usr/share/applications/gitty-desktop.desktop" <<-EOF - [Desktop Entry] - Type=Application - Name=Gitty - Comment=$pkgdesc - Exec=gitty-desktop - Icon=gitty-desktop - Terminal=false - Categories=Development;RevisionControl; - StartupWMClass=gitty - EOF + # Extract only the native package payload, without carrying its package + # metadata (.PKGINFO, .BUILDINFO and .MTREE) across. + bsdtar -xf "$srcdir/$_package" -C "$pkgdir" usr } diff --git a/README.md b/README.md index d4217af..f74d68c 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Install Gitty from the AUR with an AUR helper: yay -S gitty-desktop ``` -To install the prebuilt AppImage instead of compiling from source: +To install the prebuilt native Arch package instead of compiling from source: ```bash yay -S gitty-desktop-bin @@ -75,8 +75,9 @@ makepkg -si ``` The source recipe downloads the public Gitea release archive and builds Gitty. -The `-bin` recipe installs the prebuilt AppImage. The release pipeline updates -both packages' versions, checksums, and `.SRCINFO` files. +The `-bin` recipe repackages the native `.pkg.tar.zst` release artifact. The +release pipeline updates both packages' versions, checksums, and `.SRCINFO` +files. ---