Merge pull request #60 from gchiesa/release-please--branches--main #33
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 | |
pull-requests: write | |
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@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3 | |
- uses: google-github-actions/release-please-action@ee9822ec2c397e8a364d634464339ac43a06e042 | |
id: release | |
with: | |
command: manifest | |
token: ${{secrets.GITHUB_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@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4 | |
with: | |
go-version: '~1.21' | |
- name: Download Syft | |
uses: anchore/sbom-action/download-syft@422cb34a0f8b599678c41b21163ea6088edb2624 # v0.14.1 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
SKA_HOMEBREW_TOKEN: ${{secrets.SKA_HOMEBREW_TOKEN}} |