Skip to content

Commit

Permalink
Add multi arch support
Browse files Browse the repository at this point in the history
Remove additional workflow for release
  • Loading branch information
Tzvonimir committed Apr 2, 2024
1 parent 6b3db6d commit b194848
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ jobs:

- name: Build Binary for Linux
run: |
make build
zip "lda-linux-amd64.zip" "lda"
make build GOARCH=amd64
tar -czvf "lda-linux-amd64.tar.gz" "lda"
make build GOARCH=arm64
tar -czvf "lda-linux-arm64.tar.gz" "lda"
- uses: actions/upload-artifact@v4
with:
name: lda-linux-amd64.zip
path: lda-linux-amd64.zip
name: lda-linux-amd64.tar.gz
path: lda-linux-amd64.tar.gz

- uses: actions/upload-artifact@v4
with:
name: lda-linux-arm64.tar.gz
path: lda-linux-arm64.tar.gz

build-macos:
runs-on: macos-latest
Expand All @@ -38,15 +45,22 @@ jobs:
with:
go-version: '1.21.4'

- name: Build Binary for macOS Intel
- name: Build Binary for macOS
run: |
make build
zip "lda-darwin-arm64.zip" "lda"
make build GOARCH=amd64
tar -czvf "lda-darwin-amd64.tar.gz" "lda"
make build GOARCH=arm64
tar -czvf "lda-darwin-arm64.tar.gz" "lda"
- uses: actions/upload-artifact@v4
with:
name: lda-darwin-amd64.tar.gz
path: lda-darwin-amd64.tar.gz

- uses: actions/upload-artifact@v4
with:
name: lda-darwin-arm64.zip
path: lda-darwin-arm64.zip
name: lda-darwin-arm64.tar.gz
path: lda-darwin-arm64.tar.gz

create-release:
needs: [build-linux, build-macos]
Expand All @@ -63,7 +77,9 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/lda-darwin-arm64.zip/lda-darwin-arm64.zip
artifacts/lda-linux-amd64.zip/lda-linux-amd64.zip
artifacts/lda-darwin-arm64.tar.gz/lda-darwin-arm64.tar.gz
artifacts/lda-darwin-amd64.tar.gz/lda-darwin-amd64.tar.gz
artifacts/lda-linux-amd64.tar.gz/lda-linux-amd64.tar.gz
artifacts/lda-linux-arm64.tar.gz/lda-linux-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ all: build debug

## Build binary
build: proto
CGO_ENABLED=1 GOOS=$(UNAME) go build -a -tags netgo -ldflags="$(LDFLAGS)" -o "$(TARGET)" .
CGO_ENABLED=1 GOOS=$(UNAME) GOARCH=$(ARCH) go build -a -tags netgo -ldflags="$(LDFLAGS)" -o "$(TARGET)" .

## Install binary to GOPATH
install: proto
Expand Down

0 comments on commit b194848

Please sign in to comment.