chore(deps): update vite to v7.3.2 (#67) #63
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 | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| test: | |
| name: Test | |
| uses: ./.github/workflows/test.yml | |
| secrets: | |
| HAVE_RELEASE_APP_ID: ${{ secrets.HAVE_RELEASE_APP_ID }} | |
| HAVE_RELEASE_APP_PRIVATE_KEY: ${{ secrets.HAVE_RELEASE_APP_PRIVATE_KEY }} | |
| release: | |
| name: Version and Publish | |
| needs: test | |
| runs-on: arc-happyvertical | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3 | |
| with: | |
| app-id: ${{ secrets.HAVE_RELEASE_APP_ID }} | |
| private-key: ${{ secrets.HAVE_RELEASE_APP_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://npm.pkg.github.com' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| env: | |
| NODE_AUTH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Validate version < 1.0.0 | |
| run: | | |
| version=$(node -p "require('./package.json').version") | |
| major=$(echo "$version" | cut -d. -f1) | |
| if [ "$major" -ge 1 ]; then | |
| echo "ERROR: Version >= 1.0.0 requires manual release" | |
| exit 1 | |
| fi | |
| echo "Version is 0.x.x - safe to proceed with automated releases" | |
| - name: Auto-generate changeset | |
| run: pnpm run changeset:auto | |
| - name: Version packages | |
| run: pnpm run changeset:version | |
| - name: Check for version changes | |
| id: version-check | |
| run: | | |
| if git diff --quiet package.json; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build | |
| if: steps.version-check.outputs.changed == 'true' | |
| run: pnpm build | |
| - name: Commit release | |
| if: steps.version-check.outputs.changed == 'true' | |
| run: | | |
| git add . | |
| git commit -m "chore(release): v${{ steps.version-check.outputs.version }} [skip ci]" | |
| - name: Publish to GitHub Packages | |
| if: steps.version-check.outputs.changed == 'true' | |
| run: pnpm run changeset:publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Push changes and tag | |
| if: steps.version-check.outputs.changed == 'true' | |
| run: | | |
| git tag "v${{ steps.version-check.outputs.version }}" | |
| git push origin main | |
| git push origin "v${{ steps.version-check.outputs.version }}" | |
| - name: Create GitHub Release | |
| if: steps.version-check.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| gh release create "v${{ steps.version-check.outputs.version }}" \ | |
| --title "v${{ steps.version-check.outputs.version }}" \ | |
| --generate-notes |