generated from archlinux/template
Attempt to run every two minutes
This commit is contained in:
parent
278496c699
commit
2748fdf24b
24
.gitea/workflows/bump-pkgrel.sh
Executable file
24
.gitea/workflows/bump-pkgrel.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Run your check script
|
||||||
|
.gitea/workflows/check-up-to-date.sh
|
||||||
|
RETVAL=$?
|
||||||
|
|
||||||
|
if [ $RETVAL -eq 1 ]; then
|
||||||
|
echo "Changes detected, bumping pkgrel..."
|
||||||
|
|
||||||
|
# Use sed to increment pkgrel in the PKGBUILD file
|
||||||
|
sed -i -E 's/^(pkgrel=)([0-9]+)/echo "\1$((\2 + 1))"/e' PKGBUILD
|
||||||
|
|
||||||
|
# Get the new pkgrel value for the commit message
|
||||||
|
NEW_PKGREL=$(grep ^pkgrel= PKGBUILD | cut -d= -f2)
|
||||||
|
|
||||||
|
# Add, commit, and push the change
|
||||||
|
git add PKGBUILD
|
||||||
|
git commit -m "Bump pkgrel to ${NEW_PKGREL}"
|
||||||
|
git push
|
||||||
|
|
||||||
|
echo "pkgrel bumped to ${NEW_PKGREL} and changes pushed."
|
||||||
|
else
|
||||||
|
echo "No changes detected. Nothing to do."
|
||||||
|
fi
|
@ -3,6 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
schedule:
|
||||||
|
- cron: '*/2 * * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
update:
|
||||||
@ -46,8 +48,7 @@ jobs:
|
|||||||
name: Check if rebuild is necessary
|
name: Check if rebuild is necessary
|
||||||
runs-on: ubuntu-amd64
|
runs-on: ubuntu-amd64
|
||||||
needs: update
|
needs: update
|
||||||
outputs:
|
if: ${{ github.event_name == 'schedule' }}
|
||||||
up-to-date: ${{ steps.up-to-date.outputs.exit_code }}
|
|
||||||
container:
|
container:
|
||||||
image: gitea.seeseepuff.be/archlinux/archlinux:latest
|
image: gitea.seeseepuff.be/archlinux/archlinux:latest
|
||||||
steps:
|
steps:
|
||||||
@ -61,10 +62,9 @@ jobs:
|
|||||||
- name: Check if rebuild is necessary
|
- name: Check if rebuild is necessary
|
||||||
id: up-to-date
|
id: up-to-date
|
||||||
run: |
|
run: |
|
||||||
set +e
|
git config user.email "sebastiaan.de.schaetzen+archlinux@gmail.com"
|
||||||
.gitea/workflows/up-to-date.sh
|
git config user.name "Sebastiaan de Schaetzen (automated)"
|
||||||
echo "exit_code=$?" >> "$GITHUB_OUTPUT"
|
.gitea/workflows/bump-pkgrel.sh
|
||||||
set -e
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build and Push
|
name: Build and Push
|
||||||
@ -72,7 +72,7 @@ jobs:
|
|||||||
needs: check
|
needs: check
|
||||||
container:
|
container:
|
||||||
image: gitea.seeseepuff.be/archlinux/archlinux:latest
|
image: gitea.seeseepuff.be/archlinux/archlinux:latest
|
||||||
if: needs.check.outputs.up-to-date == '1'
|
if: ${{ github.event_name == 'push' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user