File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Fleetbase CLI CI
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ tags :
7+ - ' v*'
8+ pull_request :
9+ branches : [ main ]
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ strategy :
16+ matrix :
17+ node-version : [18.x] # Build on Node.js 18
18+
19+ steps :
20+ - uses : actions/checkout@v2
21+
22+ - name : Setup Node.js ${{ matrix.node-version }}
23+ uses : actions/setup-node@v2
24+ with :
25+ node-version : ${{ matrix.node-version }}
26+
27+ - name : Install Dependencies
28+ run : npm install
29+
30+ npm_publish :
31+ needs : build
32+ runs-on : ubuntu-latest
33+ if : startsWith(github.ref, 'refs/tags/')
34+ steps :
35+ - uses : actions/checkout@v2
36+
37+ - name : Setup Node.js 18.x
38+ uses : actions/setup-node@v2
39+ with :
40+ node-version : 18.x
41+
42+ - name : Install Dependencies
43+ run : npm install
44+
45+ - name : Set up npm
46+ run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
47+
48+ - name : Publish
49+ run : npm publish --access public
50+
51+ github_publish :
52+ needs : build
53+ runs-on : ubuntu-latest
54+ if : startsWith(github.ref, 'refs/tags/')
55+ steps :
56+ - uses : actions/checkout@v2
57+
58+ - name : Setup Node.js 18.x
59+ uses : actions/setup-node@v2
60+ with :
61+ node-version : 18.x
62+
63+ - name : Install Dependencies
64+ run : npm install
65+
66+ - name : Configure npm for GitHub registry
67+ run : |
68+ echo "@fleetbase:registry=https://npm.pkg.github.com/" >> ~/.npmrc
69+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
70+
71+ - name : Publish to GitHub registry
72+ run : npm publish
You can’t perform that action at this time.
0 commit comments