1
- name : Update Major Version Tag 🏷️
1
+ name : Update Major Version Tag and Publish to Registry 📦
2
2
3
3
on :
4
4
push :
11
11
runs-on : ubuntu-latest
12
12
steps :
13
13
-
uses :
nowactions/[email protected]
14
+
15
+ update-registries :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+ with :
20
+ ref : dev
21
+
22
+ # Setup .npmrc file to publish to npm
23
+ - uses : actions/setup-node@v4
24
+ with :
25
+ node-version-file : ' .nvmrc'
26
+ registry-url : ' https://registry.npmjs.org'
27
+ scope : ' @jamesives'
28
+
29
+ - name : Configure Git
30
+ run : |
31
+ git config user.email "[email protected] "
32
+ git config user.name "James Ives"
33
+
34
+ - name : Install Yarn
35
+ run : npm install -g yarn
36
+
37
+ - run : yarn install --frozen-lockfile
38
+ - run : yarn build
39
+ - run : git stash
40
+ - name : Set version to match the tag
41
+ run : |
42
+ VERSION=${GITHUB_REF#refs/tags/v}
43
+ npm version $VERSION -m "Release $VERSION 📣"
44
+ env :
45
+ GITHUB_REF : ${{ github.ref }}
46
+ - run : git push
47
+
48
+ # Publish to npm
49
+ - run : npm publish --access public
50
+ env :
51
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
52
+
53
+ # Setup .npmrc file to publish to GitHub Packages
54
+ - uses : actions/setup-node@v4
55
+ with :
56
+ node-version-file : ' .nvmrc'
57
+ registry-url : ' https://npm.pkg.github.com'
58
+ scope : ' @jamesives'
59
+
60
+ - name : Authenticate with the GitHub Package Registry
61
+ run : |
62
+ echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
63
+
64
+ # Publish to GitHub Packages
65
+ - run : npm publish
66
+ env :
67
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments