Skip to content

Release: v1.1.1: Saving Everything (patch) (#2) #9

Release: v1.1.1: Saving Everything (patch) (#2)

Release: v1.1.1: Saving Everything (patch) (#2) #9

name: Publish API to NPM
on:
push:
branches:
- release
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- name: Setup .npmrc (NPM)
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@promisepending'
- name: Enforce npm 8
run: npm install -g npm@8.x
- name: Get Current version
id: current_version
run: echo ::set-output name=version::$(node -p "require('./package.json').version")
- name: Get current npm version
id: npm_version
run: echo ::set-output name=version::$(npm view arunabase version)
- name: Compare versions and skip if same
id: compare_versions
if: ${{ steps.current_version.outputs.version == steps.npm_version.outputs.version }}
run: echo ::set-output name=skip::true && echo "Skipping publish as versions are same" && exit 0
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Prepare to publish
run: npm run pdeploy
- name: Publish to npm
working-directory: ./build
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}