diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index da65522..5e535a5 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -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 }} @@ -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