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