Skip to content

Update go.yml

Update go.yml #102

Workflow file for this run

# 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: build ghostcp
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
permissions:
contents: write
strategy:
matrix:
goos: [windows]
goarch: [amd64]
runs-on: windows-2025
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
- uses: actions/[email protected]
- name: Show workflow information
run: |
export osarch=$GOOS-$GOARCH
echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $osarch"
echo "osarch=$osarch" >> $GITHUB_ENV
- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.21'
check-latest: true
- name: Get project dependencies
run: go mod download
- name: Build ghostcp
run: go build -v -o ghostcp-${{ env.osarch }}/ -trimpath -ldflags "-s -w -buildid=" ./...
# - name: Build background ghostcp on Windows
# if: matrix.goos == 'windows'
# run: go build -v -o ghostcp-${{ env.osarch }}/wghostcp.exe -trimpath -ldflags "-s -w -H windowsgui -buildid=" ./...
- name: Package
run: |
cp README.md LICENSE release/* ghostcp-${{ env.osarch }}
- name: Upload files to Artifacts
uses: actions/[email protected]
with:
name: ghostcp-${{ env.osarch }}
path: |
./ghostcp-${{ env.osarch }}/*