Skip to content

Update publish.yml

Update publish.yml #79

Workflow file for this run

name: Publish to NPM
on:
release:
types: [published]
push:
branches:
- tp/**
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Parse version from tag
id: version
uses: release-kit/semver@v2
with:
source: latest-tag
fallback: 'v7.1.0-alpha+1'
- name: Use parsed version
run: |
echo "${{ steps.version.outputs.major }}"
echo "${{ steps.version.outputs.minor }}"
echo "${{ steps.version.outputs.patch }}"
echo "${{ steps.version.outputs.prerelease }}"
echo "${{ steps.version.outputs.build }}"
echo "${{ steps.version.outputs.full }}"
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: yarn install
- run: yarn test
- uses: JS-DevTools/npm-publish@v3
if: ${{ !github.event.release.prerelease && !steps.version.outputs.prerelease }}
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
dry-run: true
- name: Upload npm debug log
if: failure() # This step will run only if the previous steps failed
uses: actions/upload-artifact@v4
with:
name: npm-debug-logs
path: /home/runner/.npm/_logs/*.log