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
This commit is contained in:
@@ -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)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user