Release #660
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
| # SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath> | |
| # | |
| # SPDX-License-Identifier: MIT | |
| # This file is auto-generated. | |
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - renovate/** | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: 0 0 * * 6 | |
| workflow_dispatch: | |
| jobs: | |
| nuget: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: 1 | |
| NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages | |
| steps: | |
| - name: Check out the sources | |
| uses: actions/checkout@v6 | |
| - name: Set up .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v5 | |
| with: | |
| key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.*proj', '**/*.props') }} | |
| path: ${{ env.NUGET_PACKAGES }} | |
| - id: version | |
| name: Get version | |
| shell: pwsh | |
| run: echo "version=$(scripts/Get-Version.ps1 -RefName $env:GITHUB_REF)" >> $env:GITHUB_OUTPUT | |
| - run: dotnet pack --configuration Release -p:Version=${{ steps.version.outputs.version }} | |
| - name: Read changelog | |
| uses: ForNeVeR/ChangelogAutomation.action@v2 | |
| with: | |
| output: ./release-notes.md | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| path: |- | |
| ./release-notes.md | |
| ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg | |
| ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg | |
| ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg | |
| ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.snupkg | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| name: Create a release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: ./release-notes.md | |
| files: |- | |
| ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg | |
| ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg | |
| ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg | |
| ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.snupkg | |
| name: TruePath v${{ steps.version.outputs.version }} | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| name: Push TruePath to NuGet | |
| run: dotnet nuget push ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_TRUE_PATH }} | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| name: Push TruePath.SystemIo to NuGet | |
| run: dotnet nuget push ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_TRUE_PATH_SYSTEM_IO }} |