2024-09-01 11:01:45 +00:00
|
|
|
# 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: Go
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
2024-09-01 11:19:16 +00:00
|
|
|
env:
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
2024-09-01 11:01:45 +00:00
|
|
|
|
2024-09-01 11:19:16 +00:00
|
|
|
jobs:
|
2024-09-01 11:01:45 +00:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: "${{ env.GO_VERSION }}"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
go get .
|
|
|
|
|
|
|
|
- name: Build project
|
2024-09-01 11:33:22 +00:00
|
|
|
run: go build -o ProxySwitcher.exe -v ./...
|
2024-09-01 11:01:45 +00:00
|
|
|
|
2024-09-01 11:33:22 +00:00
|
|
|
- name: List contents
|
|
|
|
run: ls -laRI .git
|
|
|
|
|
2024-09-01 11:01:45 +00:00
|
|
|
- name: Upload executable
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ProxySwitcher Executable
|
2024-09-01 11:26:11 +00:00
|
|
|
path: '**/ProxySwitcher.exe'
|