Refactor footnote handling and update build process #8
Workflow file for this run
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 NPM Package to GitHub Packages and npm | |
on: | |
push: | |
branches: | |
- ci | |
tags: | |
- 'v*.*.*' | |
jobs: | |
publish: | |
if: github.repository == 'sy-records/docsify-footnotes' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Build Plugin | |
run: npm run build | |
- name: Authenticate with GitHub Packages | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{secrets.PUBLISH_GITHUB_TOKEN}}" > ~/.npmrc | |
echo "registry=https://npm.pkg.github.com" >> ~/.npmrc | |
- name: Test publish to GitHub Packages | |
if: github.ref == 'refs/heads/ci' | |
run: | | |
echo "Testing publish to GitHub Packages..." | |
npm publish --dry-run --registry=https://npm.pkg.github.com | |
- name: Publish to GitHub Packages | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: npm publish --registry=https://npm.pkg.github.com | |
- name: Authenticate with npm | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{secrets.PUBLISH_NPM_TOKEN}}" >> ~/.npmrc | |
- name: Test publish to npm registry | |
if: github.ref == 'refs/heads/ci' | |
run: | | |
echo "Testing publish to npm registry..." | |
npm publish --dry-run --registry=https://registry.npmjs.org | |
- name: Publish to npm registry | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: npm publish --registry=https://registry.npmjs.org |