From a7441f6555878c7137853da8113c1c367679a3ee Mon Sep 17 00:00:00 2001 From: winebarrel Date: Mon, 31 Oct 2022 13:41:54 +0900 Subject: [PATCH] Introduce goreleaser --- .github/workflows/goreleaser.yml | 26 ++++++++++++++++++++++++ .goreleaser.yml | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..64272c4 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,26 @@ +name: goreleaser +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v2 + with: + go-version: ">=1.19.2" + - id: gh-app-auth + uses: summerwind/gh-app-auth@main + with: + app-id: 244816 + private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + account: kanmu + - uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ steps.gh-app-auth.outputs.token }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..94791b3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +before: + hooks: + - go mod tidy +builds: + - ldflags: + - -X main.version={{.Version}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +checksum: + name_template: "checksums.txt" +brews: + - tap: + owner: kanmu + name: homebrew-tools + homepage: https://github.com/kanmu/prmdg + description: prmd style JSON Hyper Schema to Go structs, and validators + license: MIT + install: | + bin.install 'prmdg' +nfpms: + - id: prmdg-nfpms + file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}" + homepage: https://github.com/kanmu/prmdg + maintainer: Akira Chiku + description: prmd style JSON Hyper Schema to Go structs, and validators + license: MIT + formats: + - deb + - rpm + bindir: /usr/bin