Skip to content

fix: switch logic

fix: switch logic #49

Workflow file for this run

name: Release
on:
push:
tags:
- v*.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org
- name: Determine npm cache directory
id: npm-cache
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Npm Install pnpm
run: npm install -g pnpm
- name: pnpm Install --no-frozen-lockfile
run: pnpm i --no-frozen-lockfile
- name: Version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Build # build npm
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "theajack"
git checkout master
npx lerna bootstrap
npx lerna version ${{ steps.version.outputs.version }} --no-git-tag-version --force-publish --yes
npm run build
git add .
git commit -m "feat: Version ${{ steps.version.outputs.version }} Build"
npx lerna publish from-package --yes
npm run init:mono -- ${{ steps.version.outputs.version }}
git add .
git commit -m "feat: Version ${{ steps.version.outputs.version }} Publish"
git push origin master
# - name: Pages # github pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: docs
- name: Release # release
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# - name: Publish # npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
# run: npm run eb:publish -- ${{ steps.version.outputs.version }}
- name: Purge # purge cdn
run: npm run eb:purge -- ${{ steps.version.outputs.version }}