- convert all test workflows to reusable workflow_call - add central CI workflow for branches and PRs - add mark-stable workflow triggered on main pushes - ensure stable tag updates only after all tests succeed - remove duplicated triggers from test workflows ` https://chatgpt.com/share/693aa4a6-7460-800f-ba47-cfc15b1b2236
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: Mark stable commit
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test-unit:
|
|
uses: ./.github/workflows/test-unit.yml
|
|
|
|
test-integration:
|
|
uses: ./.github/workflows/test-integration.yml
|
|
|
|
test-container:
|
|
uses: ./.github/workflows/test-container.yml
|
|
|
|
test-e2e:
|
|
uses: ./.github/workflows/test-e2e.yml
|
|
|
|
test-virgin-user:
|
|
uses: ./.github/workflows/test-virgin-user.yml
|
|
|
|
test-virgin-root:
|
|
uses: ./.github/workflows/test-virgin-root.yml
|
|
|
|
mark-stable:
|
|
needs:
|
|
- test-unit
|
|
- test-integration
|
|
- test-container
|
|
- test-e2e
|
|
- test-virgin-user
|
|
- test-virgin-root
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write # to move the tag
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Move 'stable' tag to this commit
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
echo "Tagging commit $GITHUB_SHA as stable…"
|
|
|
|
# delete local tag if exists
|
|
git tag -d stable 2>/dev/null || true
|
|
# delete remote tag if exists
|
|
git push origin :refs/tags/stable || true
|
|
|
|
# create new tag on this commit
|
|
git tag stable "$GITHUB_SHA"
|
|
git push origin stable
|
|
|
|
echo "✅ Stable tag updated."
|