Skip to content

Commit

Permalink
[sc-48140] Removed .npmrc file as it will be generated during workf…
Browse files Browse the repository at this point in the history
…lows.
  • Loading branch information
Simon Ramzi committed Aug 15, 2023
1 parent ebf9b75 commit 1191ec6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ jobs:
matrix:
node-version: [ 14, 16, 18, 19]
steps:

- name: Checkout Repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: npm install, build, and test
run: |
npm ci
Expand All @@ -25,22 +28,32 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install npm-force-resolutions
run: npm install -g npm-force-resolutions

- name: Install dependencies
run: npm install

- name: Build Package
run: npm run build --if-present

- name: Tag Version
run: npm --no-git-tag-version version prerelease --preid=${GITHUB_REF##*/}-${GITHUB_SHA:0:8}

- name: Configure Project-Level .npmrc File
run: npm config set --location=project @adzerk:registry=https://'${NPM_REGISTRY}' //'${NPM_REGISTRY}'/:_authToken='${NPM_SECRET}'

- name: Publish to GitHub NPM Registry
run: npm publish
env:
NPM_REGISTRY: npm.pkg.github.com
NPM_SECRET: ${{ secrets.GITHUB_TOKEN }}
NPM_SECRET: ${{ secrets.GITHUB_TOKEN }}
17 changes: 12 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,32 @@ on:
release:
types: [published]

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY: registry.npmjs.org
NPM_SECRET: ${{ secrets.NPM_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: npm install

- name: Build SDK
run: npm run build

- name: Configure Project-Level .npmrc File
run: npm config set --location=project @adzerk:registry=https://'${NPM_REGISTRY}' //'${NPM_REGISTRY}'/:_authToken='${NPM_SECRET}'

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY: registry.npmjs.org
NPM_SECRET: ${{ secrets.NPM_TOKEN }}
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

0 comments on commit 1191ec6

Please sign in to comment.