chore: release 0.3.0-rc.1 — drop dead refs, ship 2 NuGet packages, ho… #11
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: github.event.repository.fork == false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/packages.lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore dependencies | |
| run: dotnet restore ShellUI.sln | |
| - name: Build | |
| run: dotnet build ShellUI.sln --no-restore --configuration Release | |
| - name: Run tests | |
| run: dotnet test ShellUI.sln --no-restore --no-build --configuration Release --verbosity normal | |
| - name: Pack NuGet packages | |
| run: dotnet pack ShellUI.sln --no-build --configuration Release -p:ContinuousIntegrationBuild=true | |
| # ShellUI.Core and ShellUI.Templates are internal-only — they have no public API | |
| # surface that consumers reference. Only the CLI tool and the Components runtime | |
| # library are pushed to NuGet. | |
| - name: Publish to NuGet | |
| run: | | |
| dotnet nuget push src/ShellUI.CLI/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| if ls src/ShellUI.CLI/bin/Release/*.snupkg 1> /dev/null 2>&1; then | |
| dotnet nuget push src/ShellUI.CLI/bin/Release/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| fi | |
| dotnet nuget push src/ShellUI.Components/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| if ls src/ShellUI.Components/bin/Release/*.snupkg 1> /dev/null 2>&1; then | |
| dotnet nuget push src/ShellUI.Components/bin/Release/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| fi | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ShellUI v${{ steps.version.outputs.VERSION }} | |
| body_path: docs/RELEASE_NOTES.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-') }} | |
| files: | | |
| src/ShellUI.CLI/bin/Release/*.nupkg | |
| src/ShellUI.Components/bin/Release/*.nupkg | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |