diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f146cb..ce60d88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,8 +24,11 @@ jobs: - uses: actions/checkout@v4.2.2 - uses: microsoft/setup-msbuild@v2 + - name: Set version + run: Add-Content -Path $env:GITHUB_ENV -Value "FULL_VERSION=${{ github.event.inputs.version }}.${{ github.run_number }}" + - name: Build - run: dotnet build dirs.proj -restore -p:Configuration=Release -p:FullVersion=${{ github.event.inputs.version }}.${{ github.run_number }} + run: dotnet build dirs.proj -restore -p:Configuration=Release -p:FullVersion=${{ env.FULL_VERSION }} - name: Publish artifacts uses: actions/upload-artifact@v4.6.1 @@ -39,8 +42,8 @@ jobs: if: ${{ github.event.inputs.publish_nuget == 'true' }} run: | dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github - dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json + dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github + dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json - name: Publish release uses: softprops/action-gh-release@v2.2.1 @@ -48,8 +51,8 @@ jobs: with: prerelease: false generate_release_notes: true - tag_name: ${{ env.FullVersion }} + tag_name: ${{ env.FULL_VERSION }} files: | - build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FullVersion }}.nupkg + build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg build/net40/MsiZapEx/Release/bin/MsiZapEx.exe build/net40/MsiZapEx/Release/bin/CommandLine.dll