From 68047d77d218438f146fab8ac5155bfd54069944 Mon Sep 17 00:00:00 2001 From: Miles Garnsey <11435896+Miles-Garnsey@users.noreply.github.com> Date: Wed, 29 May 2024 16:37:40 +1000 Subject: [PATCH] Add release workflow for multi-platform binaries. (#47) * Add release workflow for multi-platform binaries. --- .github/workflows/release.yaml | 21 +++++++++++++++++++++ .goreleaser.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1a3fa71..bb389d0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -76,3 +76,24 @@ jobs: run: | docker login -u redhat-isv-containers+5ebee0e40e3deaf258b160d1-robot quay.io -p ${{ secrets.K8SSANDRA_CLIENT_CONNECT_SECRET }} preflight check container quay.io/redhat-isv-containers/64f725593ba91d38e7246955:${{ steps.vars.outputs.tag_name}} --certification-project-id=64f725593ba91d38e7246955 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + cache: true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: "~> v1" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..d0c21f3 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,32 @@ +project_name: k8ssandra-client +builds: +- binary: "kubectl-k8ssandra" + main: ./cmd/kubectl-k8ssandra/main.go + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + + +# proxies from the go mod proxy before building +# https://goreleaser.com/customization/gomod +gomod: + proxy: false + +# config the checksum filename +# https://goreleaser.com/customization/checksum +checksum: + name_template: 'checksums.txt' + +# create a source tarball +# https://goreleaser.com/customization/source/ +source: + enabled: true \ No newline at end of file