Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/manage-release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: write
actions: write

jobs:
create-tags:
Expand All @@ -27,6 +28,8 @@ jobs:

- name: Handle initial release tag
if: github.event_name == 'create' && github.event.ref_type == 'branch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="${{ github.event.ref }}"

Expand All @@ -50,8 +53,13 @@ jobs:
git tag "$TAG"
git push origin "$TAG"

echo "Triggering release workflow for $TAG"
gh workflow run release.yml -f tag="$TAG"

- name: Handle patch release tags
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Find all release branches
RELEASE_BRANCHES=$(git branch -r | grep -E 'origin/release-[0-9]+\.[0-9]+$' | sed 's|origin/||' | sed 's/^[[:space:]]*//')
Expand Down Expand Up @@ -114,4 +122,8 @@ jobs:
git push origin "$NEW_TAG"

echo "Successfully created and pushed tag $NEW_TAG"

# Trigger release workflow
echo "Triggering release workflow for $NEW_TAG"
gh workflow run release.yml -f tag="$NEW_TAG"
done
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: Release Build and Publish

# This workflow is triggered in two ways:
# 1. Automatically when a semver tag is pushed (e.g., git push origin v1.0.0)
# 2. Via workflow_dispatch from manage-release-tags.yml
# (needed because tags created with GITHUB_TOKEN don't trigger on.push.tags events)
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v1.0.0)'
required: true
type: string

env:
REGISTRY: ghcr.io
Expand All @@ -22,6 +32,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
# Use tag from workflow_dispatch input, otherwise use the git ref from tag push
ref: ${{ inputs.tag || github.ref }}

- name: Free up disk space
run: |
Expand All @@ -47,7 +59,13 @@ jobs:
- name: Parse version from tag
id: version
run: |
TAG=${GITHUB_REF#refs/tags/v}
# Handle both trigger types: workflow_dispatch (from manage-release-tags) and tag push
if [ -n "${{ inputs.tag }}" ]; then
TAG="${{ inputs.tag }}"
TAG=${TAG#v}
else
TAG=${GITHUB_REF#refs/tags/v}
fi
echo "full=$TAG" >> $GITHUB_OUTPUT

MAJOR=$(echo $TAG | cut -d. -f1)
Expand Down