ci: work on artifact names for upload

This commit is contained in:
Eugen Eisler 2024-09-12 19:10:33 +02:00
parent 357feb7a2f
commit e8de263e7f

View File

@ -51,10 +51,13 @@ jobs:
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
echo "OS=linux" >> $GITHUB_ENV
echo "EXT=" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
echo "OS=darwin" >> $GITHUB_ENV
echo "EXT=" >> $GITHUB_ENV
else
echo "OS=windows" >> $GITHUB_ENV
echo "EXT=.exe" >> $GITHUB_ENV
fi
shell: bash
@ -72,13 +75,13 @@ jobs:
GOOS: windows
GOARCH: ${{ matrix.arch }}
run: |
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} .
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }}${EXT} .
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}
path: fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}
name: fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }}
path: fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }}${EXT}
- name: Create release if it doesn't exist
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
@ -92,4 +95,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}
gh release upload ${{ github.ref_name }} fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}${EXT}