Skip to content

Update go.yml

Update go.yml #6

Workflow file for this run

name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Build
run: |
go mod tidy
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-extldflags=-static -s -w" -o rdp-socks5-linux-amd64 -v ./...
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -trimpath -ldflags="-extldflags=-static -s -w" -o rdp-socks5-linux-386 -v ./...
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-extldflags=-static -s -w" -o rdp-socks5-win64.exe -v ./...
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -trimpath -ldflags="-extldflags=-static -s -w" -o rdp-socks5-win32.exe -v ./...
# Create release
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::ActionBuild_$(date +"%Y.%m.%d_%H-%M-%S")"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
./rdp-socks5-*
# Done release