Skip to content

Commit

Permalink
Run goreleaser on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Oct 21, 2020
1 parent cef65f0 commit e8db5dc
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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.15
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project_name: goptuna
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/main.go
binary: goptuna
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.revision={{.ShortCommit}}
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: darwin
linux: linux
386: i386
amd64: x86_64
format: zip
release:
prerelease: auto

0 comments on commit e8db5dc

Please sign in to comment.