Skip to content

Commit

Permalink
fix: use goreleaser instead
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Jan 30, 2023
1 parent 061423c commit c839519
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
name: GoReleaser
on:
release:
types: [created]
types: [ published ]

jobs:
releases-matrix:
name: Release Go Binary
bin-releaser:
name: Release Binaries
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://go.dev/dl/go1.19.5.linux-amd64.tar.gz"
project_path: "./cmd/lassie"
binary_name: "lassie"
extra_files: LICENSE.md README.md
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19.x"
- name: Release Binaries
uses: goreleaser/goreleaser-action@v4
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 @@
car/car
main
coverage.txt
dist/
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
builds:
- main: ./car
dir: cmd
binary: car
goos:
- linux
- windows
- darwin
goarch:
- 'amd64'
- 'arm64'
universal_binaries:
- replace: true
archives:
- format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
release:
mode: keep-existing
changelog:
skip: true

0 comments on commit c839519

Please sign in to comment.