Skip to content

Commit

Permalink
Perform releases for tags matching 'v*'
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Mar 1, 2020
1 parent b8dccef commit 5885f26
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
...
15 changes: 6 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -33,6 +27,8 @@ builds:
- goos: linux
goarch: arm
goarm: 7
release:
draft: true
archives:
- replacements:
darwin: Darwin
Expand All @@ -54,4 +50,5 @@ changelog:
exclude:
- '^docs:'
- '^test:'
- '^chore'
...

0 comments on commit 5885f26

Please sign in to comment.