-
Notifications
You must be signed in to change notification settings - Fork 79
105 lines (87 loc) · 2.73 KB
/
Copy pathrelease.yml
File metadata and controls
105 lines (87 loc) · 2.73 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Linux
- os: linux-amd64
goos: linux
goarch: amd64
- os: linux-arm64
goos: linux
goarch: arm64
- os: linux-armv7
goos: linux
goarch: arm
goarm: 7
- os: linux-386
goos: linux
goarch: 386
# Windows
- os: windows-amd64
goos: windows
goarch: amd64
- os: windows-arm64
goos: windows
goarch: arm64
- os: windows-386
goos: windows
goarch: 386
# macOS
- os: macos-amd64
goos: darwin
goarch: amd64
- os: macos-arm64
goos: darwin
goarch: arm64
# Android
- os: android-arm64
goos: android
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Build Binaries
shell: bash
run: |
VERSION=${GITHUB_REF_NAME}
CLIENT_FOLDER="flowdriver-client-${VERSION}-${{ matrix.os }}"
SERVER_FOLDER="flowdriver-server-${VERSION}-${{ matrix.os }}"
mkdir -p $CLIENT_FOLDER
mkdir -p $SERVER_FOLDER
SUFFIX=""
if [ "${{ matrix.goos }}" == "windows" ]; then
SUFFIX=".exe"
fi
# Build Client
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOARM=${{ matrix.goarm }} go build -o $CLIENT_FOLDER/client$SUFFIX ./cmd/client
# Build Server
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} GOARM=${{ matrix.goarm }} go build -o $SERVER_FOLDER/server$SUFFIX ./cmd/server
# Copy and rename config files
cp client_config.json.example $CLIENT_FOLDER/client_config.json
cp server_config.json.example $SERVER_FOLDER/server_config.json
# Copy README
cp README.md $CLIENT_FOLDER/
cp README.md $SERVER_FOLDER/
# Zip the folders
zip -r "${CLIENT_FOLDER}.zip" $CLIENT_FOLDER
zip -r "${SERVER_FOLDER}.zip" $SERVER_FOLDER
- name: Release
uses: softprops/action-gh-release@v1
with:
files: flowdriver-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}