From ff00925b13a81cfa24af5eefcee26ea5115ca5c5 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Sat, 11 Jul 2026 23:27:59 +0200 Subject: [PATCH] chore(build): automate PKGBUILD version updates This update enhances the build process by ensuring that the package definition file (PKGBUILD) is automatically updated with the current application version and release number. Changes are applied across both local build scripts and CI/CD workflows to maintain consistency. This prevents manual synchronization errors when building releases. - Updates PKGBUILD version fields using package.json - Ensures PKGBUILD is staged during final commit in CI/CD - Improves robustness of the automated build pipeline --- .claude/settings.local.json | 6 +++++- .gitea/workflows/app_builder.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 37e5001..f756607 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -112,7 +112,11 @@ "Bash(echo \"---exit code:$?---\")", "Bash(git -C /mnt/data/Development/GitLite status --short)", "Bash(makepkg -f --noconfirm)", - "Bash(tar -tf gitty-2026.7.19-1-x86_64.pkg.tar.zst)" + "Bash(tar -tf gitty-2026.7.19-1-x86_64.pkg.tar.zst)", + "Bash(cp /mnt/data/Development/GitLite/PKGBUILD .)", + "Bash(sed -i 's/^pkgrel=1/pkgrel=3/' PKGBUILD)", + "Bash(node -e \"const fs=require\\('fs'\\); const version='2026.8.1'; const pkgbuild=fs.readFileSync\\('PKGBUILD','utf8'\\).replace\\(/^pkgver=.*\\\\$/m, 'pkgver='+version\\).replace\\(/^pkgrel=.*\\\\$/m, 'pkgrel=1'\\); fs.writeFileSync\\('PKGBUILD', pkgbuild\\);\")", + "Bash(rm PKGBUILD)" ] } } diff --git a/.gitea/workflows/app_builder.yaml b/.gitea/workflows/app_builder.yaml index 3d6f77a..265f541 100644 --- a/.gitea/workflows/app_builder.yaml +++ b/.gitea/workflows/app_builder.yaml @@ -87,6 +87,10 @@ jobs: run: | node -e "const fs=require('fs'); const path='src-tauri/tauri.conf.json'; const config=JSON.parse(fs.readFileSync(path,'utf8')); config.version=process.env.RELEASE_VERSION; fs.writeFileSync(path, JSON.stringify(config,null,2)+'\n');" + - name: Update PKGBUILD Version + run: | + node -e "const fs=require('fs'); const version=require('./package.json').version; const pkgbuild=fs.readFileSync('PKGBUILD','utf8').replace(/^pkgver=.*$/m, 'pkgver='+version).replace(/^pkgrel=.*$/m, 'pkgrel=1'); fs.writeFileSync('PKGBUILD', pkgbuild);" + - name: Commit and Push Changes if: matrix.platform == 'windows-latest' shell: powershell @@ -95,7 +99,7 @@ jobs: git config user.email '${{ vars.EMAIL_GIT }}' # npm version also bumps the version inside package-lock.json, so stage it # too -- otherwise it stays as an unstaged change and blocks the rebase. - git add package.json package-lock.json src-tauri/tauri.conf.json + git add package.json package-lock.json src-tauri/tauri.conf.json PKGBUILD git commit -m 'Update version to ${{ github.ref_name }}' if ($LASTEXITCODE -ne 0) {