Feature/gitea workflow #2
@@ -2,14 +2,14 @@ name: Version Bump
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [develop]
|
||||||
types: [opened, synchronize, reopened, labeled, unlabeled, closed]
|
types: [opened, synchronize, reopened, labeled, unlabeled, closed]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Register this job's name as a required status check on master's branch
|
# Register this job's name as a required status check on develop's branch
|
||||||
# protection - that's what actually blocks the merge button.
|
# protection - that's what actually blocks the merge button.
|
||||||
check-bump-label:
|
check-bump-label:
|
||||||
if: github.event.action != 'closed'
|
if: github.event.action != 'closed'
|
||||||
@@ -20,19 +20,19 @@ jobs:
|
|||||||
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
|
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
|
||||||
run: |
|
run: |
|
||||||
echo "$LABELS" | grep -qE '"bump/(major|minor|patch|skip)"' || {
|
echo "$LABELS" | grep -qE '"bump/(major|minor|patch|skip)"' || {
|
||||||
echo "::error::PR into master must carry one of bump/major, bump/minor, bump/patch, bump/skip"
|
echo "::error::PR into develop must carry one of bump/major, bump/minor, bump/patch, bump/skip"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Runs once, after the merge has already happened, to commit the actual
|
# Runs once, after the merge has already happened, to commit the actual
|
||||||
# version bump onto master.
|
# version bump onto develop.
|
||||||
apply-version-bump:
|
apply-version-bump:
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: develop
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Determine bump level from PR labels
|
- name: Determine bump level from PR labels
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "::error::merged PR into master has no bump/major, bump/minor, bump/patch, or bump/skip label"
|
echo "::error::merged PR into develop has no bump/major, bump/minor, bump/patch, or bump/skip label"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Bump CMakeLists.txt and flake.nix
|
- name: Bump CMakeLists.txt and flake.nix
|
||||||
@@ -88,4 +88,4 @@ jobs:
|
|||||||
git config user.email "actions@noreply.localhost"
|
git config user.email "actions@noreply.localhost"
|
||||||
git add CMakeLists.txt flake.nix
|
git add CMakeLists.txt flake.nix
|
||||||
git commit -m "Bump version to ${NEW_VERSION}"
|
git commit -m "Bump version to ${NEW_VERSION}"
|
||||||
git push origin HEAD:master
|
git push origin HEAD:develop
|
||||||
|
|||||||
Reference in New Issue
Block a user