-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (48 loc) · 1.79 KB
/
AutoBuild.yml
File metadata and controls
58 lines (48 loc) · 1.79 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: AutoBuild
permissions:
contents: write
on:
push:
tags:
- '*'
pull_request:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build_client
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_windows.exe .
if: matrix.os == 'windows'
- name: Build_server
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_windows.exe .
if: matrix.os == 'windows'
- name: Build_client
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_linux .
if: matrix.os == 'linux'
- name: Build_server
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_linux .
if: matrix.os == 'linux'
- name: Build_client
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_macos .
if: matrix.os == 'darwin'
- name: Build_server
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_macos .
if: matrix.os == 'darwin'
- name: Upload to GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: client/client_windows.exe,client/client_linux,client/client_macos,server/server_windows.exe,server/server_linux,server/server_macos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}