Skip to content

Commit

Permalink
Publish CLI binaries and SBOM to GitHub releases
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Jan 31, 2025
1 parent 107e444 commit 41f13e4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup Flux
Expand Down Expand Up @@ -100,22 +102,21 @@ jobs:
cosign sign --yes ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }}-manifests@${img_digest}
flux tag artifact oci://ghcr.io/controlplaneio-fluxcd/${{ env.CONTROLLER }}-manifests:${{ steps.prep.outputs.VERSION }} --tag=latest
- name: Create release
- name: Build release artifacts
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} --generate-notes --verify-tag
- name: Upload release artifacts
mkdir -p bin/release
kustomize build config/default > bin/release/install.yaml
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
id: run-goreleaser
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: latest
args: release --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p distro/flux-operator
kustomize build config/default > distro/flux-operator/install.yaml
gh release upload ${{ github.ref_name }} distro/flux-operator/install.yaml
- name: Generate SLSA metadata
id: slsa
run: |
Expand Down
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
project_name: timoni
changelog:
use: github-native
builds:
- <<: &build_defaults
binary: flux-operator
main: ./cmd/cli
ldflags:
- -s -w -X main.VERSION={{ .Version }}
env:
- CGO_ENABLED=0
id: linux
goos:
- linux
goarch:
- amd64
- arm64
- <<: *build_defaults
id: darwin
goos:
- darwin
goarch:
- amd64
- arm64
- <<: *build_defaults
id: windows
goos:
- windows
goarch:
- amd64
archives:
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
id: nix
builds: [darwin, linux]
format: tar.gz
files:
- LICENSE
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
id: windows
builds: [windows]
format: zip
files:
- LICENSE
source:
enabled: true
name_template: '{{ .ProjectName }}_{{ .Version }}_source_code'
sboms:
- id: source
artifacts: source
documents:
- "{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json"
release:
extra_files:
- glob: ./bin/release/install.yaml

0 comments on commit 41f13e4

Please sign in to comment.