Skip to content

Commit

Permalink
Add releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuyoshi30 committed Dec 2, 2020
1 parent 9f19762 commit d5bd840
Show file tree
Hide file tree
Showing 3 changed files with 54 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: goreleaser

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: Set up 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: gitsu

env:
- GO111MODULE=on

before:
hooks:
- go mod tidy

builds:
- main: .
binary: git-su
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}

archives:
- replacements:
darwin: darwin
linux: linux
windows: windows
amd64: x86_64

release:
prerelease: auto
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Author:

var (
isGlobal = flag.Bool("global", false, "Set user as global")

// these are set in build step
version = "unversioned"
commit = "?"
date = "?"
)

func main() {
Expand Down

0 comments on commit d5bd840

Please sign in to comment.