Skip to content

Commit

Permalink
fix: actions error
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jun 12, 2024
1 parent b5aeeb3 commit c111dc7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ jobs:
goos: windows
goarch: amd64
runs-on: ${{ matrix.runner }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
# Examples:
# - 'network-hub-linux-amd64'
# - 'network-hub-windows-amd64.exe'
# - 'network-hub-macos-arm64'
EXECUTABLE_NAME: network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }}

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -48,18 +41,25 @@ 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 $EXECUTABLE_NAME ./cmd/main.go
go build -v -o ${{ env.EXECUTABLE_NAME }} ./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: $EXECUTABLE_NAME
file: ${{ env.EXECUTABLE_NAME }}
overwrite: true

0 comments on commit c111dc7

Please sign in to comment.