File tree Expand file tree Collapse file tree 3 files changed +54
-26
lines changed Expand file tree Collapse file tree 3 files changed +54
-26
lines changed Original file line number Diff line number Diff line change
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 }}
Original file line number Diff line number Diff line change 1
- name : Publish NuGet Packages
1
+ name : Publish NuGet package
2
2
3
3
on :
4
4
release :
5
5
types : [published]
6
6
7
7
jobs :
8
- package -nuget :
8
+ publish -nuget :
9
9
runs-on : windows-latest
10
10
if : ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
11
11
env :
12
12
GITHUB_REF_NAME : ${{ github.ref_name }}
13
13
steps :
14
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14
+ - name : Clone repository
15
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15
16
with :
16
17
persist-credentials : false
17
18
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments