From 01169cf71da32d07f2da9177c2aacea49f70d904 Mon Sep 17 00:00:00 2001 From: Robert Sturla Date: Fri, 16 Aug 2024 23:50:23 +0100 Subject: [PATCH] fix(ci): standardise binary names --- .github/workflows/go.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 30059bc..666266b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 }}*