diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7de55931e..8b430c0c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,27 +31,39 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: '5.0.100' - - - name: Configure NuGet - run: nuget sources Add -Name "NuGet.org" -Source "https://api.nuget.org/v3/index.json" + + - name: Test network connectivity to NuGet.org + run: | + echo "Testing network connectivity to NuGet.org..." + curl -v https://api.nuget.org/v3/index.json + + - name: Verify NuGet sources + run: nuget sources list - name: Install MSBuild.Community.Tasks - run: nuget install MSBuild.Community.Tasks -Version 1.5.0.235 -OutputDirectory packages - + run: | + echo "Installing MSBuild.Community.Tasks..." + nuget install MSBuild.Community.Tasks -Version 1.5.0.235 -OutputDirectory packages + if ($?) { + echo "Installation successful." + } else { + echo "Installation failed." + } + - name: Install Microsoft.Build.Utilities.v4.0 run: nuget install Microsoft.Build.Utilities.v4.0 -Version 4.0.0 -OutputDirectory packages - name: Restore nuget packages and generate credential templates run: | - dotnet msbuild src/Greenshot.sln /restore /t:PrepareForBuild /p:Configuration=Release /p:Platform="Any CPU" /p:MSBuildExtensionsPath=$(pwd)/packages/MSBuild.Community.Tasks.1.5.0.235/tools + dotnet msbuild src/Greenshot.sln /restore /t:PrepareForBuild /p:Configuration=Release /p:Platform="Any CPU" /p:MSBuildExtensionsPath=$(pwd)/packages/MSBuild.Community.Tasks.1.5.0.235/tools || exit 1 - name: Build and package - run: dotnet msbuild src/Greenshot.sln /p:Configuration=Release /p:Platform="Any CPU" /p:MSBuildExtensionsPath=$(pwd)/packages/MSBuild.Community.Tasks.1.5.0.235/tools + run: dotnet msbuild src/Greenshot.sln /p:Configuration=Release /p:Platform="Any CPU" /p:MSBuildExtensionsPath=$(pwd)/packages/MSBuild.Community.Tasks.1.5.0.235/tools || exit 1 - name: Copy Files to artifact staging directory run: | mkdir -p ${{ github.workspace }}/artifacts - cp $(Build.SourcesDirectory)/installer/Greenshot-INSTALLER-*.exe ${{ github.workspace }}/artifacts + cp $(Build.SourcesDirectory)/installer/Greenshot-INSTALLER-*.exe ${{ github.workspace }}/artifacts || exit 1 - name: Upload Build Artifacts uses: actions/upload-artifact@v3