Skip to content

Commit 8736198

Browse files
committed
working cli ready for publish
1 parent 95d68d1 commit 8736198

4 files changed

Lines changed: 892 additions & 1488 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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

0 commit comments

Comments
 (0)