Merge pull request #35 from juanfont/goreleaser

Use goreleaser to generate binary builds
This commit is contained in:
Juan Font 2021-06-14 16:20:57 +02:00 committed by GitHub
commit 6df90a922c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 3 deletions

30
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: goreleaser
on:
push:
tags:
- "*" # triggers only if push new tag version
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
# The "build" workflow
build:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
@ -42,5 +42,4 @@ jobs:
run: make lint
- name: Run build
run: make
run: make

40
.goreleaser.yml Normal file
View File

@ -0,0 +1,40 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7
main: ./cmd/headscale/headscale.go
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'