]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add npm publish action, remove release notes drafter, update nuget action mdo/publish-npm 41676/head
authorMark Otto <markdotto@gmail.com>
Tue, 26 Aug 2025 22:28:58 +0000 (15:28 -0700)
committerMark Otto <markd.otto@gmail.com>
Sun, 28 Sep 2025 04:20:43 +0000 (21:20 -0700)
.github/workflows/publish-npm.yml [new file with mode: 0644]
.github/workflows/publish-nuget.yml
.github/workflows/release-notes.yml [deleted file]

diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml
new file mode 100644 (file)
index 0000000..8266566
--- /dev/null
@@ -0,0 +1,50 @@
+name: Publish npm package
+
+on:
+  release:
+    types: [published]
+
+jobs:
+  publish-npm:
+    runs-on: ubuntu-latest
+    if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
+    env:
+      GITHUB_REF_NAME: ${{ github.ref_name }}
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
+        with:
+          node-version: 22
+          cache: npm
+          registry-url: 'https://registry.npmjs.org'
+
+      - name: Extract version from tag
+        id: version
+        run: |
+          VERSION=${GITHUB_REF_NAME#v}
+          echo "version=$VERSION" >> $GITHUB_OUTPUT
+          echo "Publishing version: $VERSION"
+
+      - name: Verify package version matches tag
+        run: |
+          PACKAGE_VERSION=$(node -p "require('./package.json').version")
+          TAG_VERSION="${{ steps.version.outputs.version }}"
+          echo "Package version: $PACKAGE_VERSION"
+          echo "Tag version: $TAG_VERSION"
+          if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
+            echo "Error: Package version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)"
+            exit 1
+          fi
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Publish to npm
+        run: npm publish
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
index b78023b92aa578193b4e719e914518f86a257ee8..9de042d100689188156e305df26e812d4cd0be64 100644 (file)
@@ -1,4 +1,4 @@
-name: Publish NuGet Packages
+name: Publish NuGet package
 
 on:
   release:
@@ -8,13 +8,14 @@ permissions:
   contents: read
 
 jobs:
-  package-nuget:
+  publish-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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
         with:
           persist-credentials: false
 
diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml
deleted file mode 100644 (file)
index d37d5e8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-name: Release notes
-
-on:
-  push:
-    branches:
-      - main
-  workflow_dispatch:
-
-permissions:
-  contents: read
-
-jobs:
-  update_release_draft:
-    permissions:
-      # allow release-drafter/release-drafter to create GitHub releases and add labels to PRs
-      contents: write
-      pull-requests: write
-    runs-on: ubuntu-latest
-    if: github.repository == 'twbs/bootstrap'
-    steps:
-      - uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}