Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move npm publish to github action #809

Merged
merged 8 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/package-nodejs-viorn-lib-publich.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: NodeJs Viron/lib Package CI
mugioka marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- develop
paths:
- "packages/nodejs/**"
- "package.json"
mugioka marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies and Build
run: |
echo "Installing packages..."
npm install --no-progress
taitasu555 marked this conversation as resolved.
Show resolved Hide resolved
npm run build -w packages/linter
npm run build -w packages/nodejs
- name: Set NPM_TOKEN
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish
run: |
echo "Publishing..."
npm publish -w packages/nodejs
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
266 changes: 264 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/nodejs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @viron/nodejs

## 2.2.0

### Minor Changes

- move cicd to github action and fix dependencies and test

## 2.1.2

### Patch Changes
Expand Down
4 changes: 0 additions & 4 deletions packages/nodejs/__tests__/domains/adminrole.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ describe('domains/adminrole', () => {

const actual = await listPolicies('director');
assert.strictEqual(actual.length, 3);
assert.strictEqual(actual[0].resourceId, 'blog');
mugioka marked this conversation as resolved.
Show resolved Hide resolved
assert.strictEqual(actual[0].permission, PERMISSION.READ);
assert.strictEqual(actual[1].resourceId, 'news');
assert.strictEqual(actual[2].resourceId, 'news');
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@viron/lib",
"version": "2.1.2",
"version": "2.2.0",
"scripts": {
"build": "npm run clean && tsc --project tsconfig.json && cp -fr src/openapi dist/",
"clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo",
Expand All @@ -21,7 +21,7 @@
],
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^11.1.0",
"@viron/linter": "^0.0.2",
"@viron/linter": "*",
"casbin": "^5.6.1",
"casbin-mongoose-adapter": "^5.3.0",
"casbin-sequelize-adapter": "^2.2.0",
Expand Down