Skip to content

Commit 15899dc

Browse files
committed
actions: redistribute wintun.dll
Signed-off-by: Mark Pashmfouroush <mark@markpash.me>
1 parent 1aaa463 commit 15899dc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/go-build.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@ jobs:
7070
go-version: '1.22'
7171
check-latest: true
7272

73+
- name: Cache wintun
74+
id: cache
75+
uses: actions/cache@v3
76+
if: matrix.goos == 'windows'
77+
env:
78+
cache-name: cache-wintun
79+
with:
80+
path: ~/wintun-0.14.1.zip
81+
key: wintun-0.14.1.zip
82+
83+
- name: Download wintun
84+
if: matrix.goos == 'windows' && steps.cache.outputs.cache-hit != 'true'
85+
run: |
86+
curl -LO https://www.wintun.net/builds/wintun-0.14.1.zip --output-dir ~/
87+
88+
- name: Validate wintun
89+
if: matrix.goos == 'windows'
90+
run: |
91+
echo "07c256185d6ee3652e09fa55c0b673e2624b565e02c4b9091c79ca7d2f24ef51 ~/wintun-0.14.1.zip" | sha256sum --check --status
92+
unzip ~/wintun-0.14.1.zip -d ~/wintun
93+
7394
- name: Build warp-plus
7495
run: |
7596
go build -v -o warp-plus_${{ env.ASSET_NAME }}/ -trimpath -ldflags "-s -w -buildid= -X main.version=${{ github.ref }}" ./cmd/warp-plus
@@ -80,6 +101,17 @@ jobs:
80101
cp ${GITHUB_WORKSPACE}/README.md ./warp-plus_${{ env.ASSET_NAME }}/README.md
81102
cp ${GITHUB_WORKSPACE}/LICENSE ./warp-plus_${{ env.ASSET_NAME }}/LICENSE
82103
104+
- name: Redistribute wintun.dll
105+
if: matrix.goos == 'windows'
106+
run: |
107+
if [ "$GOARCH" = "amd64" ]; then
108+
mv ~/wintun/wintun/bin/amd64/wintun.dll ./warp-plus_${{ env.ASSET_NAME }}/
109+
elif [ "$GOARCH" = "arm64" ]; then
110+
mv ~/wintun/wintun/bin/arm64/wintun.dll ./warp-plus_${{ env.ASSET_NAME }}/
111+
elif [ "$GOARCH" = "386" ]; then
112+
mv ~/wintun/wintun/bin/x86/wintun.dll ./warp-plus_${{ env.ASSET_NAME }}/
113+
fi
114+
83115
- name: Create ZIP archive
84116
shell: bash
85117
run: |

0 commit comments

Comments
 (0)