Skip to content

Commit 921f59a

Browse files
Merge pull request #79 from CloudBoltSoftware/feature/CMP-906
feat: CMP-906 added npm publish gh workflow
2 parents 6ae3031 + eb7622b commit 921f59a

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Setup Runner
2+
description: Setup Node, Authenticate and install packages
3+
4+
# Adapted from https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
5+
6+
runs:
7+
using: composite
8+
steps:
9+
# Set up Node
10+
- name: Setup node
11+
uses: actions/setup-node@v3
12+
with:
13+
node-version-file: '.nvmrc'
14+
15+
# clean-install all npm packages
16+
- name: Install
17+
shell: bash -leo pipefail {0}
18+
run: npm ci

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Publish to JS-SDK'
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
publish-to-npm:
9+
name: Publish to JS-SDK
10+
runs-on: 'ubuntu-latest'
11+
environment: Production
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup, Authenticate, and Install
17+
uses: ./.github/actions/setup-runner
18+
19+
- run: npm run test
20+
21+
- run: npm run build
22+
23+
- uses: JS-DevTools/npm-publish@v3
24+
with:
25+
token: ${{ secrets.NPM_TOKEN }}
26+
access: public
27+
dry-run: ${{ vars.DRY_RUN }}

0 commit comments

Comments
 (0)