Browse Source

add: github workflow

Yaavi 1 year ago
parent
commit
99005c31ef
1 changed files with 38 additions and 0 deletions
  1. 38 0
      .github/workflows/publish.yml

+ 38 - 0
.github/workflows/publish.yml

@@ -0,0 +1,38 @@
+name: Node.js Package
+
+on:
+  push:
+    branches:
+      - release
+  pull_request:
+    branches:
+      - release
+
+jobs:
+  release:
+    name: Release
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Setup Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version: '20'
+          registry-url: 'https://registry.npmjs.org'
+
+      - name: Install dependencies
+        run: npm install
+
+      - name: Run build script
+        run: npm run build
+
+      - name: Run test script
+        run: npm run test
+
+    #   - name: Publish package
+    #     run: npm publish
+    #     env:
+    #       NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}