Skip to content

Merge pull request #4 from HorizonChaser/dependabot/go_modules/github… #14

Merge pull request #4 from HorizonChaser/dependabot/go_modules/github…

Merge pull request #4 from HorizonChaser/dependabot/go_modules/github… #14

name: Build Groxy and Release Binaries
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build Groxy in Linux x64
run: go build -v -o ./groxy_linux_x64 ./groxy.go
- name: Build Groxy in Windows x64
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -o ./groxy_windows_x64.exe ./groxy.go
- name: Build Groxy in Darwin x64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o ./groxy_darwin_x64 ./groxy.go
- name: Build simple_serv in Linux x64
run: go build -v -o ./simple_serv_linux_x64 ./testSuites/simple_serv.go
- name: Build Groxy in Windows x64
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -o ./simple_serv_windows_x64.exe ./testSuites/simple_serv.go
- name: Build Groxy in Darwin x64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o ./simple_serv_darwin_x64 ./testSuites/simple_serv.go
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Groxy_Build_$(date +"%Y.%m.%d_%H-%M")"
- name: Release
uses: softprops/action-gh-release@v1
with: # 将下述可执行文件 release 上 去
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
groxy_linux_x64
groxy_windows_x64.exe
groxy_darwin_x64
simple_serv_linux_x64
simple_serv_windows_x64.exe
simple_serv_darwin_x64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}