Skip to content

Commit 7cc08a1

Browse files
committed
feat: Custom npm package deployment
With this we are adding a custom deployment of the NPM package to our private NPM registry based on our changes.
1 parent 6f09924 commit 7cc08a1

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Push NPM
2+
on: push
3+
jobs:
4+
push:
5+
runs-on: ubuntu-latest
6+
name: NPM Push Demo
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-node@v3
10+
with:
11+
node-version: '16'
12+
- run: npm install
13+
# - run: npm run build:vosviewer
14+
# - run: npm run build:dimensions
15+
# - run: npm run build:zeta-alpha
16+
# - run: npm run build:rori
17+
- run: npm run build-component-package
18+
# - name: Upload Dimensions app artifact
19+
# uses: actions/upload-artifact@v4
20+
# with:
21+
# name: vosviewer-online-dimensions-app
22+
# path: dist/vosviewer-online-dimensions
23+
- name: Create npm package
24+
run: cd lib && npm pack
25+
- name: Get package filename
26+
id: create-package
27+
run: echo "package_file=$(ls lib/*.tgz | xargs basename)" >> $GITHUB_OUTPUT
28+
- name: Upload npm package artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: vosviewer-online.tgz
32+
path: "lib/${{ steps.create-package.outputs.package_file }}"
33+
- name: Cloudsmith Push
34+
uses: cloudsmith-io/action@v0.6.14
35+
with:
36+
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
37+
command: "push"
38+
format: "npm"
39+
owner: "dimensions"
40+
repo: "ds-vosviewer"
41+
file: "lib/${{ steps.create-package.outputs.package_file }}"

copy-component-package-json.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ Object.keys(peerDependencies).forEach(key => {
1515
delete dependencies[key];
1616
});
1717
const newPkg = {
18-
name: 'vosviewer-online',
18+
name: "@vosviewer-fork/vosviewer-online",
1919
version,
20-
description: "React component package for integrating VOSviewer Online into your site or application.",
20+
description:
21+
"React component package for integrating VOSviewer Online into your site or application.",
2122
author,
2223
keywords,
2324
license,
@@ -28,7 +29,7 @@ const newPkg = {
2829
main: "./index.js",
2930
dependencies,
3031
peerDependencies,
31-
engines
32+
engines,
3233
};
3334

3435
fs.writeFileSync(`lib/package.json`, JSON.stringify(newPkg, null, 2));

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)