Skip to content

Commit 8839586

Browse files
committed
Add npm publish action, remove release notes drafter, update nuget action
1 parent 25aa8cc commit 8839586

File tree

3 files changed

+54
-26
lines changed

3 files changed

+54
-26
lines changed

.github/workflows/publish-npm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish npm package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
11+
env:
12+
GITHUB_REF_NAME: ${{ github.ref_name }}
13+
steps:
14+
- name: Clone repository
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
with:
17+
persist-credentials: false
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
21+
with:
22+
node-version: 22
23+
cache: npm
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Extract version from tag
27+
id: version
28+
run: |
29+
VERSION=${GITHUB_REF_NAME#v}
30+
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
echo "Publishing version: $VERSION"
32+
33+
- name: Verify package version matches tag
34+
run: |
35+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
36+
TAG_VERSION="${{ steps.version.outputs.version }}"
37+
echo "Package version: $PACKAGE_VERSION"
38+
echo "Tag version: $TAG_VERSION"
39+
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
40+
echo "Error: Package version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)"
41+
exit 1
42+
fi
43+
44+
- name: Install npm dependencies
45+
run: npm ci
46+
47+
- name: Publish to npm
48+
run: npm publish
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-nuget.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Publish NuGet Packages
1+
name: Publish NuGet package
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
package-nuget:
8+
publish-nuget:
99
runs-on: windows-latest
1010
if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
1111
env:
1212
GITHUB_REF_NAME: ${{ github.ref_name }}
1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- name: Clone repository
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1516
with:
1617
persist-credentials: false
1718

.github/workflows/release-notes.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)