release #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Run Release Please | |
uses: googleapis/release-please-action@v4 | |
with: | |
release-type: go | |
token: ${{ secrets.GITHUB_TOKEN }} | |
goreleaser: | |
# only the release-please PR which will be merged to main will trigger this job or a manual dispatch | |
if: ${{ github.event.head_commit.author.name == 'github-actions[bot]' || github.event_name == 'workflow_dispatch' }} | |
needs: [release-please] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ vars.GO_BUILD_VERSION }} | |
- name: Run Goreleaser (Full Release) | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: '~> v2' | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |