Server: refactor server code for readability and maintainability (#6) #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Server | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
CGO_LDFLAGS: -Wl,--no-as-needed | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Build Linux | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libenet-dev | |
sudo apt-get install -y pkg-config | |
cd server && go build -o server main.go | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build Windows | |
run: cd server && go build -o server.exe main.go | |
if: matrix.os == 'windows-latest' | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: server | |
path: ${{github.workspace}}/server | |
if-no-files-found: error |