Skip to content

Commit

Permalink
ci: build arm binary for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed May 20, 2023
1 parent d3da507 commit a0c1807
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/linux-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Linux Release
permissions:
contents: write

on:
push:
Expand All @@ -20,10 +22,18 @@ jobs:
run: |
go mod download
go build -ldflags "-s -w -X 'go-file/common.Version=$(git describe --tags)' -extldflags '-static'" -o go-file
- name: Build (arm64)
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X 'go-file/common.Version=$(git describe --tags)' -extldflags '-static'" -o go-file-arm64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: go-file
files: |
go-file
go-file-arm64
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/macos-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: macOS Release
permissions:
contents: write

on:
push:
Expand All @@ -25,5 +27,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: go-file-macos
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Windows Release
permissions:
contents: write

on:
push:
Expand All @@ -25,5 +27,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: go-file.exe
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a0c1807

Please sign in to comment.