-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (101 loc) · 3.87 KB
/
Copy pathrelease.yml
File metadata and controls
118 lines (101 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { goos: linux, goarch: amd64 }
- { goos: linux, goarch: arm64 }
- { goos: darwin, goarch: amd64 }
- { goos: darwin, goarch: arm64 }
- { goos: windows, goarch: amd64 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: client/go.mod
cache-dependency-path: |
client/go.sum
server/go.sum
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
mkdir -p dist
version="${GITHUB_REF_NAME}"
cd server
go build -trimpath \
-ldflags "-s -w -X main.version=${version}" \
-o "../dist/arena-tunnel-server-${{ matrix.goos }}-${{ matrix.goarch }}${ext}" ./...
cd ../client
go build -trimpath \
-ldflags "-s -w -X main.version=${version}" \
-o "../dist/arena-tunnel-client-${{ matrix.goos }}-${{ matrix.goarch }}${ext}" ./...
- name: Bundle wintun.dll into windows zip
if: matrix.goos == 'windows'
run: |
mkdir -p dist/windows-bundle
cp dist/arena-tunnel-client-windows-amd64.exe dist/windows-bundle/arena-tunnel-client.exe
cp dist/arena-tunnel-server-windows-amd64.exe dist/windows-bundle/arena-tunnel-server.exe
cp assets/wintun-amd64.dll dist/windows-bundle/wintun.dll
cd dist/windows-bundle
zip -r ../arena-tunnel-windows-amd64.zip .
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/
release:
name: GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist-raw
merge-multiple: true
- name: Stage release assets + checksums
run: |
mkdir -p release
# Per-platform binaries
cp dist-raw/arena-tunnel-server-* release/ 2>/dev/null || true
cp dist-raw/arena-tunnel-client-* release/ 2>/dev/null || true
# Windows full zip (already produced by build job)
cp dist-raw/arena-tunnel-windows-amd64.zip release/ 2>/dev/null || true
# Drop the bundle staging dir
rm -rf release/windows-bundle
cd release
sha256sum * > SHA256SUMS
echo "==="
ls -lh
cat SHA256SUMS
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release/*
generate_release_notes: true
body: |
## arena-tunnel ${{ github.ref_name }}
Single-binary WireGuard-over-WebSocket tunnel. See README + ARCHITECTURE for design.
### Downloads
| Platform | Binary |
|-----------------|-------------------------------------------------------|
| Linux x86_64 | `arena-tunnel-client-linux-amd64` |
| Linux ARM64 | `arena-tunnel-client-linux-arm64` |
| macOS Intel | `arena-tunnel-client-darwin-amd64` |
| macOS Apple Si | `arena-tunnel-client-darwin-arm64` |
| Windows x86_64 | `arena-tunnel-windows-amd64.zip` (includes wintun.dll)|
Verify with `sha256sum -c SHA256SUMS`.