diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7351cac..989b547 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,27 +1,33 @@ name: Main on: - push: - tags: - - "v*.*.*" + push: + tags: + - 'v*.*.*' jobs: - build: - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build - uses: actions/setup-go@v4 - with: - go-version: '1.18' - run: | - go get . - build.bat - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - releases/portscan.exe - releases/portscan + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build + uses: actions/setup-go@v4 + with: + go-version: '1.18' + run: | + go env CGO_ENABLED=0 + go env GOOS=windows + go env GOARCH=amd64 + go build -o releases/portscan.exe + go env CGO_ENABLED=0 + go env GOOS=linux + go env GOARCH=amd64 + go build -ldflags="-s -d" -o releases/portscan + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + releases/portscan.exe + releases/portscan diff --git a/build.bat b/build.bat index 9cf0233..31f7283 100644 --- a/build.bat +++ b/build.bat @@ -1,9 +1,9 @@ @echo off -set CGO_ENABLED=0 -set GOOS=windows -set GOARCH=amd64 +go env CGO_ENABLED=0 +go env GOOS=windows +go env GOARCH=amd64 go build -o releases/portscan.exe -SET CGO_ENABLED=0 -SET GOOS=linux -SET GOARCH=amd64 +go env CGO_ENABLED=0 +go env GOOS=linux +go env GOARCH=amd64 go build -ldflags="-s -d" -o releases/portscan