-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate Goreleaser for building binaries (#19)
added Goreleaser config and GH action to build binaries for all supported platforms and architectures when a new release is published added new `snapshot` and `check-goreleaser-install` Make targets
- Loading branch information
1 parent
197366e
commit 2adcb3b
Showing
4 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: build-binary-artifacts | ||
|
||
on: | ||
# run when a release is published | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# build/test outputs | ||
bin/ | ||
dist/ | ||
*.test | ||
*profile.out | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
project_name: csproto | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- id: protoc-gen-fastmarshal | ||
main: ./cmd/protoc-gen-fastmarshal | ||
binary: protoc-gen-fastmarshal | ||
flags: | ||
- -trimpath | ||
env: | ||
- CGO_ENABLED=0 | ||
goarch: | ||
- '386' | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- '6' | ||
- '7' | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incminor .Version }}-pre.{{.Timestamp}}.{{.ShortCommit}}" | ||
changelog: | ||
use: github-native | ||
filters: | ||
exclude: | ||
- '^(docs|test)(\\(.+\\))?:' | ||
release: | ||
prerelease: auto | ||
mode: append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters