From 417758326b61fe9aed3ab61684ecbca624d15d53 Mon Sep 17 00:00:00 2001 From: Aurimas Niekis Date: Mon, 1 Feb 2021 16:37:58 +0900 Subject: [PATCH] Added goreleaser --- .github/workflows/release.yaml | 19 +++++------- .goreleaser.yml | 56 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 895098d..91bcff8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,20 +17,15 @@ jobs: # step 1: checkout repository code - name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 # step 2: generate build files - - name: Generate build files - uses: thatisuday/go-build-action@v1 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 with: - platforms: "linux/amd64, darwin/amd64, windows/amd64" - name: "pz" - compress: "true" - dest: "dist" - - # step 3: upload build-artifacts - - name: Upload build-artifacts - uses: skx/github-action-publish-binaries@master + version: latest + args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: "./dist/*.tar.gz" \ No newline at end of file + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..d605e21 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,56 @@ +builds: + - binary: pz + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +brews: + - + name: pz + # GOARM to specify which 32-bit arm version to use if there are multiple versions + # from the build section. Brew formulas support atm only one 32-bit version. + # Default is 6 for all artifacts or each id if there a multiple versions. + goarm: 6 + + tap: + owner: project-zer0 + name: homebrew-tap + # Optionally a token can be provided, if it differs from the token provided to GoReleaser + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + + url_template: "https://github.com/project-zer0/pz-launcher/releases/download/{{ .Tag }}/{{ .ArtifactName }}" + + commit_author: + name: goreleaserbot + email: goreleaser@carlosbecker.com + + folder: Formula + + homepage: "https://github.com/project-zer0/pz-launcher" + + description: "A project-zer0/pz launcher" + + license: "MIT" + + custom_block: | + head "https://github.com/project-zer0/pz-launcher.git"