From 3df66c3e053d9935ec0a89c6a9bd8829bc068239 Mon Sep 17 00:00:00 2001 From: JerryAgbesi Date: Tue, 21 Apr 2026 11:50:48 +0000 Subject: [PATCH 1/3] chore: update pipeline and AGENTS.md --- .github/workflows/release.yml | 31 +++++++++++-------------------- AGENTS.md | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eff0e55..fedf8fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,27 +19,18 @@ jobs: with: fetch-depth: 0 - - name: Determine next version + - name: Bump version and push tag id: tag - run: | - # Get the latest tag, default to v0.0.0 if none exists - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - echo "Latest tag: $LATEST_TAG" - - # Extract major.minor.patch - VERSION=${LATEST_TAG#v} - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" - - # Bump patch version - PATCH=$((PATCH + 1)) - NEW_TAG="v${MAJOR}.${MINOR}.${PATCH}" - echo "New tag: $NEW_TAG" - echo "new_tag=$NEW_TAG" >> "$GITHUB_OUTPUT" - - - name: Create and push tag - run: | - git tag ${{ steps.tag.outputs.new_tag }} - git push origin ${{ steps.tag.outputs.new_tag }} + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: patch + release_branches: main + tag_prefix: v + # Pre-1.0 policy: breaking changes bump minor instead of major. + # Remove this line once the project reaches v1.0.0 so that `!:` / + # `BREAKING CHANGE:` commits correctly bump major. + custom_release_rules: breaking:minor,feat!:minor,feat:minor,fix:patch release: needs: tag diff --git a/AGENTS.md b/AGENTS.md index 003dafa..d8839fa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ go test ./... - Every feature must ship with tests covering it; no feature lands without test coverage. - Add or update tests whenever behavior changes, and keep `go test ./...` green. - Update `README.md` when user-facing behavior or flags change. -- avoid using unnesessary emojis. +- avoid using unnecessary emojis. ## Commit messages From 8de10d3a18925f648bc79d8b82017ef9c51b8d32 Mon Sep 17 00:00:00 2001 From: JerryAgbesi Date: Tue, 21 Apr 2026 12:20:40 +0000 Subject: [PATCH 2/3] ci: switch release trigger to workflow_dispatch --- .github/workflows/release.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fedf8fd..c42e342 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,12 +4,19 @@ on: push: branches: - main + workflow_dispatch: + inputs: + tag: + description: 'Existing tag to release (e.g. v0.2.0)' + required: true + type: string permissions: contents: write jobs: tag: + if: github.event_name == 'push' runs-on: ubuntu-latest outputs: new_tag: ${{ steps.tag.outputs.new_tag }} @@ -34,13 +41,32 @@ jobs: release: needs: tag - if: needs.tag.outputs.new_tag != '' + if: | + always() && + ( + github.event_name == 'workflow_dispatch' || + (needs.tag.result == 'success' && needs.tag.outputs.new_tag != '') + ) runs-on: ubuntu-latest steps: + - name: Resolve release ref + id: ref + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "ref=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + else + echo "ref=${{ needs.tag.outputs.new_tag }}" >> "$GITHUB_OUTPUT" + fi + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ steps.ref.outputs.ref }} + + - name: Verify dispatched tag exists + if: github.event_name == 'workflow_dispatch' + run: git rev-parse "refs/tags/${{ inputs.tag }}" - name: Set up Go uses: actions/setup-go@v5 From c1ec58fcb6b355af42697a9bb905dc63783d85e4 Mon Sep 17 00:00:00 2001 From: Jerry Agbesi <52638746+JerryAgbesi@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:25:18 +0000 Subject: [PATCH 3/3] Update .github/workflows/release.yml --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c42e342..b7f407a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,11 +42,7 @@ jobs: release: needs: tag if: | - always() && - ( - github.event_name == 'workflow_dispatch' || - (needs.tag.result == 'success' && needs.tag.outputs.new_tag != '') - ) + always() && github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - name: Resolve release ref