Skip to content

Commit

Permalink
fix: windows error
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jun 12, 2024
1 parent c111dc7 commit 85ca1eb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ jobs:
with:
go-version: 1.22.x

- name: Setup Executable Name
# Examples:
# - 'network-hub-linux-amd64'
# - 'network-hub-windows-amd64.exe'
# - 'network-hub-macos-arm64'
run: echo "EXECUTABLE_NAME=network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }}" >> $GITHUB_ENV

- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -v -o ${{ env.EXECUTABLE_NAME }} ./cmd/main.go
go build -v -o network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }} ./cmd/main.go
- name: Upload Executable
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.tag || github.ref_name }}
file: ${{ env.EXECUTABLE_NAME }}
file: network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }}
overwrite: true

0 comments on commit 85ca1eb

Please sign in to comment.