Merge pull request #9 from caiqy/main #139
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
# 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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners | |
os: [ubuntu-20.04, windows-2019, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.22.0 | |
- name: Install dependencies | |
run: go get . | |
- name: Build | |
shell: bash | |
run: | | |
if [ "${{ matrix.os }}" = "ubuntu-20.04" ]; then | |
go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go | |
go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go | |
elif [ "${{ matrix.os }}" = "windows-2019" ]; then | |
go build -trimpath -ldflags "-s -w" -o vpnagent.exe vpnagent.go | |
go build -trimpath -ldflags "-s -w" -o sslcon.exe sslcon.go | |
elif [ "${{ matrix.os }}" = "macos-14" ]; then | |
go build -trimpath -ldflags "-s -w" -o vpnagent vpnagent.go | |
go build -trimpath -ldflags "-s -w" -o sslcon sslcon.go | |
fi |