Skip to content

Commit

Permalink
Add new release flow with goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Feb 25, 2020
1 parent e74787f commit 1a2f44f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
# To upload homebrew formula to other repos,
# need to set the dedicated token having enough permissions
# https://github.com/goreleaser/goreleaser/issues/982
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
project_name: tfnotify
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: .
binary: tfnotify
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: 'darwin'
linux: 'linux'
windows: 'windows'
386: '386'
amd64: 'amd64'
format_overrides:
- goos: 'windows'
format: 'zip'
release:
prerelease: auto
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
const (
name = "tfnotify"
description = "Notify the execution result of terraform command"
version = "0.5.0"

version = "unset"
revision = "unset"
)

type tfnotify struct {
Expand Down

0 comments on commit 1a2f44f

Please sign in to comment.