diff --git a/.gitea/workflows/aur-publish.yml b/.gitea/workflows/aur-publish.yml index cbb2b0e..82305af 100644 --- a/.gitea/workflows/aur-publish.yml +++ b/.gitea/workflows/aur-publish.yml @@ -4,6 +4,17 @@ on: push: tags: - 'v*' + # Re-publish without a new upstream release, e.g. a PKGBUILD-only fix: + # run it on master with the released version and the next pkgrel. + workflow_dispatch: + inputs: + version: + description: 'Released version to package, without the v (e.g. 1.2.3)' + required: true + pkgrel: + description: 'Package release number' + required: true + default: '1' jobs: aur: @@ -19,9 +30,16 @@ jobs: - name: Extract version from tag id: version run: | - TAG="${GITHUB_REF#refs/tags/v}" - echo "version=$TAG" >> "$GITHUB_OUTPUT" - echo "Publishing ahfail v$TAG to AUR" + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + VERSION="${{ inputs.version }}" + PKGREL="${{ inputs.pkgrel }}" + else + VERSION="${GITHUB_REF#refs/tags/v}" + PKGREL=1 + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "pkgrel=$PKGREL" >> "$GITHUB_OUTPUT" + echo "Publishing $VERSION-$PKGREL to AUR" - name: Configure SSH for AUR run: | @@ -59,7 +77,7 @@ jobs: run: | cp packaging/aur/PKGBUILD packaging/aur/ahfail.install aur-pkg/ sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" aur-pkg/PKGBUILD - sed -i "s/^pkgrel=.*/pkgrel=1/" aur-pkg/PKGBUILD + sed -i "s/^pkgrel=.*/pkgrel=${{ steps.version.outputs.pkgrel }}/" aur-pkg/PKGBUILD - name: Update checksums and regenerate .SRCINFO run: | @@ -78,7 +96,7 @@ jobs: echo "No changes — nothing to push." exit 0 fi - git commit -m "Update to ${{ steps.version.outputs.version }}" + git commit -m "Update to ${{ steps.version.outputs.version }}-${{ steps.version.outputs.pkgrel }}" git push -u origin master # Mirror the same PKGBUILD to https://asger.weirsøe.dk/tarballz/, the diff --git a/packaging/aur/PKGBUILD b/packaging/aur/PKGBUILD index bc651de..ab0bc3c 100644 --- a/packaging/aur/PKGBUILD +++ b/packaging/aur/PKGBUILD @@ -1,4 +1,4 @@ -# Maintainer: Asger Geel Weirsoe +# Maintainer: Asger Geel Weirsoe # # DISCLAIMER #