Skip to content

Fix stepper: no precheck for undefined variables (#1469) #27

Fix stepper: no precheck for undefined variables (#1469)

Fix stepper: no precheck for undefined variables (#1469) #27

Workflow file for this run

name: Publish to npm
on:
push:
branches:
- master
jobs:
verify:
name: Verify should publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: master
submodules: recursive
- name: Verify version has changed
# We use jq as `npm pkg get version` returns a quoted string
run: |
if [ "$(cat package.json | jq -r .version)" == "$(npm view js-slang version)" ]; then
echo "Version has not changed"
echo "UPDATE=false" >> "$GITHUB_OUTPUT"
else
echo "Version has changed";
echo "UPDATE=true" >> "$GITHUB_OUTPUT"
fi
publish:
name: Publish to npm
needs: [verify]
if: ${{ needs.verify.outputs.UPDATE == 'true' }}
environment: publish-npm # Await approval from maintainers
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: master
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}