add workflow to update major tag
Test action / integration (push) Successful in 12s

This commit is contained in:
NikoKS committed 2026-08-26 23:20:38 +07:00
1 parent 88bc7844e3
commit 0848079db3
2 files changed
+48

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
name: Update major version tag
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
update-major-tag:
runs-on: ubuntu-latest
steps:
- name: Check out release tag
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0
- name: Update floating major tag
shell: bash
env:
RELEASE_REF: ${{ gitea.ref }}
run: |
set -euo pipefail
release_tag="${RELEASE_REF#refs/tags/}"
if [[ ! "$release_tag" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
echo "Refusing to update a major tag from invalid release tag: $release_tag" >&2
exit 1
fi
major_tag="v${BASH_REMATCH[1]}"
git config user.name "Gitea Actions"
git config user.email "actions@localhost"
git tag --force --annotate "$major_tag" --message "Update $major_tag to $release_tag" "$release_tag"
git push origin "refs/tags/$major_tag" --force
+11
View File
@@ -101,6 +101,17 @@ Gitea may suppress workflows caused by pushes authenticated with its built-in `G
The action does not force-push, create tags, publish releases, or call forge APIs. Concurrent release jobs are resolved safely by the remote rejecting a non-fast-forward push. Configure workflow-level concurrency if release PRs can overlap.
## Releasing the action
Create and push an immutable semantic-version tag:
```bash
git tag -a v1.1.0 -m "Release v1.1.0"
git push origin v1.1.0
```
The `Update major version tag` Gitea workflow validates the release tag and automatically moves the corresponding floating major tag (for example, `v1`) to the same commit. Consumers can continue using `Nurinda/bump-erp-app-version@v1` to receive compatible v1 releases.
## Development
Run the integration test: