Some checks failed
Ruff (Python code sniffer) / codesniffer-ruff (push) Has been cancelled
ShellCheck / codesniffer-shellcheck (push) Has been cancelled
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / codesniffer-shellcheck (push) Has been cancelled
Mark stable commit / codesniffer-ruff (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
- Introduce dedicated ShellCheck workflow for Bash scripts - Add Ruff as Python code sniffer for src/ and tests/ - Integrate both sniffers into main CI pipeline - Require successful sniffer runs before marking a release as stable - Ensure consistent code quality checks across CI and release workflows https://chatgpt.com/share/693d5b26-293c-800f-999d-48b2950b9417
111 lines
2.9 KiB
YAML
111 lines
2.9 KiB
YAML
name: Mark stable commit
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # still run tests for main
|
|
tags:
|
|
- 'v*' # run tests for version tags (e.g. v0.9.1)
|
|
|
|
jobs:
|
|
test-unit:
|
|
uses: ./.github/workflows/test-unit.yml
|
|
|
|
test-integration:
|
|
uses: ./.github/workflows/test-integration.yml
|
|
|
|
test-env-virtual:
|
|
uses: ./.github/workflows/test-env-virtual.yml
|
|
|
|
test-env-nix:
|
|
uses: ./.github/workflows/test-env-nix.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
|
|
|
|
codesniffer-shellcheck:
|
|
uses: ./.github/workflows/codesniffer-shellcheck.yml
|
|
|
|
codesniffer-ruff:
|
|
uses: ./.github/workflows/codesniffer-ruff.yml
|
|
|
|
mark-stable:
|
|
needs:
|
|
- codesniffer-shellcheck
|
|
- codesniffer-ruff
|
|
- test-unit
|
|
- test-integration
|
|
- test-env-nix
|
|
- test-env-virtual
|
|
- test-e2e
|
|
- test-virgin-user
|
|
- test-virgin-root
|
|
runs-on: ubuntu-latest
|
|
|
|
# Only run this job if the push is for a version tag (v*)
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
permissions:
|
|
contents: write # Required to move/update the tag
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true # We need all tags for version comparison
|
|
|
|
- name: Move 'stable' tag only if this version is the highest
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
echo "Ref: $GITHUB_REF"
|
|
echo "SHA: $GITHUB_SHA"
|
|
|
|
VERSION="${GITHUB_REF#refs/tags/}"
|
|
echo "Current version tag: ${VERSION}"
|
|
|
|
echo "Collecting all version tags..."
|
|
ALL_V_TAGS="$(git tag --list 'v*' || true)"
|
|
|
|
if [[ -z "${ALL_V_TAGS}" ]]; then
|
|
echo "No version tags found. Skipping stable update."
|
|
exit 0
|
|
fi
|
|
|
|
echo "All version tags:"
|
|
echo "${ALL_V_TAGS}"
|
|
|
|
# Determine highest version using natural version sorting
|
|
LATEST_TAG="$(printf '%s\n' ${ALL_V_TAGS} | sort -V | tail -n1)"
|
|
|
|
echo "Highest version tag: ${LATEST_TAG}"
|
|
|
|
if [[ "${VERSION}" != "${LATEST_TAG}" ]]; then
|
|
echo "Current version ${VERSION} is NOT the highest version."
|
|
echo "Stable tag will NOT be updated."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Current version ${VERSION} IS the highest version."
|
|
echo "Updating 'stable' tag..."
|
|
|
|
# Delete existing stable tag (local + remote)
|
|
git tag -d stable 2>/dev/null || true
|
|
git push origin :refs/tags/stable || true
|
|
|
|
# Create new stable tag
|
|
git tag stable "$GITHUB_SHA"
|
|
git push origin stable
|
|
|
|
echo "✅ Stable tag updated to ${VERSION}."
|