-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add goreleaser and github action
Signed-off-by: Chinmay D. Pai <[email protected]>
- Loading branch information
1 parent
db366a7
commit 7bd52a7
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release Go project | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
name: GoReleaser build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ | ||
|
||
- name: Set up Go 1.15 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
id: go | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@master | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
project_name: grafana-export | ||
|
||
builds: | ||
- # Build macOS, Linux and Windows versions | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
targets: | ||
- linux_amd64 | ||
- darwin_amd64 | ||
- windows_amd64 | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} | ||
|
||
archives: | ||
- # Replacements for GOOS and GOARCH in the archive name. | ||
replacements: | ||
darwin: macOS | ||
linux: Linux | ||
windows: Windows | ||
amd64: x86_64 | ||
|
||
# Can be used to change the archive formats for specific GOOS. | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
# Additional files/template/globs you want to add to the archive. | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
algorithm: sha256 | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}" | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^*.md:" |