Skip to content

Merge pull request #489 from roots/enable-lima-load-ssh-pub-keys-option #26

Merge pull request #489 from roots/enable-lima-load-ssh-pub-keys-option

Merge pull request #489 from roots/enable-lima-load-ssh-pub-keys-option #26

Workflow file for this run

name: goreleaser
on:
push:
tags:
- '*'
workflow_dispatch:
permissions: {}
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
build-provenance-artifact-id: ${{ steps.upload-build-provenance.outputs.artifact-id }}
sbom-artifact-id: ${{ steps.upload-sbom.outputs.artifact-id }}
sbom-attestations: ${{ steps.upload-sbom.outputs.attestations }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: anchore/sbom-action/download-syft@v0
- name: GoReleaser release
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_ACCESS_TOKEN }}
- uses: actions/upload-artifact@v4
id: upload-build-provenance
with:
name: build-provenance
path: |
dist/trellis_*/trellis
dist/trellis_*/trellis.exe
dist/trellis_*.tar.gz
dist/trellis_*.zip
dist/**/*.sbom.json
- uses: typisttech/upload-goreleaser-sboms-action@v0
id: upload-sbom
attest-build-provenance:
needs: [goreleaser]
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
name: build-provenance
- uses: actions/attest-build-provenance@v1
with:
subject-path: |
dist/trellis_*/trellis
dist/trellis_*/trellis.exe
dist/trellis_*.tar.gz
dist/trellis_*.zip
dist/**/*.sbom.json
attest-sbom:
needs: [goreleaser]
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
strategy:
matrix:
attestation: ${{ fromJSON(needs.goreleaser.outputs.sbom-attestations) }}
steps:
- uses: actions/download-artifact@v4
with:
name: sboms
- uses: actions/attest-sbom@v1
with:
subject-path: ${{ matrix.attestation.subject }}
sbom-path: ${{ matrix.attestation.sbom }}
verify:
needs: [goreleaser, attest-build-provenance, attest-sbom]
runs-on: ubuntu-latest
steps:
- run: gh release download --clobber --dir artifacts -p '*.tar.gz' -p '*.zip' -p '*.sbom.json' --repo $REPO $TAG
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
- run: tree artifacts
- run: ls | xargs -I {} gh attestation verify --repo $REPO {}
working-directory: artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
cleanup:
needs: [goreleaser, verify]
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- run: >
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/$REPO/actions/artifacts/$ARTIFACT_ID
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ARTIFACT_ID: ${{ needs.goreleaser.outputs.build-provenance-artifact-id }}
- run: >
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/$REPO/actions/artifacts/$ARTIFACT_ID
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ARTIFACT_ID: ${{ needs.goreleaser.outputs.sbom-artifact-id }}