Upgrade to .NET 10 SDK and update libraries (#511) #321
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| DOTNET_VERSION: 10.0.x | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| outputs: | |
| version: ${{ steps.set-version-to-output.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Update version number | |
| shell: pwsh | |
| run: | | |
| $doc = [XML](Get-Content 'Source\Directory.Build.props') | |
| $doc.Project.PropertyGroup.Version = '${{github.ref}}'.Split('/')[2].Substring(1) | |
| $doc.Save('Source\Directory.Build.props') | |
| - name: Set version to outputs | |
| id: set-version-to-output | |
| shell: pwsh | |
| run: | | |
| $doc = [XML](Get-Content 'Source\Directory.Build.props') | |
| echo "version=$($doc.Project.PropertyGroup.Version)" >> $Env:GITHUB_OUTPUT | |
| - name: Install dependencies | |
| run: dotnet restore ReactiveProperty.slnx | |
| - name: Build | |
| run: dotnet build ReactiveProperty.slnx -c Release --no-restore /p:ContinuousIntegrationBuild=True /p:EmbedUntrackedSources=True | |
| - name: Test | |
| run: dotnet test ReactiveProperty.slnx --no-restore --verbosity normal | |
| - name: Copy package files | |
| run: | | |
| mkdir dist | |
| Copy-Item (Get-ChildItem -Path "Source/**/*.nupkg" -Recurse) -Destination dist | |
| Copy-Item (Get-ChildItem -Path "Source/**/*.snupkg" -Recurse) -Destination dist | |
| shell: pwsh | |
| - name: Archive NuGet packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| release-to-nuget: | |
| runs-on: windows-latest | |
| needs: build | |
| steps: | |
| - name: Download archives | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| - name: Publish packages | |
| run: dotnet nuget push **/*.nupkg --skip-duplicate -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json | |
| create-release: | |
| runs-on: windows-latest | |
| needs: build | |
| steps: | |
| - name: Download archives | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "v${{ needs.build.outputs.version }}" | |
| prerelease: ${{ contains(needs.build.outputs.version, '-pre') }} | |
| title: Release ${{ needs.build.outputs.version }} | |
| files: | | |
| dist/*.nupkg |