build: Add Sync app version to AUR PKGBUILD files (#6222)

This commit is contained in:
Ludy
2026-04-25 13:09:25 +01:00
committed by GitHub
parent 9890d6a7de
commit 8cd6377131
+17 -1
View File
@@ -89,10 +89,12 @@ def appVersionStr = project.version.toString()
def tauriConfigPath = layout.projectDirectory.file('frontend/src-tauri/tauri.conf.json').asFile.path def tauriConfigPath = layout.projectDirectory.file('frontend/src-tauri/tauri.conf.json').asFile.path
def sim1Path = layout.projectDirectory.file('frontend/src/core/testing/serverExperienceSimulations.ts').asFile.path def sim1Path = layout.projectDirectory.file('frontend/src/core/testing/serverExperienceSimulations.ts').asFile.path
def sim2Path = layout.projectDirectory.file('frontend/src/proprietary/testing/serverExperienceSimulations.ts').asFile.path def sim2Path = layout.projectDirectory.file('frontend/src/proprietary/testing/serverExperienceSimulations.ts').asFile.path
def aurDesktopPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-desktop/PKGBUILD').asFile.path
def aurServerPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-server-bin/PKGBUILD').asFile.path
tasks.register('syncAppVersion') { tasks.register('syncAppVersion') {
group = 'versioning' group = 'versioning'
description = 'Synchronizes app version across desktop and simulation configs.' description = 'Synchronizes app version across desktop, simulation, and AUR PKGBUILD configs.'
doLast { doLast {
println "Synchronizing application version to ${appVersionStr}" println "Synchronizing application version to ${appVersionStr}"
@@ -120,6 +122,20 @@ tasks.register('syncAppVersion') {
} }
} }
} }
[new File(aurDesktopPkgbuildPath), new File(aurServerPkgbuildPath)].each { f ->
if (f.exists()) {
def content = f.getText('UTF-8')
def matcher = (content =~ /(?m)^(pkgver=)(.*)$/)
if (!matcher.find()) {
throw new GradleException("Could not locate pkgver in ${f} for synchronization")
}
def updatedContent = matcher.replaceFirst("\$1${appVersionStr}")
if (content != updatedContent) {
f.write(updatedContent, 'UTF-8')
}
}
}
} }
} }