Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goreleaser github action #41

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
- name: Go Release Binary
uses: ngs/[email protected]
name: release

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.13.x
-
name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm
goarm:
- 7
archives:
- format_overrides:
- goos: windows
format: zip
files:
- none*
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Env.VERSION }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module github.com/jsha/minica

go 1.13
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
"time"
)

var version string = "DEV"
var date string

func main() {
err := main2()
if err != nil {
Expand Down Expand Up @@ -310,6 +313,7 @@ the certificate, or the first IP address if no domain names are present. It
will not overwrite existing keys or certificates.

`)
fmt.Fprintf(os.Stderr, "version %v (built on %v)\n\n", version, date)
flag.PrintDefaults()
}
flag.Parse()
Expand Down