From 84eae4aabd2b8554fb463e8aff9769cd6981dc80 Mon Sep 17 00:00:00 2001 From: acolchado Date: Sun, 22 May 2022 11:05:35 -0700 Subject: [PATCH] ci(node): [RO-13533] Adds NPM publish ci config --- .github/workflows/npm-publish.yml | 18 ++++++++++++++++++ .../{node.js.yml => pull-request.yml} | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/npm-publish.yml rename .github/workflows/{node.js.yml => pull-request.yml} (88%) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..0ca7362 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,18 @@ +name: Publish Package to npmjs +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_SPUR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/pull-request.yml similarity index 88% rename from .github/workflows/node.js.yml rename to .github/workflows/pull-request.yml index 70c117a..36f1d83 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/pull-request.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Pull request on: pull_request: @@ -17,9 +17,9 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm'