Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Use github actions to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Feb 10, 2020
1 parent d841316 commit df59d0e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 28 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@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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 25 additions & 25 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: stein
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- binary: stein
goos:
- darwin
- linux
goarch:
- amd64
- main: .
binary: stein
ldflags:
- -X main.Version={{.Version}}
archive:
format: zip
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- README.md
- CHANGELOG.md
- docs/**/*.md
- -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: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
release:
github:
owner: b4b4r07
name: stein
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
prerelease: auto
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
const (
// AppName is the application name
AppName = "stein"
// Version is the application version
Version = "0.3.0"

Version = "unset"
Revision = "unset"

envEnvPrefix = "STEIN_"
)
Expand All @@ -33,7 +34,7 @@ func main() {
}
log.SetOutput(logWriter)

log.Printf("[INFO] Stein version: %s", Version)
log.Printf("[INFO] Stein version: %s (%s)", Version, Revision)
log.Printf("[INFO] Go runtime version: %s", runtime.Version())
log.Printf("[INFO] CLI args: %#v", os.Args)

Expand Down

0 comments on commit df59d0e

Please sign in to comment.