Skip to content

Commit

Permalink
dotnet-desktop.yml: include version in output, "Create Release" step
Browse files Browse the repository at this point in the history
  • Loading branch information
dinar committed Dec 22, 2024
1 parent b3cf6f5 commit 8f7c4a0
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ jobs:
with:
dotnet-version: 8.0.x

- name: Get version from tag
id: get_version
shell: bash
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=dev" >> $GITHUB_OUTPUT
fi
- name: Restore dependencies
run: dotnet restore ${{ env.Solution_Name }}

Expand All @@ -89,8 +99,21 @@ jobs:
Remove-Item -Path AudioMixer\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\publish\sni.dll -ErrorAction SilentlyContinue
Remove-Item -Path AudioMixer\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\publish\System.Data.SqlClient.dll -ErrorAction SilentlyContinue
- name: Create zip archive
run: |
Compress-Archive -Path AudioMixer\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\publish\* -DestinationPath AudioMixer-${{ steps.get_version.outputs.VERSION }}.zip
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: AudioMixer-${{ matrix.configuration }}
path: AudioMixer/bin/${{ matrix.configuration }}/net8.0-windows/win-x64/publish/
name: AudioMixer-${{ steps.get_version.outputs.VERSION }}
path: AudioMixer-${{ steps.get_version.outputs.VERSION }}.zip

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: AudioMixer-${{ steps.get_version.outputs.VERSION }}.zip
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

0 comments on commit 8f7c4a0

Please sign in to comment.