File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Go Windows DLL
2+
3+ permissions :
4+ contents : write
5+
6+ on :
7+ workflow_dispatch :
8+ inputs :
9+ branch :
10+ description : " Branch to build from"
11+ required : true
12+ default : " main"
13+
14+ jobs :
15+ build-windows-dll :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+ with :
21+ ref : ${{ github.event.inputs.branch }}
22+
23+ - name : Set up Go 1.20
24+ uses : actions/setup-go@v5
25+ with :
26+ go-version : " 1.20"
27+
28+ - name : Build DLLs for Windows (32-bit and 64-bit)
29+ run : |
30+ mkdir -p windows
31+
32+ echo "Building 64-bit DLL..."
33+ GOOS=windows GOARCH=amd64 CGO_ENABLED=1 \
34+ go build -buildmode=c-shared -trimpath -ldflags="-s -w" \
35+ -o ./windows/openimsdk_amd64.dll ./
36+
37+ echo "Building 32-bit DLL..."
38+ GOOS=windows GOARCH=386 CGO_ENABLED=1 \
39+ go build -buildmode=c-shared -trimpath -ldflags="-s -w" \
40+ -o ./windows/openimsdk_386.dll ./
41+
42+ - name : Upload DLLs as Artifacts
43+ uses : actions/upload-artifact@v4
44+ with :
45+ name : windows-dlls
46+ path : ./windows/*.dll
You can’t perform that action at this time.
0 commit comments