fix(ci): standardise binary names

This commit is contained in:
Robert Sturla 2024-08-16 23:50:23 +01:00
parent 845b4003e7
commit 01169cf71d
No known key found for this signature in database

View File

@ -33,17 +33,21 @@ jobs:
- name: Build binary on Linux and macOS
if: matrix.os != 'windows-latest'
env:
OS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
GOOS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
GOARCH: ${{ matrix.arch }}
run: |
GOOS=${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }} \
GOARCH=${{ matrix.arch }} \
go build -o fabric-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }} .
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} .
- name: Build binary on Windows
if: matrix.os == 'windows-latest'
env:
OS: windows
GOOS: windows
GOARCH: ${{ matrix.arch }}
run: |
$env:GOOS = 'windows'
$env:GOARCH = '${{ matrix.arch }}'
go build -o fabric-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }} .
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} .
- name: Create DMG for macOS
if: matrix.os == 'macos-latest'
@ -64,8 +68,4 @@ jobs:
- name: Upload release artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
gh release upload ${{ github.ref_name }} fabric-macos-${{ matrix.arch }}-${{ github.ref_name }}.dmg
else
gh release upload ${{ github.ref_name }} fabric-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}*
fi
gh release upload ${{ github.ref_name }} fabric-*-${{ matrix.arch }}-${{ github.ref_name }}*