feat: clean up code style and improve readability in various scripts #29
This file contains hidden or 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 Package | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: ['*'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
Verify: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: 14 | |
- name: Setup and install dependencies | |
run: | | |
npm i pnpm -g | |
pnpm install | |
- name: Test | |
run: pnpm run test | |
- name: Build | |
run: pnpm run build | |
Publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: [Verify] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: 14 | |
- name: Package 📦 | |
run: | | |
npm i pnpm -g | |
pnpm install | |
pnpm run build | |
- name: Publish 🚀 | |
run: pnpm run release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |