ba4133bf5d
Push to main mints the next vX.Y.Z patch tag, builds and pushes a multi-arch image to the registry, and tags the repo. A manual bump-version workflow handles minor/major bumps. This workflow deliberately holds no deployment-repo credentials: the repo is public, so the GitOps side polls the registry and pulls new tags itself rather than being pushed to from here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Bump Version
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
component:
|
|
description: 'Version component to bump'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- minor
|
|
- major
|
|
|
|
jobs:
|
|
bump:
|
|
runs-on: docker
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
run: |
|
|
git clone --depth 1 https://${{ gitea.actor }}:${{ gitea.token }}@gitea.ivangodwin.com/${{ gitea.repository }}.git .
|
|
|
|
- name: Compute and push new version tag
|
|
run: |
|
|
git fetch --tags
|
|
LATEST=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)
|
|
if [ -z "$LATEST" ]; then
|
|
if [ "${{ inputs.component }}" = "major" ]; then
|
|
VERSION="v1.0.0"
|
|
else
|
|
VERSION="v0.1.0"
|
|
fi
|
|
else
|
|
MAJOR=$(echo "$LATEST" | cut -d. -f1 | tr -d 'v')
|
|
MINOR=$(echo "$LATEST" | cut -d. -f2)
|
|
if [ "${{ inputs.component }}" = "major" ]; then
|
|
VERSION="v$((MAJOR + 1)).0.0"
|
|
else
|
|
VERSION="v${MAJOR}.$((MINOR + 1)).0"
|
|
fi
|
|
fi
|
|
echo "Bumping to ${VERSION}"
|
|
git tag "$VERSION"
|
|
git push https://${{ gitea.actor }}:${{ gitea.token }}@gitea.ivangodwin.com/${{ gitea.repository }}.git "$VERSION"
|