From e197f6a8415b7d6158ae9379972a4a0e3837274a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20H=C3=BCrzeler?= Date: Wed, 20 May 2020 23:41:50 +0200 Subject: [PATCH] Use goreleaser for release --- .github/workflows/release.yaml | 73 +++++++++++++--------------------- .goreleaser.yml | 21 ++++++++++ 2 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9b04c97..8b97a8e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,49 +1,32 @@ -# .github/workflows/release.yaml +name: Build & Release + +on: + push: + branches: + - "!*" + tags: + - "v*.*.*" -on: release -name: Build Release jobs: - release-linux-386: - name: release linux/386 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: "386" - GOOS: linux - release-linux-amd64: - name: release linux/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: amd64 - GOOS: linux - release-linux-arm: - name: release linux/arm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: "arm" - GOOS: linux - release-linux-arm64: - name: release linux/arm64 + goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: arm64 - GOOS: linux + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..0f5ab28 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,21 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: +builds: +- env: + - CGO_ENABLED=0 + goos: + - linux +archives: +- replacements: + linux: Linux +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'