Skip to content

Commit 8d447ce

Browse files
committed
Adjust Go nightly artifacts and Windows cgo flags
1 parent 6cf8717 commit 8d447ce

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.github/workflows/nightly.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ jobs:
163163
path: epoch-dotnet.tar.gz
164164

165165
go:
166-
runs-on: ubuntu-latest
166+
strategy:
167+
matrix:
168+
os: [ubuntu-latest, macos-latest, windows-latest]
169+
runs-on: ${{ matrix.os }}
167170
steps:
168171
- uses: actions/checkout@v4
169172
with:
@@ -173,22 +176,28 @@ jobs:
173176
with:
174177
go-version: "1.24.x"
175178
- name: Build native
179+
shell: bash
176180
run: |
177-
cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
178-
cmake --build native/build
181+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
182+
cmake -S native -B native/build
183+
cmake --build native/build --config Release
184+
else
185+
cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
186+
cmake --build native/build
187+
fi
179188
- name: Build
180189
shell: bash
181190
run: |
182191
cd go
183-
CGO_ENABLED=1 go build -o ../epoch-go-linux-amd64.a
192+
CGO_ENABLED=1 go build -o ../epoch-go-$(go env GOOS)-$(go env GOARCH).a
184193
- name: Package
185194
shell: bash
186195
run: |
187-
tar -czf epoch-go.tar.gz epoch-go-linux-amd64.a
196+
tar -czf epoch-go-$(go env GOOS)-$(go env GOARCH).tar.gz epoch-go-$(go env GOOS)-$(go env GOARCH).a
188197
- uses: actions/upload-artifact@v4
189198
with:
190-
name: epoch-go
191-
path: epoch-go.tar.gz
199+
name: epoch-go-${{ matrix.os }}
200+
path: epoch-go-*.tar.gz
192201

193202
node:
194203
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
- C++: `epoch-cpp-<os>.tar.gz` (包含 `libepoch_cpp.a`/`epoch_cpp.lib` + headers)
3939
- Java: `epoch-java.tar.gz` (jar)
4040
- .NET: `epoch-dotnet.tar.gz` (nupkg)
41-
- Go: `epoch-go.tar.gz` (静态库)
41+
- Go: `epoch-go-<os>-<arch>.tar.gz` (静态库)
4242
- Node.js: `epoch-node.tar.gz` (npm pack)
4343
- Python: `epoch-python.tar.gz` (sdist + wheel)
4444

docs/guide/languages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
- C++: `epoch-cpp-<os>.tar.gz`
4242
- Java: `epoch-java.tar.gz`
4343
- .NET: `epoch-dotnet.tar.gz`
44-
- Go: `epoch-go.tar.gz`
44+
- Go: `epoch-go-<os>-<arch>.tar.gz`
4545
- Node.js: `epoch-node.tar.gz`
4646
- Python: `epoch-python.tar.gz`

go/aeron_transport.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package epoch
22

33
/*
44
#cgo CFLAGS: -I${SRCDIR}/../native/include
5-
#cgo LDFLAGS: -L${SRCDIR}/../native/build -lepoch_aeron
5+
#cgo !windows LDFLAGS: -L${SRCDIR}/../native/build -lepoch_aeron
6+
#cgo windows LDFLAGS: -L${SRCDIR}/../native/build/Release -lepoch_aeron
67
#include "epoch_aeron.h"
78
#include <stdlib.h>
89
*/

0 commit comments

Comments
 (0)