2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03:00

Migrate MyGet script to GH actions (#41583)

* Migrate MyGet script to GH actions to automatically build/publish the
Bootstrap NuGet package when a release is created

* Remove `-NoPackageAnalysis` flag

* Use sha-1 for jobs

---------

Co-authored-by: Jesse Mandel <jesse.mandel@jdpa.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
This commit is contained in:
Jesse Mandel
2025-08-21 21:02:49 -07:00
committed by GitHub
parent f50f38b83a
commit 4bd8b6ca95
4 changed files with 33 additions and 19 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Publish NuGet Packages
on:
release:
types: [published]
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up NuGet
uses: nuget/setup-nuget@323ab0502cd38fdc493335025a96c8fdb0edc71f # v2.0.1
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"