Skip to content

Commit

Permalink
build: add goreleaser and github action
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay D. Pai <[email protected]>
  • Loading branch information
Thunderbottom committed Nov 6, 2020
1 parent db366a7 commit 7bd52a7
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release_build.yml
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 }}
49 changes: 49 additions & 0 deletions .goreleaser.yml
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:"

0 comments on commit 7bd52a7

Please sign in to comment.