Skip to content

Merge pull request #21 from peaqnetwork/feature_update-package-name #31

Merge pull request #21 from peaqnetwork/feature_update-package-name

Merge pull request #21 from peaqnetwork/feature_update-package-name #31

name: Publish Package to npmjs
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
packages: [sdk,types]
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'
scope: 'nhussain'
#- run: npm ci
#- run: npm install
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: ./packages/${{ matrix.packages }}
- name: Install Nx CLI
run: npm install -g nx
- name: Install dependencies
run: npm install
- name: Build Nx Project
run: nx build @peaq-network/${{ matrix.packages }}
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish ${{ matrix.packages }}
#working-directory: ./packages/
run: |
node tools/scripts/publish.mjs @peaq-network/${{ matrix.packages }} ${{ steps.package-version.outputs.current-version}} latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}