Mirror: The spec-compliant minimum of client-side GraphQL.
at main 2.2 kB view raw
1name: Release 2on: 3 push: 4 branches: 5 - main 6 7jobs: 8 release: 9 name: Release 10 runs-on: ubuntu-22.04 11 timeout-minutes: 20 12 permissions: 13 contents: write 14 id-token: write 15 issues: write 16 repository-projects: write 17 deployments: write 18 packages: write 19 pull-requests: write 20 steps: 21 - name: Checkout Repo 22 uses: actions/checkout@v4 23 with: 24 fetch-depth: 0 25 26 - name: Setup Node 27 uses: actions/setup-node@v4 28 with: 29 node-version: 20 30 31 - name: Setup pnpm 32 uses: pnpm/action-setup@v3 33 with: 34 version: 9 35 run_install: false 36 37 - name: Get pnpm store directory 38 id: pnpm-store 39 run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" 40 41 - name: Use pnpm store 42 uses: actions/cache@v4 43 id: pnpm-cache 44 with: 45 path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }} 46 key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} 47 restore-keys: | 48 ${{ runner.os }}-pnpm- 49 50 - name: Install Dependencies 51 run: pnpm install --frozen-lockfile --prefer-offline 52 53 - name: PR or Publish 54 id: changesets 55 uses: changesets/action@v1.5.3 56 with: 57 version: pnpm changeset:version 58 publish: pnpm changeset:publish 59 env: 60 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 61 62 - name: Notify discord 63 id: discord-msg 64 if: steps.changesets.outputs.published == 'true' 65 uses: ./.github/actions/discord-message 66 with: 67 publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} 68 env: 69 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 70 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} 71 72 - name: Publish Prerelease 73 if: steps.changesets.outputs.published != 'true' 74 env: 75 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 76 run: | 77 git reset --hard origin/main 78 pnpm changeset version --no-git-tag --snapshot canary 79 pnpm changeset publish --no-git-tag --snapshot canary --tag canary