Skip to content

Commit 1d1b816

Browse files
committed
auto build release
1 parent 22c734a commit 1d1b816

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/AutoBuild.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: AutoBuild
5+
permissions:
6+
contents: write
7+
on:
8+
push:
9+
tags:
10+
- '*'
11+
pull_request:
12+
tags:
13+
- '*'
14+
15+
jobs:
16+
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
os: [linux, darwin, windows]
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: '1.20'
30+
31+
- name: Build_client
32+
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_windows.exe .
33+
if: matrix.os == 'windows'
34+
- name: Build_server
35+
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_windows.exe .
36+
if: matrix.os == 'windows'
37+
38+
- name: Build_client
39+
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_linux .
40+
if: matrix.os == 'linux'
41+
- name: Build_server
42+
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_linux .
43+
if: matrix.os == 'linux'
44+
45+
- name: Build_client
46+
run: cd client && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o client_macos .
47+
if: matrix.os == 'darwin'
48+
- name: Build_server
49+
run: cd server && export GOOS=${{matrix.os}} && export GOARCH=amd64 && go build -o server_macos .
50+
if: matrix.os == 'darwin'
51+
52+
- name: Upload to GitHub Releases
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
files: client/client_windows.exe,client/client_linux,client/client_macos,server/server_windows.exe,server/server_linux,server/server_macos
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+

0 commit comments

Comments
 (0)