Skip to content

Backward compatibility fix. #26

Backward compatibility fix.

Backward compatibility fix. #26

Workflow file for this run

name: Publish packages to npm
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
ref: ${{ github.ref }}
submodules: true
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Publish packages
run: |
set -e
extract() {
# Field's key/value should be on their own line
echo $(cat package.json \
| grep "$1" \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
}
PACKAGE_NAME=$(extract name)
PACKAGE_VERSION=$(extract version)
NPM_VERSION=$(npm view "$PACKAGE_NAME" version)
if [ "$NPM_VERSION" != "$PACKAGE_VERSION" ]
then
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}