chore(deps): update all non-major dependencies #34
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 Deps Change | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - package.json | |
| - pnpm-lock.yaml | |
| workflow_dispatch: { } | |
| permissions: | |
| contents: write | |
| jobs: | |
| check: | |
| name: Check Deps Change | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.check.outputs.changed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.12.0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.27.0 | |
| - name: Detect Deps 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 Deps: $old_version" | |
| echo "New Deps: $new_version" | |
| if [ "$old_version" != "$new_version" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| release: | |
| name: Release NPM Package | |
| needs: check | |
| if: needs.check.outputs.changed == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.12.0 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.27.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: Sync vite version | |
| run: pnpm sync:vite | |
| - name: Commit updated package.json | |
| run: | | |
| git add package.json pnpm-lock.yaml | |
| git commit -m "chore: sync vite version with vitepress" || echo "No changes" | |
| git push | |
| - 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 }} |