update dependencies #1819
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: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| debug: | |
| description: "Turn on verbose debug output" | |
| type: boolean | |
| default: false | |
| concurrency: | |
| group: release-main | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| env: | |
| RENOUN_DEBUG: ${{ inputs.debug }} | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build | |
| env: | |
| FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | |
| TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| run: pnpm build --filter=!@examples/* | |
| - name: Publish to npm | |
| id: publish | |
| uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba | |
| with: | |
| publish: pnpm release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Fast-forward release branch | |
| if: steps.publish.outputs.published == 'true' | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| // Get the tip of main | |
| const mainRef = await github.rest.git.getRef({ owner, repo, ref: 'heads/main' }); | |
| const mainSha = mainRef.data.object.sha; | |
| // Try to read release; if missing, create it at mainSha | |
| let releaseRef; | |
| try { | |
| releaseRef = await github.rest.git.getRef({ owner, repo, ref: 'heads/release' }); | |
| } catch (error) { | |
| if (error.status === 404) { | |
| await github.rest.git.createRef({ owner, repo, ref: 'refs/heads/release', sha: mainSha }); | |
| core.info(`Created release at ${mainSha.slice(0,7)}`); | |
| return; | |
| } | |
| throw error; | |
| } | |
| // Skip if already up-to-date | |
| if (releaseRef.data.object.sha === mainSha) { | |
| return; | |
| } | |
| // Fast-forward release to main | |
| await github.rest.git.updateRef({ | |
| owner, repo, | |
| ref: 'heads/release', | |
| sha: mainSha, | |
| force: false, | |
| }); | |
| core.info(`Fast-forwarded release -> ${mainSha.slice(0,7)}`); | |
| - name: Notify Discord | |
| if: steps.publish.outputs.published == 'true' | |
| env: | |
| OWNER_REPO: ${{ github.repository }} | |
| PUBLISHED_PACKAGES: ${{ steps.publish.outputs.publishedPackages }} | |
| WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: node .github/scripts/notify-discord.mjs |