Skip to content

docs: return to GitHub info #11

docs: return to GitHub info

docs: return to GitHub info #11

Workflow file for this run

---
jobs:
goreleaser:
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
image: ${{ steps.digest.outputs.name }}
digest: ${{ steps.digest.outputs.digest }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/[email protected]
with:
cache: true
go-version: ">=1.20.2"
- uses: sigstore/[email protected]
with:
cosign-release: v2.0.0
- uses: anchore/sbom-action/[email protected]
with:
syft-version: v0.69.0
- id: import_gpg
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: echo "$GPG_PRIVATE_KEY" > /home/runner/gpgkey.asc && chmod 600 /home/runner/gpgkey.asc
shell: bash
- uses: docker/[email protected]
with:
password: ${{ secrets.GH_PAT }}
registry: ghcr.io
username: mcornick
- run: |
sudo apt-get update
sudo apt-get install -y nix-bin
- env:
AUR_KEY: ${{ secrets.AUR_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_CLIENT_ID: ${{ secrets.MASTODON_CLIENT_ID }}
MASTODON_CLIENT_SECRET: ${{ secrets.MASTODON_CLIENT_SECRET }}
id: goreleaser
uses: goreleaser/[email protected]
with:
args: release --clean
version: latest
- run: rm /home/runner/gpgkey.asc
shell: bash
- env:
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
id: hash
run: |
set -euo pipefail
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
- env:
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
id: digest
run: |
set -euo pipefail
image_and_digest=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Docker Manifest") | .path')
image=$(echo "${image_and_digest}" | cut -d'@' -f1 | cut -d':' -f1)
digest=$(echo "${image_and_digest}" | cut -d'@' -f2)
echo "name=$image" >> "$GITHUB_OUTPUT"
echo "digest=$digest" >> "$GITHUB_OUTPUT"
binary-provenance:
needs: [goreleaser]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
upload-assets: true
image-provenance:
needs: [goreleaser]
permissions:
actions: read
id-token: write
packages: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
image: ${{ needs.goreleaser.outputs.image }}
digest: ${{ needs.goreleaser.outputs.digest }}
registry-username: ${{ github.actor }}
secrets:
registry-password: ${{ secrets.GH_PAT }}
name: goreleaser
"on":
push:
tags:
- "*"
permissions:
contents: write
id-token: write
issues: write
packages: write
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json