Skip to content

Commit

Permalink
CI: Run Goreleaser on new git tag (#142)
Browse files Browse the repository at this point in the history
Build webrpc-gen binary for multiple OS/archs.
Create a Github release with changelog & attach the binaries.
  • Loading branch information
VojtechVitek committed Nov 20, 2022
1 parent bd231de commit 09fd29b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release tag

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.19
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See documentation at https://goreleaser.com/customization/build.
project_name: webrpc

builds:
- main: ./cmd/webrpc-gen
binary: webrpc-gen
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64

archives:
- name_template: "{{ .Binary }}.{{ .Os }}-{{ .Arch }}"
format: binary

checksum:
name_template: "checksums.txt"

changelog:
use: github
sort: asc
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ all:

build:
go build -o ./bin/webrpc-gen ./cmd/webrpc-gen
go generate ./...

clean:
rm -rf ./bin
Expand All @@ -44,10 +43,9 @@ generate:
dep:
go mod tidy

diff:
git diff --color --ignore-all-space --ignore-blank-lines --exit-code

dep-upgrade-all:
go get -u ./...
@$(MAKE) dep

diff:
git diff --color --ignore-all-space --ignore-blank-lines --exit-code

0 comments on commit 09fd29b

Please sign in to comment.