Fix evaluation error when no evaluation code is provided (#1472) #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |