Skip to content

Commit

Permalink
fix: remove distro, leverage goos
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jun 12, 2024
1 parent 59365eb commit b5aeeb3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,25 @@ jobs:
fail-fast: false
matrix:
include:
# TODO: Add support for arm based runners when GH makes them generally available
- runner: macos-latest
goos: darwin
goarch: arm64
distro: macos
- runner: ubuntu-latest
goos: linux
goarch: amd64
distro: ubuntu
- runner: windows-latest
goos: windows
goarch: amd64
distro: windows
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 @@ -47,13 +53,13 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -v -o network-hub-${{ matrix.distro }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }} ./cmd/main.go
go build -v -o $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: network-hub-${{ matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }}
file: $EXECUTABLE_NAME
overwrite: true

0 comments on commit b5aeeb3

Please sign in to comment.