From 5885f266af703b0ee95fe43cb7145df704e5a3ec Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 2 Mar 2020 00:29:51 +0100 Subject: [PATCH] Perform releases for tags matching 'v*' --- .github/workflows/release.yml | 26 +++++++++++++++----------- .goreleaser.yml | 15 ++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf3b5cb3..69e2b1af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,32 @@ --- -name: Release +name: release on: push: tags: - - '*' + - 'v*' jobs: - release: - name: Build + goreleaser: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Unshallow + run: git fetch --prune --unshallow - name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.13.x - - name: Checkout - uses: actions/checkout@v2 -# - name: Unshallow -# run: git fetch --prune --unshallow -# working-directory: /home/runner/work/couchdb-prometheus-exporter/go/src/github.com/gesellix/couchdb-prometheus-exporter - - name: Release binaries + go-version: 1.13 + - name: Check GoReleaser config + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: check + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 with: version: latest args: release --rm-dist + # key: ${{ secrets.YOUR_PRIVATE_KEY }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ... diff --git a/.goreleaser.yml b/.goreleaser.yml index 0ec8aa47..1ce3908e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,21 +1,15 @@ --- -# This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com before: hooks: - # you may remove this if you don't use vgo - # - go mod tidy - # you may remove this if you don't need go generate -# - go generate ./... + - go mod download + - go generate ./... builds: - env: - CGO_ENABLED=0 - # Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`. ldflags: - - -s -w -extldflags "-static" -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser` - # - -s -w -X main.build={{.Version}} - # - ./usemsan=-msan + - -s -w -extldflags "-static" -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.builtBy=goreleaser` goos: - darwin - linux @@ -33,6 +27,8 @@ builds: - goos: linux goarch: arm goarm: 7 +release: + draft: true archives: - replacements: darwin: Darwin @@ -54,4 +50,5 @@ changelog: exclude: - '^docs:' - '^test:' + - '^chore' ...