diff --git a/.github/workflows/increment-pkgrel.yml b/.github/workflows/increment-pkgrel.yml new file mode 100644 index 0000000..1f5a539 --- /dev/null +++ b/.github/workflows/increment-pkgrel.yml @@ -0,0 +1,40 @@ +name: increment-pkgrel + +on: + repository_dispatch: + types: + - increment-pkgrel + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + increment-pkgrel: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: checkout + uses: actions/checkout@main + - id: increment-pkgrel + run: | + CURRENT_PKGREL=$(cat PKGBUILD | grep -oP 'pkgrel=\K[0-9]+') + INCREMENTED_PKGREL=$((CURRENT_PKGREL + 1)) + sed -i "s/pkgrel=$CURRENT_PKGREL/pkgrel=$INCREMENTED_PKGREL/" PKGBUILD + - name: commit + run: | + if [ -n "$(git status --porcelain)" ]; then + git config user.name "Manjaro Bot" + git config user.email "info@jonas-strassel.de" + git add PKGBUILD + git commit -m "chore(actions-increment-pkgrel): increment pkgrel" + git push + fi + - name: dispatch + uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3 + with: + token: ${{ secrets.DISPATCH_TOKEN || github.token }} + repository: ${{ github.repository }} + event-type: pkgrel-incremented \ No newline at end of file diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index 8c964b5..81b5185 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -4,6 +4,7 @@ on: repository_dispatch: types: - rebase + - pkgrel-incremented workflow_dispatch: push: branches: diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 5382993..8481560 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -6,7 +6,7 @@ on: - cron: '*/30 * * * *' concurrency: - group: rebase + group: ${{ github.workflow }} cancel-in-progress: true jobs: @@ -33,6 +33,10 @@ jobs: uses: mikefarah/yq@557dcb87b8efe786f89a12c09e9046b4753ab72e # v4.44.1 with: cmd: yq '.repository.topics += ", any"' -i .github/settings.yml + - if: steps.version.outputs.python == 'true' + uses: mikefarah/yq@557dcb87b8efe786f89a12c09e9046b4753ab72e # v4.44.1 + with: + cmd: yq '.repository.topics += ", python"' -i .github/settings.yml - name: commit run: | if [ -n "$(git status --porcelain)" ]; then