Sign the release artifacts checksums and images
- add the Flux manifests and API schemas to checksums - sign the checksum.txt with Cosign and GitHub OIDC - sign the flux-cli container images with Cosign and GitHub OIDC Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
44
.github/workflows/release.yaml
vendored
44
.github/workflows/release.yaml
vendored
@@ -4,6 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags: [ 'v*' ]
|
tags: [ 'v*' ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # needed to write releases
|
||||||
|
id-token: write # needed for keyless signing
|
||||||
|
packages: write # needed for ghcr access
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -18,13 +23,15 @@ jobs:
|
|||||||
go-version: 1.17.x
|
go-version: 1.17.x
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
with:
|
- name: Setup Syft
|
||||||
buildkitd-flags: "--debug"
|
uses: anchore/sbom-action/download-syft@v0
|
||||||
|
- name: Setup Cosign
|
||||||
|
uses: sigstore/cosign-installer@main
|
||||||
|
- name: Setup Kustomize
|
||||||
|
uses: fluxcd/pkg//actions/kustomize@main
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
@@ -36,18 +43,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: fluxcdbot
|
username: fluxcdbot
|
||||||
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
||||||
- name: Download release notes utility
|
|
||||||
env:
|
|
||||||
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
|
|
||||||
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
|
|
||||||
- name: Generate release notes
|
|
||||||
run: |
|
|
||||||
echo 'CHANGELOG' > /tmp/release.txt
|
|
||||||
github-release-notes -org fluxcd -repo toolkit -since-latest-release -include-author >> /tmp/release.txt
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Setup Kustomize
|
|
||||||
uses: fluxcd/pkg//actions/kustomize@main
|
|
||||||
- name: Generate manifests
|
- name: Generate manifests
|
||||||
run: |
|
run: |
|
||||||
make cmd/flux/.manifests.done
|
make cmd/flux/.manifests.done
|
||||||
@@ -66,15 +61,22 @@ jobs:
|
|||||||
- name: Archive the OpenAPI JSON schemas
|
- name: Archive the OpenAPI JSON schemas
|
||||||
run: |
|
run: |
|
||||||
tar -czvf ./output/crd-schemas.tar.gz -C schemas .
|
tar -czvf ./output/crd-schemas.tar.gz -C schemas .
|
||||||
- name: Setup Syft
|
- name: Download release notes utility
|
||||||
uses: fluxcd/pkg//actions/sbom@main
|
env:
|
||||||
with:
|
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
|
||||||
version: "v0.35.1"
|
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
|
||||||
|
- name: Generate release notes
|
||||||
|
run: |
|
||||||
|
$NOTES="./output/notes.md"
|
||||||
|
echo '## CLI Changelog' > ${$NOTES}
|
||||||
|
github-release-notes -org fluxcd -repo flux2 -since-latest-release -include-author >> ${$NOTES}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v1
|
uses: goreleaser/goreleaser-action@v1
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --release-notes=/tmp/release.txt --skip-validate
|
args: release --release-notes=output/notes.md --skip-validate
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -40,8 +40,36 @@ archives:
|
|||||||
format: zip
|
format: zip
|
||||||
files:
|
files:
|
||||||
- none*
|
- none*
|
||||||
|
source:
|
||||||
|
enabled: true
|
||||||
|
name_template: '{{ .ProjectName }}_{{ .Version }}_source_code'
|
||||||
sboms:
|
sboms:
|
||||||
- artifacts: archive
|
- id: source
|
||||||
|
artifacts: source
|
||||||
|
documents:
|
||||||
|
- "{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json"
|
||||||
|
release:
|
||||||
|
extra_files:
|
||||||
|
- glob: output/crd-schemas.tar.gz
|
||||||
|
- glob: output/manifests.tar.gz
|
||||||
|
- glob: output/install.yaml
|
||||||
|
checksum:
|
||||||
|
extra_files:
|
||||||
|
- glob: output/crd-schemas.tar.gz
|
||||||
|
- glob: output/manifests.tar.gz
|
||||||
|
- glob: output/install.yaml
|
||||||
|
signs:
|
||||||
|
- cmd: cosign
|
||||||
|
env:
|
||||||
|
- COSIGN_EXPERIMENTAL=1
|
||||||
|
certificate: '${artifact}.pem'
|
||||||
|
args:
|
||||||
|
- sign-blob
|
||||||
|
- '--output-certificate=${certificate}'
|
||||||
|
- '--output-signature=${signature}'
|
||||||
|
- '${artifact}'
|
||||||
|
artifacts: checksum
|
||||||
|
output: true
|
||||||
brews:
|
brews:
|
||||||
- name: flux
|
- name: flux
|
||||||
tap:
|
tap:
|
||||||
@@ -80,11 +108,6 @@ publishers:
|
|||||||
- AUR_BOT_SSH_PRIVATE_KEY={{ .Env.AUR_BOT_SSH_PRIVATE_KEY }}
|
- AUR_BOT_SSH_PRIVATE_KEY={{ .Env.AUR_BOT_SSH_PRIVATE_KEY }}
|
||||||
cmd: |
|
cmd: |
|
||||||
.github/aur/flux-go/publish.sh {{ .Version }}
|
.github/aur/flux-go/publish.sh {{ .Version }}
|
||||||
release:
|
|
||||||
extra_files:
|
|
||||||
- glob: ./output/crd-schemas.tar.gz
|
|
||||||
- glob: ./output/manifests.tar.gz
|
|
||||||
- glob: ./output/install.yaml
|
|
||||||
dockers:
|
dockers:
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- 'fluxcd/flux-cli:{{ .Tag }}-amd64'
|
- 'fluxcd/flux-cli:{{ .Tag }}-amd64'
|
||||||
@@ -146,3 +169,12 @@ docker_manifests:
|
|||||||
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-amd64'
|
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-amd64'
|
||||||
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm64'
|
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm64'
|
||||||
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm'
|
- 'ghcr.io/fluxcd/flux-cli:{{ .Tag }}-arm'
|
||||||
|
docker_signs:
|
||||||
|
- cmd: cosign
|
||||||
|
env:
|
||||||
|
- COSIGN_EXPERIMENTAL=1
|
||||||
|
args:
|
||||||
|
- sign
|
||||||
|
- '${artifact}'
|
||||||
|
artifacts: all
|
||||||
|
output: true
|
||||||
|
|||||||
Reference in New Issue
Block a user