chore(release): v0.3.0-rc.3 #13
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: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Extract release notes for this version | |
| run: bash scripts/extract-release-notes.sh "${{ steps.version.outputs.VERSION }}" > "$RUNNER_TEMP/release-body.md" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Check package version matches tag | |
| run: | | |
| for proj in src/ShellUI.CLI/ShellUI.CLI.csproj src/ShellUI.Components/ShellUI.Components.csproj; do | |
| v=$(dotnet msbuild "$proj" -getProperty:Version) | |
| if [ "$v" != "${{ steps.version.outputs.VERSION }}" ]; then | |
| echo "::error::$proj builds version $v but the tag is v${{ steps.version.outputs.VERSION }}. Update Directory.Build.props." | |
| exit 1 | |
| fi | |
| done | |
| - 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.slnx | |
| # Generate the precompiled CSS bundle before build so releases always ship | |
| # a fresh one. File is gitignored — regenerated on every CI/release run. | |
| - name: Build precompiled CSS bundle | |
| run: | | |
| set -euxo pipefail | |
| bash scripts/rebuild-precompiled-css.sh | |
| BUNDLE=src/ShellUI.Components/wwwroot/shellui-all.css | |
| test -f "$BUNDLE" || (echo "ERROR: bundle was not produced"; exit 1) | |
| # Content sanity — same assertions ci.yml runs. | |
| grep -q -- '--background:' "$BUNDLE" || (echo "ERROR: theme vars missing"; exit 1) | |
| grep -q '\.bg-background' "$BUNDLE" || (echo "ERROR: utilities missing"; exit 1) | |
| echo "release bundle size: $(wc -c < "$BUNDLE") bytes" | |
| - name: Build | |
| run: dotnet build ShellUI.slnx --no-restore --configuration Release | |
| - name: Run tests | |
| run: dotnet test ShellUI.slnx --no-restore --no-build --configuration Release --verbosity normal | |
| - name: Pack NuGet packages | |
| run: dotnet pack ShellUI.slnx --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: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ShellUI v${{ steps.version.outputs.VERSION }} | |
| body_path: ${{ runner.temp }}/release-body.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 }} |