Skip to content

Commit adbe1e9

Browse files
committed
chore: add check for draft PR in CI, refactor package action
1 parent a059a7a commit adbe1e9

File tree

4 files changed

+27
-36
lines changed

4 files changed

+27
-36
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
jobs:
1212
ci:
1313
runs-on: ubuntu-latest
14+
15+
if: ${{ !github.event.pull_request.draft }}
16+
1417
steps:
1518
- name: Checkout repository
1619
uses: actions/checkout@v4

.github/workflows/release-package.yml

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,32 @@ on:
55
types: [created]
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version-file: '.nvmrc'
15-
- run: npm ci
16-
- run: npm test
8+
build-and-publish:
9+
name: Build and Publish to NPM Registry
1710

18-
publish-gpr:
19-
needs: build
2011
runs-on: ubuntu-latest
21-
permissions:
22-
packages: write
23-
contents: read
12+
2413
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v4
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
2719
with:
2820
node-version-file: '.nvmrc'
29-
registry-url: https://npm.pkg.github.com/
30-
- run: npm ci
31-
- run: npm run build-lib
32-
- run: npm publish
33-
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
publish-npm:
36-
name: Publish to NPM Registry
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v4
40-
- uses: actions/setup-node@v4
41-
with:
42-
node-version: 16
21+
cache: 'npm'
4322
registry-url: 'https://registry.npmjs.org/'
44-
- run: npm ci
45-
- run: npm run build-lib
46-
- run: npm publish --access public
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Execute test cases
28+
run: npm test
29+
30+
- name: Build Lib
31+
run: npm run build-lib
32+
33+
- name: Publish to NPM Registry
34+
run: npm publish --access public
4735
env:
4836
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.0.82-beta-13",
3+
"version": "0.0.82-beta-14",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)