build: bundle by vite #20
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: Release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
NODE_VERSION: '20' | |
PNPM_VERSION: '8' | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Release | |
id: release | |
uses: google-github-actions/release-please-action@v3 | |
with: | |
release-type: node | |
- name: Checkout | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ steps.release.outputs.tag_name }} | |
- name: Setup Pnpm | |
if: ${{ steps.release.outputs.release_created }} | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Setup Node | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
cache-dependency-path: '**/pnpm-lock.yaml' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Node Dependencies | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm install | |
- name: Test | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm run test --run | |
- name: Bundle | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm run bundle | |
- name: Publish | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |