Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
tag:
description: 'Tag to upload artifacts to.'
required: true
outputs:
hashes:
description: sha256sum hashes of built artifacts
value: ${{ steps.hash.outputs.hashes }}

runs:
using: composite
Expand All @@ -27,7 +31,11 @@ runs:
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }}
args: release ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }}
env:
GITHUB_TOKEN: ${{ inputs.token }}

- name: Hash build artifacts for provenance
id: hash
shell: bash
run: |
echo "hashes=$(sha256sum dist/* | base64 -w0)" >> "$GITHUB_OUTPUT"
19 changes: 16 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- main

jobs:

release-please:
runs-on: ubuntu-latest
outputs:
Expand All @@ -23,18 +22,32 @@ jobs:
permissions:
id-token: write # Needed to obtain Docker tokens
contents: write # Needed to upload release artifacts

needs: [ release-please ]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.publish.outputs.hashes }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/publish
- id: publish
uses: ./.github/actions/publish
with:
dry-run: 'false'
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release-please.outputs.tag_name }}

release-ldcli-provenance:
needs: ['release-please', 'release-ldcli']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
with:
base64-subjects: "${{ needs.release-ldcli.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ needs.release-please.outputs.tag_name }}