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 }}*