Skip to content

Commit

Permalink
Add github action to provide release binaries #45 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yomo authored Sep 7, 2020
1 parent 403117d commit 015b477
Show file tree
Hide file tree
Showing 2 changed files with 72 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*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go 1.13
uses: actions/setup-go@v2
with:
go-version: 1.13.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
before:
hooks:
- go mod download
builds:
- main: .
binary: yo
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm
- 386
ignore:
- goos: darwin
goarch: 386

archives:
- format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- LICENSE
- README.md

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "SNAPSHOT-{{ .Tag }}"

changelog:
sort: asc
filters:
exclude:
- '^test:'
- 'README'
- Merge pull request
- Merge branch

0 comments on commit 015b477

Please sign in to comment.