Skip to content

Commit

Permalink
⭐️ github action to release binaries (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hartmann <[email protected]>
  • Loading branch information
chris-rock authored Jul 27, 2022
1 parent 5f288d0 commit f2e0e4d
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
benchmark/cpu.out
benchmark/mem.out
benchmark/trace.out
dist
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
env:
- CGO_ENABLED=0
before:
hooks:
- go mod download
builds:
- id: protoc-gen-rangerrpc
binary: 'protoc-gen-rangerrpc_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
main: protoc-gen-rangerrpc/main.go
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
- id: protoc-gen-rangerrpc-swagger
binary: 'protoc-gen-rangerrpc-swagger_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
main: protoc-gen-rangerrpc-swagger/main.go
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
archives:
- id: releases
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
files:
- none*
checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
algorithm: sha256
snapshot:
name_template: "{{ .Tag }}-snapshot"
changelog:
use: github-native
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ install:
prep:
go install honnef.co/go/tools/cmd/staticcheck@latest

build/snapshot:
goreleaser release --snapshot --skip-publish --rm-dist

.PHONY: generate/examples
generate/examples:
go generate ./examples/pingpong
Expand Down

0 comments on commit f2e0e4d

Please sign in to comment.