| name: Publish NuGet Packages |
| |
| on: |
| release: |
| types: [published] |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| package-nuget: |
| runs-on: windows-latest |
| if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }} |
| env: |
| GITHUB_REF_NAME: ${{ github.ref_name }} |
| steps: |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| with: |
| persist-credentials: false |
| |
| - name: Set up NuGet |
| uses: nuget/setup-nuget@fd55a6f3b34392fa83fde1454582407d8c714123 # v4.0 |
| with: |
| nuget-api-key: ${{ secrets.NuGetAPIKey }} |
| nuget-version: '5.x' |
| |
| - name: Pack NuGet packages |
| shell: pwsh |
| run: | |
| $bsversion = $env:GITHUB_REF_NAME.Substring(1) |
| nuget pack "nuget\bootstrap.nuspec" -Verbosity detailed -NonInteractive -BasePath . -Version $bsversion |
| nuget pack "nuget\bootstrap.sass.nuspec" -Verbosity detailed -NonInteractive -BasePath . -Version $bsversion |
| nuget push "bootstrap.$bsversion.nupkg" -Verbosity detailed -NonInteractive -Source "https://api.nuget.org/v3/index.json" |
| nuget push "bootstrap.sass.$bsversion.nupkg" -Verbosity detailed -NonInteractive -Source "https://api.nuget.org/v3/index.json" |