From cbe3761a6a70502cf785c3aed9f2df97f7b05f30 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Mon, 25 May 2026 13:21:28 +0100 Subject: [PATCH 1/2] Added GitHub Actions release workflow and updated build workflow to trigger on version tags --- .github/workflows/build.yml | 2 ++ .github/workflows/release.yml | 68 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1c3fc4..707aed9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,8 @@ on: - "README.md" branches: - main + tags: + - 'v*.*.*' pull_request: workflow_dispatch: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a8efb59 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + branches: + - prod + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g. 1.2.3, leave empty to auto-bump patch)' + required: false + type: string + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for existing tag on HEAD + id: idempotency + run: | + EXISTING=$(git describe --exact-match --tags HEAD 2>/dev/null || true) + if echo "$EXISTING" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "HEAD is already tagged as $EXISTING — skipping release." + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "skip=false" >> $GITHUB_OUTPUT + fi + + - name: Determine version + if: steps.idempotency.outputs.skip == 'false' + id: version + run: | + if [ -n "${{ inputs.version }}" ]; then + NEW_VERSION="v${{ inputs.version }}" + else + LATEST=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") + MAJOR=$(echo "${LATEST#v}" | cut -d. -f1) + MINOR=$(echo "${LATEST#v}" | cut -d. -f2) + PATCH=$(echo "${LATEST#v}" | cut -d. -f3) + NEW_VERSION="v${MAJOR}.${MINOR}.$((PATCH + 1))" + fi + echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT + echo "Releasing ${NEW_VERSION}" + + - name: Create and push tag + if: steps.idempotency.outputs.skip == 'false' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag ${{ steps.version.outputs.version }} + git push origin ${{ steps.version.outputs.version }} + + - name: Create GitHub Release + if: steps.idempotency.outputs.skip == 'false' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create ${{ steps.version.outputs.version }} \ + --generate-notes \ + --title "Release ${{ steps.version.outputs.version }}" From e5ca6c06ad1cc939acd81b044b3b45e164b1c753 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Mon, 25 May 2026 13:28:09 +0100 Subject: [PATCH 2/2] Triggered evaluation-function-base release from release workflow --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8efb59..5e878c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,3 +66,12 @@ jobs: gh release create ${{ steps.version.outputs.version }} \ --generate-notes \ --title "Release ${{ steps.version.outputs.version }}" + + - name: Trigger evaluation-function-base release + if: steps.idempotency.outputs.skip == 'false' + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.EVALUATION_FUNCTION_BASE_BUILD_TRIGGER_TOKEN }} + repository: ${{ github.repository_owner }}/evaluation-function-base + event-type: release + client-payload: '{"shimmy_version": "${{ steps.version.outputs.version }}"}'