From cd66d88e2df9ddc4d239c01a89308495f2abccbe Mon Sep 17 00:00:00 2001 From: Eugen Eisler Date: Sat, 17 Aug 2024 13:00:45 +0200 Subject: [PATCH] fix(ci): fix names of artifacts to upload --- .github/workflows/go.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 724803c..a6143cd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,11 +31,21 @@ jobs: with: go-version-file: ./go.mod + - name: Determine OS Name + id: os-name + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + echo "OS=linux" >> $GITHUB_ENV + elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then + echo "OS=darwin" >> $GITHUB_ENV + else + echo "OS=windows" >> $GITHUB_ENV + fi + - 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' }} + GOOS: ${{ env.OS }} GOARCH: ${{ matrix.arch }} run: | go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} . @@ -43,7 +53,6 @@ jobs: - name: Build binary on Windows if: matrix.os == 'windows-latest' env: - OS: windows GOOS: windows GOARCH: ${{ matrix.arch }} run: | @@ -58,4 +67,4 @@ jobs: - name: Upload release artifact if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') run: | - gh release upload ${{ github.ref_name }} fabric-*-${{ matrix.arch }}-${{ github.ref_name }}* + gh release upload ${{ github.ref_name }} fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}