Bump the all-minor-patch group with 11 updates #7020
Workflow file for this run
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 | |
| pull_request: | |
| env: | |
| NODE_NO_WARNINGS: 1 | |
| CI: true | |
| jobs: | |
| dependencies: | |
| if: github.event_name == 'pull_request' && github.event.pull_request.title != 'Upcoming Release Changes' | |
| name: Dependencies | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-dependencies | |
| cancel-in-progress: true | |
| uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yml@v1 | |
| with: | |
| node-version-file: .node-version | |
| secrets: | |
| githubToken: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| snapshot-npm-tag: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| name: Choose snapshot NPM tag | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-snapshot-npm-tag | |
| cancel-in-progress: true | |
| outputs: | |
| value: ${{ steps.choose-tag.outputs.result }} | |
| steps: | |
| - name: Choose NPM Tag | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7 | |
| id: choose-tag | |
| with: | |
| result-encoding: string | |
| script: | | |
| const prBody = context.payload.pull_request.body || ''; | |
| // having #snapshot-npm-tag "next" in the PR body will set the npm tag to "next" | |
| const npmTagFromPrBody = prBody.match(/#snapshot-npm-tag\s+"([^"]+)"/)?.[1]; | |
| if (npmTagFromPrBody) { | |
| console.log(`Detected npm tag from PR body "${npmTagFromPrBody}"`); | |
| return npmTagFromPrBody; | |
| } | |
| const prTitle = context.payload.pull_request.title; | |
| const prAuthor = context.payload.pull_request.user.login; | |
| if (prAuthor === 'theguild-bot' && prTitle === 'Upcoming Release Changes') { | |
| console.log('Using "rc" tag for upcoming release'); | |
| return 'rc'; | |
| } | |
| console.log('Using "alpha" tag for snapshot release'); | |
| return 'alpha'; | |
| snapshot: | |
| needs: [snapshot-npm-tag] | |
| name: Snapshot | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-release-snapshot | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pull-requests: write | |
| uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@v1 | |
| with: | |
| node-version-file: .node-version | |
| npmTag: ${{ needs.snapshot-npm-tag.outputs.value }} | |
| restoreDeletedChangesets: ${{ github.event.pull_request.title == 'Upcoming Release Changes' && true || false }} | |
| secrets: | |
| githubToken: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| npmToken: ${{ secrets.NPM_TOKEN }} | |
| stable: | |
| if: github.ref == 'refs/heads/main' | |
| concurrency: ${{ github.workflow }}-${{ github.ref }}-release-stable | |
| name: Stable | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pull-requests: write | |
| uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@v1 | |
| with: | |
| node-version-file: .node-version | |
| releaseScript: changeset publish | |
| versionScript: changeset version | |
| secrets: | |
| githubToken: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| npmToken: ${{ secrets.NPM_TOKEN }} | |
| ghcr: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runtime: [Node, Bun] | |
| name: ${{ matrix.runtime }} Docker image | |
| needs: [stable, snapshot] | |
| if: always() && github.actor != 'dependabot[bot]' && ( | |
| contains(needs.stable.outputs.publishedPackages, '@graphql-hive/gateway') || | |
| contains(needs.snapshot.outputs.publishedPackages, '@graphql-hive/gateway') | |
| ) | |
| steps: | |
| - name: Version | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7 | |
| id: ver-gateway | |
| with: | |
| script: | | |
| const publishedPackages = ${{ needs.stable.outputs.publishedPackages || needs.snapshot.outputs.publishedPackages }}; | |
| const gateway = publishedPackages.find((p) => p.name === '@graphql-hive/gateway'); | |
| if (!gateway) { | |
| return core.setFailed('@graphql-hive/gateway was not published!'); | |
| } | |
| const { version } = gateway; | |
| let r; | |
| if (context.eventName === 'pull_request') { | |
| r = { version, tags: version }; | |
| } else { | |
| const [major, minor] = version.split('.'); | |
| if (!major || !minor) { | |
| return core.setFailed(`Unknown major or minor in version "${version}"!`); | |
| } | |
| r = { version, tags: `latest,${major},${major}.${minor},${version}` }; | |
| } | |
| console.log(r); | |
| return r; | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up env | |
| uses: the-guild-org/shared-config/setup@v1 | |
| with: | |
| node-version-file: .node-version | |
| - name: Build | |
| run: yarn build | |
| - name: Bundle | |
| run: yarn workspace @graphql-hive/gateway bundle | |
| - name: Inject version | |
| run: yarn workspace @graphql-hive/gateway tsx scripts/inject-version ${{ fromJSON(steps.ver-gateway.outputs.result).version }} | |
| - name: Bake and Push | |
| uses: docker/bake-action@3acf805d94d93a86cce4ca44798a76464a75b88c # v6 | |
| env: | |
| GATEWAY_TAGS: ${{ fromJSON(steps.ver-gateway.outputs.result).tags }} | |
| with: | |
| source: . | |
| targets: gateway${{ matrix.runtime == 'Bun' && '_bun' || '' }} | |
| set: | | |
| *.cache-from=type=gha | |
| *.cache-to=type=gha,mode=max | |
| push: true | |
| - if: github.event_name == 'pull_request' | |
| name: Comment on PR | |
| uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 | |
| with: | |
| # match pr comment like with changesets-snapshot-action from the guild's shared-config | |
| GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| header: snapshot-release-${{ matrix.runtime == 'Bun' && 'bun-' || '' }}docker-image | |
| message: | | |
| ### 🚀 Snapshot Release (${{matrix.runtime}} Docker Image) | |
| The latest changes of this PR are available as image on GitHub Container Registry (based on the declared `changesets`): | |
| ``` | |
| ghcr.io/graphql-hive/gateway:${{ fromJSON(steps.ver-gateway.outputs.result).version }}${{ matrix.runtime == 'Bun' && '-bun' || '' }} | |
| ``` | |
| bin: | |
| name: Binary built on ${{ matrix.os }} | |
| needs: [stable, snapshot] | |
| if: always() && ( | |
| contains(needs.stable.outputs.publishedPackages, '@graphql-hive/gateway') || | |
| contains(needs.snapshot.outputs.publishedPackages, '@graphql-hive/gateway') | |
| ) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| [ubuntu-latest, macos-13, macos-14, windows-latest, ubuntu-24.04-arm] | |
| steps: | |
| - name: Version | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7 | |
| id: ver-gateway | |
| with: | |
| result-encoding: string | |
| script: | | |
| const publishedPackages = ${{ needs.stable.outputs.publishedPackages || needs.snapshot.outputs.publishedPackages }}; | |
| const gateway = publishedPackages.find((p) => p.name === '@graphql-hive/gateway'); | |
| if (!gateway) { | |
| return core.setFailed('@graphql-hive/gateway was not published!'); | |
| } | |
| const { version } = gateway; | |
| console.log({ version }); | |
| return version; | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - if: runner.os == 'Windows' | |
| name: Install Windows SDK | |
| run: scripts\install-winsdk.ps1 | |
| - name: Set up env | |
| uses: the-guild-org/shared-config/setup@v1 | |
| with: | |
| node-version-file: .node-version | |
| # we skip-build on ubuntu arm because the "canvas" package wont build and there are no prebuilts | |
| install-command: ${{ matrix.os == 'ubuntu-24.04-arm' && 'yarn install --immutable --mode=skip-build' || '' }} | |
| - name: Build | |
| run: yarn build | |
| - name: Bundle | |
| run: yarn workspace @graphql-hive/gateway bundle | |
| - name: Inject version | |
| run: yarn workspace @graphql-hive/gateway tsx scripts/inject-version "${{ steps.ver-gateway.outputs.result }}" | |
| - name: Package binary | |
| run: yarn workspace @graphql-hive/gateway tsx scripts/package-binary | |
| - name: Set binary info | |
| id: binary | |
| run: | | |
| echo "name=hive-gateway-${{ runner.os }}-${{ runner.arch }}${{ runner.os == 'Windows' && '.exe' || ''}}" >> ${{ runner.os == 'Windows' && '$ENV:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} | |
| echo "path=packages/gateway/hive-gateway${{ runner.os == 'Windows' && '.exe' || '' }}" >> ${{ runner.os == 'Windows' && '$ENV:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} | |
| - if: github.ref == 'refs/heads/main' | |
| name: Compress binary | |
| id: compressed-binary | |
| run: | | |
| gzip -9 ${{ steps.binary.outputs.path }} | |
| echo "name=${{ steps.binary.outputs.name }}.gz" >> ${{ runner.os == 'Windows' && '$ENV:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} | |
| echo "path=${{ steps.binary.outputs.path }}.gz" >> ${{ runner.os == 'Windows' && '$ENV:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }} | |
| - if: github.ref == 'refs/heads/main' | |
| name: Upload release | |
| uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2 | |
| with: | |
| repo_token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| tag: hive-gateway@${{ steps.ver-gateway.outputs.result }} | |
| release_name: hive-gateway@${{ steps.ver-gateway.outputs.result }} | |
| asset_name: ${{ steps.compressed-binary.outputs.name }} | |
| file: ${{ steps.compressed-binary.outputs.path }} | |
| body: Pre-built binaries of the Hive Gateway for the **@graphql-hive/gateway@${{ steps.ver-gateway.outputs.result }}** release. | |
| overwrite: true | |
| - if: github.event_name == 'pull_request' | |
| name: Upload artifact | |
| id: upload | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v4 | |
| with: | |
| name: ${{ steps.binary.outputs.name }} | |
| path: ${{ steps.binary.outputs.path }} | |
| - if: github.event_name == 'pull_request' | |
| name: Comment on PR | |
| uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 | |
| with: | |
| # match pr comment like with changesets-snapshot-action from the guild's shared-config | |
| GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
| header: snapshot-release-binary-${{ runner.os }}-${{ runner.arch }} | |
| message: | | |
| ### 🚀 Snapshot Release (Binary for `${{ runner.os }}-${{ runner.arch }}`) | |
| The latest changes of this PR are available for download (based on the declared `changesets`). | |
| [](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload.outputs.artifact-id }}) | |
| examples: | |
| name: Examples | |
| needs: [stable, snapshot] | |
| if: always() && (github.event.pull_request.title != 'Upcoming Release Changes') && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'graphql-hive/gateway' || github.ref == 'refs/heads/main') | |
| uses: graphql-hive/gateway/.github/workflows/examples.yml@main | |
| # NOTE: it's possible to use snapshot releases in examples on PRs but we dont because | |
| # want the main branch to always use examples of stable releases. yeah sure, the examples | |
| # workflow will open a PR to update the examples to stable ones - but there will be some window | |
| # during which the examples on main will use snapshots and we want to avoid that | |
| # with: | |
| # publishedPackages: ${{needs.stable.outputs.publishedPackages || needs.snapshot.outputs.publishedPackages}} | |
| secrets: | |
| token: ${{secrets.BOT_GITHUB_TOKEN}} |