Skip to content

Commit

Permalink
CI: Configure automatic releases using goreleaser
Browse files Browse the repository at this point in the history
This will automatically build and package the CLI every time a
v<something> tag is pushed.
  • Loading branch information
daenney committed Dec 14, 2020
1 parent 6b81af5 commit 6c86bbc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release
on:
push:
tags:
- 'v*'

jobs:
test:
name: Build and package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15.6'
- name: Check formatting
run: test -z $(gofmt -l **.go)
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
builds:
- id: cli
binary: gdqcli
main: ./cmd/gdqcli
mod_timestamp: '{{ .CommitTimestamp }}'
gcflags:
- all=-trimpath={{.Env.GOPATH}}
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
- arm
goarm:
- 6
- 7
archives:
- id: cli
builds:
- cli
wrap_in_directory: true
files:
- LICENSE
- README.md
format_overrides:
- goos: windows
format: zip

0 comments on commit 6c86bbc

Please sign in to comment.