|
| 1 | +name: release |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'v*' |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + tag: |
| 9 | + description: 'image tag prefix' |
| 10 | + default: 'rc' |
| 11 | + required: true |
| 12 | +jobs: |
| 13 | + release: |
| 14 | + permissions: |
| 15 | + contents: write # for creating the GitHub release. |
| 16 | + id-token: write # for creating OIDC tokens for signing. |
| 17 | + packages: write # for pushing and signing container images. |
| 18 | + uses: fluxcd/gha-workflows/.github/workflows/[email protected] |
| 19 | + with: |
| 20 | + controller: ${{ github.event.repository.name }} |
| 21 | + release-candidate-prefix: ${{ github.event.inputs.tag }} |
| 22 | + secrets: |
| 23 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + dockerhub-token: ${{ secrets.DOCKER_FLUXCD_PASSWORD }} |
| 25 | + release-provenance: |
| 26 | + needs: [release] |
| 27 | + permissions: |
| 28 | + actions: read # for detecting the Github Actions environment. |
| 29 | + id-token: write # for creating OIDC tokens for signing. |
| 30 | + contents: write # for uploading attestations to GitHub releases. |
| 31 | + if: startsWith(github.ref, 'refs/tags/v') |
| 32 | + uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] |
| 33 | + with: |
| 34 | + provenance-name: "provenance.intoto.jsonl" |
| 35 | + base64-subjects: "${{ needs.release.outputs.release-digests }}" |
| 36 | + upload-assets: true |
| 37 | + dockerhub-provenance: |
| 38 | + needs: [release] |
| 39 | + permissions: |
| 40 | + contents: read # for reading the repository code. |
| 41 | + actions: read # for detecting the Github Actions environment. |
| 42 | + id-token: write # for creating OIDC tokens for signing. |
| 43 | + packages: write # for uploading attestations. |
| 44 | + if: startsWith(github.ref, 'refs/tags/v') |
| 45 | + uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] |
| 46 | + with: |
| 47 | + image: ${{ needs.release.outputs.image-name }} |
| 48 | + digest: ${{ needs.release.outputs.image-digest }} |
| 49 | + registry-username: ${{ github.repository_owner == 'fluxcd' && 'fluxcdbot' || github.repository_owner }} |
| 50 | + secrets: |
| 51 | + registry-password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }} |
| 52 | + ghcr-provenance: |
| 53 | + needs: [release] |
| 54 | + permissions: |
| 55 | + contents: read # for reading the repository code. |
| 56 | + actions: read # for detecting the Github Actions environment. |
| 57 | + id-token: write # for creating OIDC tokens for signing. |
| 58 | + packages: write # for uploading attestations. |
| 59 | + if: startsWith(github.ref, 'refs/tags/v') |
| 60 | + uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] |
| 61 | + with: |
| 62 | + image: ghcr.io/${{ needs.release.outputs.image-name }} |
| 63 | + digest: ${{ needs.release.outputs.image-digest }} |
| 64 | + registry-username: fluxcdbot # not necessary for ghcr.io |
| 65 | + secrets: |
| 66 | + registry-password: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments