@@ -8,16 +8,9 @@ permissions:
88 contents : write
99
1010jobs :
11- build-linux :
12- name : Build Linux Binaries
11+ build-linux-amd64 :
12+ name : Build Linux AMD64
1313 runs-on : ubuntu-latest
14- strategy :
15- matrix :
16- include :
17- - goarch : amd64
18- name : gobyte-linux-amd64
19- - goarch : arm64
20- name : gobyte-linux-arm64
2114
2215 steps :
2316 - name : Checkout code
@@ -35,30 +28,64 @@ jobs:
3528 run : go mod download
3629
3730 - name : Build binary
31+ run : |
32+ go build -ldflags="-s -w" -o gobyte-linux-amd64 .
33+
34+ - name : Upload Release Asset
35+ uses : actions/upload-release-asset@v1
3836 env :
39- GOOS : linux
40- GOARCH : ${{ matrix.goarch }}
37+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38+ with :
39+ upload_url : ${{ github.event.release.upload_url }}
40+ asset_path : ./gobyte-linux-amd64
41+ asset_name : gobyte-linux-amd64
42+ asset_content_type : application/octet-stream
43+
44+ build-linux-arm64 :
45+ name : Build Linux ARM64
46+ runs-on : ubuntu-24.04-arm64
47+
48+ steps :
49+ - name : Checkout code
50+ uses : actions/checkout@v4
51+
52+ - name : Install libpcap
53+ run : sudo apt-get update && sudo apt-get install -y libpcap-dev
54+
55+ - name : Set up Go
56+ uses : actions/setup-go@v5
57+ with :
58+ go-version : ' stable'
59+
60+ - name : Download dependencies
61+ run : go mod download
62+
63+ - name : Build binary
4164 run : |
42- go build -ldflags="-s -w" -o ${{ matrix.name }} .
65+ go build -ldflags="-s -w" -o gobyte-linux-arm64 .
4366
4467 - name : Upload Release Asset
4568 uses : actions/upload-release-asset@v1
4669 env :
4770 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4871 with :
4972 upload_url : ${{ github.event.release.upload_url }}
50- asset_path : ./${{ matrix.name }}
51- asset_name : ${{ matrix.name }}
73+ asset_path : ./gobyte-linux-arm64
74+ asset_name : gobyte-linux-arm64
5275 asset_content_type : application/octet-stream
5376
5477 build-windows :
55- name : Build Windows Binary
78+ name : Build Windows AMD64
5679 runs-on : windows-latest
5780
5881 steps :
5982 - name : Checkout code
6083 uses : actions/checkout@v4
6184
85+ - name : Install WinPcap
86+ run : |
87+ choco install -y winpcap
88+
6289 - name : Set up Go
6390 uses : actions/setup-go@v5
6491 with :
@@ -81,16 +108,9 @@ jobs:
81108 asset_name : gobyte-windows-amd64.exe
82109 asset_content_type : application/octet-stream
83110
84- build-macos :
85- name : Build macOS Binaries
86- runs-on : macos-latest
87- strategy :
88- matrix :
89- include :
90- - goarch : amd64
91- name : gobyte-darwin-amd64
92- - goarch : arm64
93- name : gobyte-darwin-arm64
111+ build-macos-arm64 :
112+ name : Build macOS ARM64 (Apple Silicon)
113+ runs-on : macos-latest # macos-latest uses M1 runners
94114
95115 steps :
96116 - name : Checkout code
@@ -108,17 +128,48 @@ jobs:
108128 run : go mod download
109129
110130 - name : Build binary
131+ run : |
132+ go build -ldflags="-s -w" -o gobyte-darwin-arm64 .
133+
134+ - name : Upload Release Asset
135+ uses : actions/upload-release-asset@v1
111136 env :
112- GOARCH : ${{ matrix.goarch }}
137+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
138+ with :
139+ upload_url : ${{ github.event.release.upload_url }}
140+ asset_path : ./gobyte-darwin-arm64
141+ asset_name : gobyte-darwin-arm64
142+ asset_content_type : application/octet-stream
143+
144+ build-macos-amd64 :
145+ name : Build macOS AMD64 (Intel)
146+ runs-on : macos-13 # macos-13 still uses Intel runners
147+
148+ steps :
149+ - name : Checkout code
150+ uses : actions/checkout@v4
151+
152+ - name : Install libpcap
153+ run : brew install libpcap
154+
155+ - name : Set up Go
156+ uses : actions/setup-go@v5
157+ with :
158+ go-version : ' stable'
159+
160+ - name : Download dependencies
161+ run : go mod download
162+
163+ - name : Build binary
113164 run : |
114- go build -ldflags="-s -w" -o ${{ matrix.name }} .
165+ go build -ldflags="-s -w" -o gobyte-darwin-amd64 .
115166
116167 - name : Upload Release Asset
117168 uses : actions/upload-release-asset@v1
118169 env :
119170 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
120171 with :
121172 upload_url : ${{ github.event.release.upload_url }}
122- asset_path : ./${{ matrix.name }}
123- asset_name : ${{ matrix.name }}
173+ asset_path : ./gobyte-darwin-amd64
174+ asset_name : gobyte-darwin-amd64
124175 asset_content_type : application/octet-stream
0 commit comments