Skip to content

Commit

Permalink
add: go releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
d-tsuji committed Dec 13, 2020
1 parent 10999e6 commit 47ab819
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.x

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
project_name: awsmfa
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/awsmfa
binary: awsmfa
flags:
- -trimpath
ldflags:
- -s -w
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux
goarch:
- amd64
- 386
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
release:
prerelease: auto
github:
owner: d-tsuji
name: awsmfa

0 comments on commit 47ab819

Please sign in to comment.