feat(release): attach native Arch package and repackage for AUR
Update release workflow to detect and attach the native Arch package. Switch the binary AUR recipe to repackage the .pkg.tar.zst. Adjust checksums and packaging steps so the output carries only the native payload without bundling upstream package metadata. - Attach the native .pkg.tar.zst to Gitea releases. - Rework binary AUR recipe to extract usr from the native package. - Update README to document using the native Arch package.
This commit is contained in:
@@ -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"
|
||||
|
||||
+10
-30
@@ -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
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user