fix(ci): fix names of artifacts to upload

This commit is contained in:
Eugen Eisler 2024-08-17 13:00:45 +02:00
parent d87333fea1
commit cd66d88e2d

View File

@ -31,11 +31,21 @@ jobs:
with: with:
go-version-file: ./go.mod 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 - name: Build binary on Linux and macOS
if: matrix.os != 'windows-latest' if: matrix.os != 'windows-latest'
env: env:
OS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }} GOOS: ${{ env.OS }}
GOOS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
GOARCH: ${{ matrix.arch }} GOARCH: ${{ matrix.arch }}
run: | run: |
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} . go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} .
@ -43,7 +53,6 @@ jobs:
- name: Build binary on Windows - name: Build binary on Windows
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
env: env:
OS: windows
GOOS: windows GOOS: windows
GOARCH: ${{ matrix.arch }} GOARCH: ${{ matrix.arch }}
run: | run: |
@ -58,4 +67,4 @@ jobs:
- name: Upload release artifact - name: Upload release artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: | 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 }}