Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/validate-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,48 @@ jobs:
target: "srcinfo"
builddir: "gitkraken-aur"
pkgname: "gitkraken"
sources:
name: Verify ${{ matrix.arch }} source
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false

- name: Verify source URL, checksum, and layout
run: |
set -euo pipefail
cd gitkraken-aur
# shellcheck disable=SC1091
source PKGBUILD
arch="${{ matrix.arch }}"
declare -n src="source_${arch}"
declare -n sums="sha256sums_${arch}"
url="${src[0]#*::}"
expected="${sums[0]}"
echo "Arch: ${arch}"
echo "URL: ${url}"
echo "Expected: ${expected}"
curl -fsSL "${url}" -o pkg.tar.gz
actual="$(sha256sum pkg.tar.gz | cut -d' ' -f1)"
echo "Actual: ${actual}"
if [[ "${actual}" != "${expected}" ]]; then
echo "::error::Checksum mismatch for ${arch} (${actual} != ${expected})"
exit 1
fi
contents="$(tar tzf pkg.tar.gz)"
for entry in gitkraken/gitkraken gitkraken/gitkraken.png; do
if ! grep -qx "${entry}" <<<"${contents}"; then
echo "::error::Expected ${entry} missing from ${arch} tarball"
exit 1
fi
done
echo "OK: ${arch} source verified"
linter:
name: Code Base
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ You can also submit [feature requests](https://feedback.gitkraken.com/) and see

- Change to the [gitkraken-aur](gitkraken-aur) folder
- Update package version in [PKGBUILD](gitkraken-aur/PKGBUILD)
- Update checksums with `updpkgsums`
- Update checksums with `updpkgsums` (this only refreshes the build host's
architecture; `updpkgsums` leaves `sha256sums_aarch64` untouched on an
`x86_64` host — `./update.sh` hashes the aarch64 tarball directly to cover it)
- Do a test installation with `makepkg --syncdeps --install` [Docs for makepkg](https://wiki.archlinux.org/title/makepkg)
- Update [.SRCINFO](gitkraken-aur/.SRCINFO) with `makepkg --printsrcinfo > .SRCINFO` [Docs for makepkg](https://wiki.archlinux.org/title/makepkg)
7 changes: 5 additions & 2 deletions gitkraken-aur/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pkgbase = gitkraken
pkgrel = 1
url = https://www.gitkraken.com/
arch = x86_64
arch = aarch64
license = custom
depends = nss
depends = gtk3
Expand All @@ -14,13 +15,15 @@ pkgbase = gitkraken
provides = gitkraken
options = !strip
options = !debug
source = gitkraken-12.2.0.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/12.2.0/gitkraken-amd64.tar.gz
source = GitKraken.desktop
source = eula.html
source = gitkraken.sh
sha256sums = 6c46dcd0497e5a6084229c2a059fb2dd50d2ee165dea01d24c2b38697a372942
sha256sums = 078fa2cdf6826d956bf73387fb2ef147b1aca5f4a7a3cb4be8c71e6105fc9c6c
sha256sums = 5b7b39b331bc32a606e1e79c695df4519c9b220225be00fb34ef368c3af319a6
sha256sums = c78ef86324946f856cc5c11549990722155a5e883dc94f92a95169c7ab5fb63e
source_x86_64 = gitkraken-12.2.0-x86_64.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/12.2.0/gitkraken-amd64.tar.gz
sha256sums_x86_64 = 6c46dcd0497e5a6084229c2a059fb2dd50d2ee165dea01d24c2b38697a372942
source_aarch64 = gitkraken-12.2.0-aarch64.tar.gz::https://api.gitkraken.dev/releases/production/linux/arm64/12.2.0/gitkraken-aarch64.tar.gz
sha256sums_aarch64 = 8fb4fe1114b1f76ddc00c7c7be12ea8542cb9597062f073f358f0e239167ab51

pkgname = gitkraken
10 changes: 6 additions & 4 deletions gitkraken-aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pkgver=12.2.0
pkgdesc="The intuitive, fast, and beautiful cross-platform Git client."
url="https://www.gitkraken.com/"
provides=('gitkraken')
arch=('x86_64')
arch=('x86_64' 'aarch64')
license=('custom')
depends=('nss' 'gtk3' 'libsecret' 'libxkbfile')
optdepends=('git-lfs: git-lfs support'
Expand All @@ -24,15 +24,17 @@ makedepends=()
backup=()
install=''
source=(
"${pkgname}-${pkgver}.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/${pkgver}/gitkraken-amd64.tar.gz"
"GitKraken.desktop"
"eula.html"
"gitkraken.sh"
)
sha256sums=('6c46dcd0497e5a6084229c2a059fb2dd50d2ee165dea01d24c2b38697a372942'
'078fa2cdf6826d956bf73387fb2ef147b1aca5f4a7a3cb4be8c71e6105fc9c6c'
source_x86_64=("${pkgname}-${pkgver}-x86_64.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/${pkgver}/gitkraken-amd64.tar.gz")
source_aarch64=("${pkgname}-${pkgver}-aarch64.tar.gz::https://api.gitkraken.dev/releases/production/linux/arm64/${pkgver}/gitkraken-aarch64.tar.gz")
sha256sums=('078fa2cdf6826d956bf73387fb2ef147b1aca5f4a7a3cb4be8c71e6105fc9c6c'
'5b7b39b331bc32a606e1e79c695df4519c9b220225be00fb34ef368c3af319a6'
'c78ef86324946f856cc5c11549990722155a5e883dc94f92a95169c7ab5fb63e')
sha256sums_x86_64=('6c46dcd0497e5a6084229c2a059fb2dd50d2ee165dea01d24c2b38697a372942')
sha256sums_aarch64=('8fb4fe1114b1f76ddc00c7c7be12ea8542cb9597062f073f358f0e239167ab51')
options=('!strip' '!debug')

package() {
Expand Down
12 changes: 12 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ fi
echo "Refreshing checksums"
updpkgsums

# updpkgsums only regenerates checksums for the build host's architecture, so the
# aarch64 tarball is never hashed on the x86_64 update runner. Compute it directly
# (just hashing a download, no emulation needed) and splice it into the PKGBUILD.
echo "Refreshing aarch64 checksum"
arm64_tarball_url="https://api.gitkraken.dev/releases/production/linux/arm64/${latest_version}/gitkraken-aarch64.tar.gz"
arm64_sum=$(curl -fsSL "$arm64_tarball_url" | sha256sum | cut -d' ' -f1)
if [[ -z "${arm64_sum}" || ${#arm64_sum} -ne 64 ]]; then
echo "Failed to compute aarch64 checksum" >&2
exit 1
fi
sed -i "s|^sha256sums_aarch64=.*|sha256sums_aarch64=('${arm64_sum}')|" PKGBUILD

echo "Removing previous build artifacts"
rm -rf pkg/ src/ ./*.pkg.tar.zst ./*.tar.gz

Expand Down