Skip to content

Commit

Permalink
Merge pull request #35 from juanfont/goreleaser
Browse files Browse the repository at this point in the history
Use goreleaser to generate binary builds
  • Loading branch information
juanfont authored Jun 14, 2021
2 parents 6e86b2a + da80140 commit 6df90a9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -42,5 +42,4 @@ jobs:
run: make lint

- name: Run build
run: make

run: make
40 changes: 40 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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:'

0 comments on commit 6df90a9

Please sign in to comment.