From 5e3ed184ea4dde3f5be684e78ff89ff50714dda3 Mon Sep 17 00:00:00 2001 From: Saad Date: Fri, 13 Sep 2024 15:38:10 -0400 Subject: [PATCH 1/2] update automated token test --- .github/workflows/node.js.yml | 15 +++++++++++++++ README.md | 2 +- VERSION | 3 ++- package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6ee7cbc..5fe034f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,3 +29,18 @@ jobs: - run: sudo apt-get install xvfb - run: xvfb-run --auto-servernum npm run test:chrome - run: xvfb-run --auto-servernum npm run test:firefox + + - name: Publish to npm dry-run + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm publish --dry-run + + - name: Publish to npm + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm publish diff --git a/README.md b/README.md index 71a3286..e2cc782 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ npm i @puremvc/puremvc-js-multicore-framework * [React Native](https://en.wikipedia.org/wiki/React_Native) ## Status -Production - [Version 2.0.8](https://github.com/PureMVC/puremvc-js-multicore-framework/blob/master/VERSION) +Production - [Version 2.0.9](https://github.com/PureMVC/puremvc-js-multicore-framework/blob/master/VERSION) #### Documentation - https://jsdoc.app/about-commandline.html diff --git a/VERSION b/VERSION index adeb862..5aae294 100644 --- a/VERSION +++ b/VERSION @@ -4,7 +4,7 @@ Release Date: 9/4/24 Platform: JavaScript Version: 2 Revision: 0 - Minor: 8 + Minor: 9 Authors: Saad Shams : David Foley : Cliff Hall @@ -18,3 +18,4 @@ Release Date: 9/4/24 2.0.6 - NPM package bundling the ESM/CommonJS support 2.0.7 - Finally? NPM bundling 2.0.8 - CI/CD Pipeline +2.0.9 - CI/CD Integrating Automated Tokens diff --git a/package.json b/package.json index 84fd764..c26c998 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@puremvc/puremvc-js-multicore-framework", - "version": "2.0.8", + "version": "2.0.9", "description": "PureMVC MultiCore Framework for JavaScript", "type": "module", "main": "bin/cjs/index.cjs", From e1c4b1bb703e64dc1a6e3bbbe328692b06ee6707 Mon Sep 17 00:00:00 2001 From: Saad Date: Fri, 13 Sep 2024 18:48:58 -0400 Subject: [PATCH 2/2] update added an npm publish job --- .github/workflows/node.js.yml | 45 +++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 5fe034f..5678c94 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: node-version: [19.x, 20.x, 21.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v3 @@ -30,17 +29,33 @@ jobs: - run: xvfb-run --auto-servernum npm run test:chrome - run: xvfb-run --auto-servernum npm run test:firefox - - name: Publish to npm dry-run - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - npm publish --dry-run - - - name: Publish to npm - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - npm publish + # Separate job for publishing to npm + publish: + runs-on: ubuntu-latest + needs: build # Wait for build to complete + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: "20.x" + cache: "npm" + - run: npm install + - run: npm run build + + - name: Publish to npm dry-run + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm publish --dry-run + + - name: Publish to npm + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm publish