diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e818735..398380f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,15 +25,28 @@ jobs: id: version uses: battila7/get-version-action@v2 - - name: Build Release - run: dotnet build -c Release --no-restore /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }} - - name: Publish Release - run: dotnet publish -c Release -r win-x64 --self-contained true --no-build /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }} + run: dotnet publish -c Release -r win-x64 --self-contained true /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }} - - name: Upload Artifact - uses: actions/upload-artifact@v4 + - name: Create ZIP + shell: pwsh + run: | + $publish = "splitter-cli/bin/Release/net10.0/win-x64/publish" + $version = "${{ steps.version.outputs.version-without-v }}" + $zip = "splitter-win-x64-$version.zip" + + if (Test-Path $zip) { Remove-Item $zip } + Compress-Archive -Path "$publish/*" -DestinationPath $zip + + Write-Host "Created $zip" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 with: - name: splitter-win-x64-${{ steps.version.outputs.version-without-v }} - path: splitter-cli/bin/Release/net10.0/win-x64/publish/** + tag_name: ${{ github.ref_name }} + name: "Release ${{ github.ref_name }}" + files: splitter-win-x64-${{ steps.version.outputs.version-without-v }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +