From be1c5c069ac25235cf246009e2dd790dcbbe6204 Mon Sep 17 00:00:00 2001 From: Ilan Zerath Date: Tue, 2 Jan 2024 20:52:09 +0100 Subject: [PATCH] chore(binary): issues 240 - Add GoReleaser in order to compile for multi arch --- .github/workflows/goreleaser.yml | 32 ++++++++++++++++++++++++++++++++ .goreleaser.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 00000000..be9510c2 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,32 @@ +name: goreleaser + +on: + release: + types: + - released + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + check-latest: true + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..c189048e --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,26 @@ +# Read config documentation at https://goreleaser.com +before: + hooks: + - go mod download +builds: + - main: ./cmd/tcld + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 +checksum: + name_template: 'checksums.txt' + algorithm: sha256 +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'