🐳 chore: switch node version #13
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: NPM Publish | |
on: | |
push: | |
tags: | |
- "v*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
cache: yarn | |
- run: yarn install --frozen-lockfile | |
- name: Build | |
run: | | |
cp ./README_zh-CN.md ./packages/vitepress-theme-async | |
cp ./README.md ./packages/vitepress-theme-async | |
node ./scripts/publish.mjs | |
yarn config:build | |
rm ./packages/vitepress-theme-async/config/index.ts ./packages/vitepress-theme-async/config/languages.ts ./packages/vitepress-theme-async/config/less.ts | |
rm -r ./packages/vitepress-theme-async/plugin | |
zip -r vitepress-theme-async ./packages/vitepress-theme-async | |
env: | |
RELEASE_VERSION: ${{ github.ref }} | |
- name: Beta Publish | |
if: ${{ contains(github.ref,'beta') }} | |
run: | | |
cd ./packages/vitepress-theme-async | |
npm publish --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish | |
if: ${{ !contains(github.ref,'beta') }} | |
run: | | |
cd ./packages/vitepress-theme-async | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Releases | |
uses: MaLuns/add-release@v1 | |
with: | |
files: vitepress-theme-async.zip | |
generate_release_notes: true | |
generate_release_notes_by_commit: true | |
prerelease: ${{ contains(github.ref,'beta') }} |