-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (45 loc) · 1.28 KB
/
release.yml
File metadata and controls
60 lines (45 loc) · 1.28 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
name: Build and Release Wiretunnel
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.3'
- name: Build and Package
run: |
TAG=${{ github.ref_name }}
PLATFORMS=(
"linux:amd64"
"linux:386"
"linux:arm64"
"windows:amd64"
"windows:386"
"windows:arm64"
)
export CGO_ENABLED=0
mkdir -p dist
for PLATFORM in "${PLATFORMS[@]}"; do
OS=${PLATFORM%:*}
ARCH=${PLATFORM#*:}
DIR_NAME="wiretunnel-${TAG}-${OS}-${ARCH}"
OUTPUT="dist/$DIR_NAME"
mkdir -p "$OUTPUT"
env GOOS=$OS GOARCH=$ARCH go build -v -trimpath -ldflags "-s -w" -o $OUTPUT/ ./cmd/wiretunnel
cp LICENSE "$OUTPUT/"
(cd dist && zip -r "${DIR_NAME}.zip" "$DIR_NAME")
done
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}