Skip to content

Commit

Permalink
make: more platforms/arch, actions: add new binaries to release
Browse files Browse the repository at this point in the history
  • Loading branch information
hayzamjs committed Sep 7, 2024
1 parent 4b7a7e0 commit 6c4014c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,19 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
dist/kalmia_${{ github.ref_name }}_freebsd_amd64
dist/kalmia_${{ github.ref_name }}_freebsd_arm64
dist/kalmia_${{ github.ref_name }}_linux_386
dist/kalmia_${{ github.ref_name }}_linux_amd64
dist/kalmia_${{ github.ref_name }}_linux_arm
dist/kalmia_${{ github.ref_name }}_linux_arm64
dist/kalmia_${{ github.ref_name }}_win64.exe
dist/kalmia_${{ github.ref_name }}_freebsd64
dist/kalmia_${{ github.ref_name }}_macos64
dist/kalmia_${{ github.ref_name }}_linux_riscv64
dist/kalmia_${{ github.ref_name }}_macos_amd64
dist/kalmia_${{ github.ref_name }}_macos_arm64
dist/kalmia_${{ github.ref_name }}_windows_386.exe
dist/kalmia_${{ github.ref_name }}_windows_amd64.exe
dist/kalmia_${{ github.ref_name }}_windows_arm64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
44 changes: 29 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,40 @@ else
done
endif

build-amd64-linux:
# Linux builds
build-linux-amd64:
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_linux_amd64 main.go

build-arm64-linux:
build-linux-386:
GOOS=linux GOARCH=386 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_linux_386 main.go
build-linux-arm:
GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_linux_arm main.go
build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_linux_arm64 main.go

build-win64:
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_win64.exe main.go

build-freebsd64:
GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_freebsd64 main.go

build-linux-riscv64:
GOOS=linux GOARCH=riscv64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_linux_riscv64 main.go

# Windows builds
build-windows-amd64:
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_windows_amd64.exe main.go
build-windows-386:
GOOS=windows GOARCH=386 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_windows_386.exe main.go
build-windows-arm64:
GOOS=windows GOARCH=arm64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_windows_arm64.exe main.go

# FreeBSD builds
build-freebsd-amd64:
GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_freebsd_amd64 main.go
build-freebsd-arm64:
GOOS=freebsd GOARCH=arm64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_freebsd_arm64 main.go

# macOS builds
build-macos-amd64:
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_macos_amd64 main.go
build-macos-arm64:
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_macos_arm64 main.go

build-macos-amd64:
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o dist/$(APP_NAME)_$(APP_VERSION)_macos64 main.go

build: clean build-amd64-linux build-arm64-linux build-win64 build-freebsd64 build-macos-arm64 build-macos-amd64
build: clean build-linux-amd64 build-linux-386 build-linux-arm build-linux-arm64 build-linux-riscv64 build-windows-amd64 build-windows-386 build-windows-arm64 build-freebsd-amd64 build-freebsd-arm64 build-macos-amd64 build-macos-arm64
mkdir -p dist

clean:
rm -rf dist
rm -rf dist

0 comments on commit 6c4014c

Please sign in to comment.