Multiple Apollo instances implementation #278
This file contains 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: Snapshot Release | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
if: | | |
github.repository == 'apollographql/apollo-client-nextjs' && | |
github.event.issue.pull_request && | |
( | |
github.event.sender.login == 'benjamn' || | |
github.event.sender.login == 'alessbell' || | |
github.event.sender.login == 'bignimbus' || | |
github.event.sender.login == 'hwillson' || | |
github.event.sender.login == 'jerelmiller' || | |
github.event.sender.login == 'phryneas' | |
) && | |
startsWith(github.event.comment.body, '/release:pr') | |
steps: | |
- uses: alessbell/[email protected] | |
id: comment-branch | |
- name: Checkout head ref | |
uses: actions/checkout@v3 | |
with: | |
## specify the owner + repository in order to checkout the fork | |
## for community PRs | |
repository: ${{ steps.comment-branch.outputs.head_owner }}/${{ steps.comment-branch.outputs.head_repo }} | |
ref: ${{ steps.comment-branch.outputs.head_ref }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
cache: "yarn" | |
- run: yarn install --immutable | |
- run: yarn workspace @apollo/experimental-nextjs-app-support version "0.0.0-commit-$(git rev-parse --short HEAD)" | |
- run: yarn workspace @apollo/experimental-nextjs-app-support exec npm publish --access public --tag snapshot --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Get released version | |
id: get-version | |
run: yarn workspace @apollo/experimental-nextjs-app-support exec jq --raw-output '("version="+.version)' package.json >> "$GITHUB_OUTPUT" | |
- name: Create comment | |
uses: peter-evans/[email protected] | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
A new release has been made for this PR. You can install it with `npm i @apollo/experimental-nextjs-app-support@${{ steps.get-version.outputs.version }}`. |