fix(packaging): publish Fallout.VisualStudio.SolutionPersistence; bum… #34
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
| # Hand-written (not auto-generated) — see Build.CI.GitHubActions.cs for the | |
| # rationale (lets us bridge GitHub's NUGET_API_KEY secret to Fallout's | |
| # NuGetApiKey parameter, which would otherwise have to share a name). | |
| name: release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.assets/**' | |
| - '**/*.md' | |
| permissions: | |
| contents: write # for ICreateGitHubRelease (tag + GitHub release) | |
| packages: write # for the Nuke.* transition-shim push to GH Packages (#47) | |
| jobs: | |
| release: | |
| name: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Nerdbank.GitVersioning needs full history | |
| submodules: recursive # vendor/vs-solutionpersistence | |
| - name: 'Cache: .fallout/temp, ~/.nuget/packages' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .fallout/temp | |
| ~/.nuget/packages | |
| key: ${{ runner.os }}-release-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props', 'version.json') }} | |
| - name: 'Run: Test, Pack, Publish' | |
| run: ./build.cmd Test Pack Publish | |
| env: | |
| # Publish target is nuget.org now that Fallout.* rename has landed (#54). | |
| # NUGET_API_KEY is an API key scoped to push Fallout.* packages, set in | |
| # repo Settings → Secrets and variables → Actions. | |
| NuGetApiKey: ${{ secrets.NUGET_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Nuke.* transition-shim packages are intentionally filtered out of the | |
| # main Publish step (see Build.cs PushPackageFiles) because that ID | |
| # belongs to NUKE's original maintainer on nuget.org. We publish them | |
| # here to GitHub Packages instead. #47. | |
| - name: 'Publish: Nuke.* transition shims to GH Packages' | |
| if: always() # still push the shims even if a previous Fallout.* push transient-failed | |
| run: | | |
| shopt -s nullglob | |
| shims=(output/packages/Nuke.*.nupkg) | |
| if [ ${#shims[@]} -eq 0 ]; then | |
| echo "No Nuke.* shim packages found in output/packages — skipping." | |
| exit 0 | |
| fi | |
| for pkg in "${shims[@]}"; do | |
| echo "Pushing $pkg to GH Packages..." | |
| dotnet nuget push "$pkg" \ | |
| --source "https://nuget.pkg.github.com/ChrisonSimtian/index.json" \ | |
| --api-key "${{ secrets.GITHUB_TOKEN }}" \ | |
| --skip-duplicate | |
| done |