Merge pull request #248 from smlx/test-release #148
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 | |
| permissions: {} | |
| jobs: | |
| release-tag: | |
| permissions: | |
| # create tag | |
| contents: write | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new-tag: ${{ steps.ccv.outputs.new-tag }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Bump tag if necessary | |
| id: ccv | |
| uses: smlx/ccv@7318e2f25a52dcd550e75384b84983973251a1f8 # v0.10.0 | |
| release-build: | |
| permissions: | |
| # create release | |
| contents: write | |
| # push docker images to registry | |
| packages: write | |
| # required by attest-build-provenance | |
| id-token: write | |
| attestations: write | |
| needs: release-tag | |
| if: needs.release-tag.outputs.new-tag == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version: stable | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 | |
| id: goreleaser | |
| with: | |
| version: latest | |
| args: release --verbose | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # attest artifacts | |
| - uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 | |
| with: | |
| subject-checksums: ./dist/checksums.txt | |
| # attest images | |
| - uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 | |
| with: | |
| subject-checksums: ./dist/digests.txt | |
| push-to-registry: true |