From 7706e636708e89363ae2625f9a025bdf18197900 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Mon, 12 Sep 2022 11:01:42 +1000 Subject: [PATCH] add release tooling --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yml | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..202fd17 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release +on: + push: + tags: + - '*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ^1.18 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3.1.0 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: macauley/action-homebrew-bump-cask@v1 + with: + token: ${{ secrets.HOMEBREW_UPDATER_PAT }} + tap: jacobbednarz/tap + cask: cf-vault + tag: ${{ github.ref }} + revision: ${{ github.sha }} diff --git a/.gitignore b/.gitignore index 8a8ce2a..41c7db2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .envrc build/* +dist/* diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..79783cb --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,21 @@ +builds: +- env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - -s -w -X github.com/jacobbednarz/cf-vault/cmd.Rev={{ .Version }} + goos: + - darwin + - freebsd + - linux + - windows +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +changelog: + skip: true