name: Version Bump # Manual only. Semantic version tags are applied deliberately (patch/minor/major); # there is no daily auto-bump and no Slack notification. on: workflow_dispatch: inputs: bump: description: "Version bump type" type: choice options: - patch - minor - major default: patch permissions: contents: write jobs: tag: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0 fetch-tags: true - name: Compute and push next version tag run: | LAST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1) LAST_TAG="${LAST_TAG:-v0.0.0}" MAJOR=$(echo "$LAST_TAG" | sed 's/^v//' | cut -d. -f1) MINOR=$(echo "$LAST_TAG" | sed 's/^v//' | cut -d. -f2) PATCH=$(echo "$LAST_TAG" | sed 's/^v//' | cut -d. -f3) case "${{ inputs.bump }}" in major) VERSION="v$((MAJOR + 1)).0.0" ;; minor) VERSION="v${MAJOR}.$((MINOR + 1)).0" ;; *) VERSION="v${MAJOR}.${MINOR}.$((PATCH + 1))" ;; esac echo "Bumping $LAST_TAG -> $VERSION" git tag -a "$VERSION" -m "$VERSION" git push origin "$VERSION"