chore(deps): update all non-major dependencies #26
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: Release on VitePress Change | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - package.json | |
| - pnpm-lock.yaml | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| jobs: | |
| check: | |
| name: Check VitePress Change & Sync Vite | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.check.outputs.changed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.21.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.23.0 | |
| - name: Detect VitePress version change | |
| id: check | |
| run: | | |
| old_version=$(git show HEAD^:package.json | jq -r '.devDependencies.vitepress // .dependencies.vitepress // empty') | |
| new_version=$(jq -r '.devDependencies.vitepress // .dependencies.vitepress // empty' package.json) | |
| echo "Old VitePress: $old_version" | |
| echo "New VitePress: $new_version" | |
| if [ "$old_version" != "$new_version" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Sync vite version | |
| if: steps.check.outputs.changed == 'true' | |
| run: pnpm sync:vite | |
| release: | |
| name: Release NPM Package | |
| needs: check | |
| if: needs.check.outputs.changed == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.21.1 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.23.0 | |
| - name: Set Git Identity | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build project | |
| run: pnpm build | |
| - name: Release with release-it | |
| run: pnpm exec release-it --ci | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |