chore(release): update dependencies (#1256) #778
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: | |
| - master | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: write | |
| checks: write | |
| pull-requests: write | |
| statuses: read | |
| id-token: write # Required for OIDC (https://docs.npmjs.com/trusted-publishers#github-actions-configuration) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install pnpm | |
| uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0 | |
| with: | |
| install: false | |
| - name: Use node 22 | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "pnpm" | |
| # Ensure npm >= 11.5.1 for OIDC trusted publishers (https://docs.npmjs.com/trusted-publishers#github-actions-configuration) | |
| # Two-step upgrade works around broken npm in Node 22.22.2 (nodejs/node#62425) | |
| - name: Update npm | |
| run: | | |
| npm_major=$(npm --version | cut -d. -f1) | |
| if [ "$npm_major" -lt 11 ]; then | |
| npm install -g npm@10 && npm install -g npm@latest | |
| fi | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run lint | |
| run: pnpm lint | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Cache npx tools | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-npm-arethetypeswrong-0.18.2 | |
| - name: Validate CJS and ESM resolution for SDK | |
| # Catch issues like https://github.com/linear/linear/issues/830 | |
| run: npx @arethetypeswrong/cli@0.18.2 --pack packages/sdk | |
| - name: Compare schema for changes | |
| uses: graphql-hive/graphql-inspector@8733c10560f98b868d3eb4db1325c8edf64936b3 # @graphql-inspector/action@5.0.21 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| schema: "master:packages/sdk/src/schema.graphql" | |
| fail-on-breaking: false | |
| - name: Check for no generated changes | |
| run: git update-index --refresh && git diff-index HEAD | |
| - name: Create Release Pull Request or Publish to npm | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| commit: "chore(release): version packages" | |
| title: "chore(release): version packages" | |
| publish: pnpm ci:publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| notify-slack: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| needs: [release] | |
| permissions: | |
| actions: read | |
| contents: read | |
| if: ${{ always() && github.ref_name == 'master' && contains(needs.*.result, 'failure') }} | |
| steps: | |
| - uses: ravsamhq/notify-slack-action@bca2d7f5660b833a27bda4f6b8bef389ebfefd25 # 2.3.0 | |
| with: | |
| status: ${{ job.status }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| notification_title: "SDK CI check failed on master branch" | |
| message_format: ":x: Check failed in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>" | |
| footer: <{run_url}|View Run> | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |