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
15 changes: 13 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: Release
on:
push:
branches: [main]
# Re-run GoReleaser for an existing release tag (e.g. after a failed run).
workflow_dispatch:
inputs:
tag:
description: Existing release tag, e.g. v0.1.0
required: true

permissions: {}

jobs:
release-please:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -25,8 +32,10 @@ jobs:
# Runs in the same workflow: tags pushed with GITHUB_TOKEN trigger no other workflows.
goreleaser:
needs: release-please
if: needs.release-please.outputs.created == 'true'
if: ${{ !cancelled() && (needs.release-please.outputs.created == 'true' || github.event_name == 'workflow_dispatch') }}
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ inputs.tag || needs.release-please.outputs.tag }}
permissions:
contents: write # upload release assets
packages: write # push to GHCR
Expand All @@ -35,7 +44,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.release-please.outputs.tag }}
ref: ${{ env.RELEASE_TAG }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
Expand All @@ -55,6 +64,8 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Explicit, in case several tags point at the release commit.
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_TAG }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
Expand Down
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"initial-version": "0.1.0",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"include-component-in-tag": false,
"include-v-in-tag": true,
"changelog-sections": [
{ "type": "feat", "section": "Features" },
Expand Down
Loading