From c87b00dda48b0230e3439e08ffca0ee4a4eed751 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Wed, 17 Jul 2024 09:34:53 +0200 Subject: [PATCH] Creating actions and goreleaser --- .github/workflows/release.yaml | 40 ++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 22 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..596916c8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,40 @@ +# .github/workflows/release.yml +name: goreleaser + +on: + pull_request: + push: + # run only against tags + tags: + - "*" + +permissions: + contents: write + # packages: write + # issues: 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: stable + # More assembly might be required: Docker logins, GPG, etc. + # It all depends on your needs. + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..e5b0c652 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,22 @@ +# .goreleaser.yml +project_name: hey +release: + github: + owner: rjshrjndrn + name: hey +builds: + - main: ./cmd/app + env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X main.appVersion={{.Version}} +brews: + - name: hey + repository: + owner: rjshrjndrn + name: homebrew-tap + url_template: "https://github.com/rjshrjndrn/hey/releases/download/{{ .Tag }}/hey_{{ .Version }}_{{ .Os }}_{{ .Arch }}.tar.gz" + homepage: "https://github.com/rjshrjndrn/hey" + description: "A templating tool using helm flavoured sprig" + test: | + system "#{bin}/hey --version"