From 09bb9c034d8198ef6e9837a0ab9d7438d6d7e7c3 Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 7 Feb 2025 13:46:26 +0100 Subject: [PATCH] feature: Goreleaser config & gh action release Signed-off-by: Arthur Broudoux --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++ .goreleaser.yaml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8685b8e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: release + +on: + push: + tags: + - "*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0 + with: + go-version: "1.21.3" + + - name: Publish Homebrew package with Goreleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "${{ env.GITHUB_REF_NAME }}" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..bc1d6bd --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,38 @@ +version: 2 + +builds: + - main: ./main.go + binary: microcks-cli + env: + - CGO_ENABLED=0 + +release: + prerelease: auto + +universal_binaries: + - replace: true + +signs: + - artifacts: checksum + cmd: gpg2 + args: + - "--batch" + - "-u" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" + +brews: + - name: microcks-cli + homepage: https://github.com/microcks/microcks-cli + repository: + owner: microcks + name: homebrew-tap + +sboms: + - artifacts: archive + +checksum: + name_template: "checksums.txt"