fix: add release-please-config.json #3
This file contains 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 | |
- '[0-9]+.[0-9]+.x' | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
release-please: | |
permissions: | |
contents: write # for google-github-actions/release-please-action to create release commit | |
pull-requests: write # for google-github-actions/release-please-action to create release PR | |
runs-on: ubuntu-latest | |
outputs: | |
releases_created: ${{ steps.release.outputs.releases_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
# Release-please creates a PR that tracks all changes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1 | |
id: release | |
with: | |
command: manifest | |
token: ${{secrets.RELEASE_CREATOR_TOKEN}} | |
default-branch: main | |
goreleaser: | |
if: needs.release-please.outputs.releases_created == 'true' | |
permissions: | |
contents: write | |
needs: | |
- release-please | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 | |
with: | |
go-version: '1.22' | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_CREATOR_TOKEN }} |