Skip to content

Commit 64261b3

Browse files
authored
Create build-go-win7-dll.yml
1 parent 33a5b46 commit 64261b3

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

0 commit comments

Comments
 (0)