From 24dd89eff2aaa523a0fb476470bd6a485dc881ae Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Sat, 5 Oct 2024 01:26:05 -0400 Subject: [PATCH] Add goreleaser & helm-charts as release artifacts --- .github/workflows/publish.yaml | 13 ++++++- .goreleaser.yaml | 63 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 83e3d93..5969755 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -35,6 +35,9 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name : Build, test & validate run : BUILD_TARGET=helm-locker make ci + - name : Package release helm charts + run : make package-helm + - run: mkdir -p ./build/artifacts/ && mv -v ./dist/artifacts/ ./build/ - name: Extract metadata (tags, labels) for helm-locker image id: meta-locker uses: docker/metadata-action@v5 @@ -63,4 +66,12 @@ jobs: push: true tags: ${{ steps.meta-hpo.outputs.tags }} labels: ${{ steps.meta-hpo.outputs.labels }} - platforms: linux/amd64,linux/arm64 \ No newline at end of file + platforms: linux/amd64,linux/arm64 + - uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ github.ref_name }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..02abc77 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,63 @@ +# Make sure to check the documentation at https://goreleaser.com +version: 2 # the goreleaser config version +before: + hooks: + - go mod tidy +builds: + - id: helm-locker + main: ./cmd/helm-locker/main.go + goos: + - linux + goarch: + - amd64 + - arm64 + binary: helm-locker + ldflags: + - -extldflags + - -static + - -s + - -X main.Version={{.Version}} -X main.GitCommit={{.Commit}} + flags: + - -trimpath + env: + - CGO_ENABLED=0 + - id: helm-project-operator + main: ./cmd/helm-project-operator/main.go + goos: + - linux + goarch: + - amd64 + - arm64 + binary: helm-project-operator + ldflags: + - -extldflags + - -static + - -s + - -X main.Version={{.Version}} -X main.GitCommit={{.Commit}} + flags: + - -trimpath + env: + - CGO_ENABLED=0 +archives: + - id: helm-project-operator + builds: + - helm-project-operator + name_template: '{{ .Binary }}-{{ .Arch }}' + - id: helm-locker + builds: + - helm-locker + name_template: '{{ .Binary }}-{{ .Arch }}' +release: + prerelease: auto + extra_files: + - glob : ./build/artifacts/*.tgz +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'