Skip to content

Commit

Permalink
Rework GitHub Action to use go build directly instead of GoReleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt committed Mar 24, 2023
1 parent 0888fb9 commit 6238f60
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ on:

jobs:
binaries:
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -17,10 +23,25 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
go generate ./cmd
rm -rf dist/build
go build -trimpath -ldflags='-s -w' -o dist/build/pebble ./cmd/pebble
cp COPYING dist/build
cp README.md dist/build
export PEBBLE_VERSION=$(go run ./cmd/pebble version | awk '/client/ { print $2 }')
export ARCHIVE_FILE=pebble_${PEBBLE_VERSION}_${GOOS}_${GOARCH}.tar.gz
tar -czf dist/$ARCHIVE_FILE -C dist/build .
- name: Upload archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v$PEBBLE_VERSION dist/$ARCHIVE_FILE
30 changes: 0 additions & 30 deletions .goreleaser.yaml

This file was deleted.

0 comments on commit 6238f60

Please sign in to comment.