Skip to content

Commit

Permalink
introduce changesets to manage release and canary flows (#2008)
Browse files Browse the repository at this point in the history
* introduce changesets

* adjust versioning
  • Loading branch information
dotansimha committed Sep 29, 2020
1 parent dee550e commit 533d6d5
Show file tree
Hide file tree
Showing 38 changed files with 1,100 additions and 309 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
12 changes: 12 additions & 0 deletions .changeset/config.json
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [
"@graphql-tools/website"
]
}
33 changes: 33 additions & 0 deletions .changeset/yellow-camels-nail.md
@@ -0,0 +1,33 @@
---
'@graphql-tools/batch-delegate': patch
'@graphql-tools/delegate': patch
'@graphql-tools/graphql-tag-pluck': patch
'graphql-tools': patch
'@graphql-tools/links': patch
'@graphql-tools/load': patch
'@graphql-tools/apollo-engine-loader': patch
'@graphql-tools/code-file-loader': patch
'@graphql-tools/git-loader': patch
'@graphql-tools/github-loader': patch
'@graphql-tools/graphql-file-loader': patch
'@graphql-tools/json-file-loader': patch
'@graphql-tools/module-loader': patch
'@graphql-tools/prisma-loader': patch
'@graphql-tools/url-loader': patch
'@graphql-tools/merge': patch
'@graphql-tools/mock': patch
'@graphql-tools/node-require': patch
'@graphql-tools/relay-operation-optimizer': patch
'@graphql-tools/resolvers-composition': patch
'@graphql-tools/schema': patch
'@graphql-tools/stitch': patch
'@graphql-tools/webpack-loader': patch
'@graphql-tools/wrap': patch
'@graphql-tools/import': patch
'@graphql-tools/load-files': patch
'@graphql-tools/utils': patch
'@graphql-tools/webpack-loader-runtime': patch
'@graphql-tools/website': patch
---

Bump all packages to allow adjustments
38 changes: 0 additions & 38 deletions .github/release-drafter.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/automerge.yml

This file was deleted.

24 changes: 15 additions & 9 deletions .github/workflows/canary.yml
Expand Up @@ -31,26 +31,32 @@ jobs:
${{ runner.os }}-14-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install && git checkout yarn.lock
- name: Build
run: yarn build

- name: Release Canary
id: canary
uses: 'kamilkisiela/release-canary@master'
if: github.repository == 'ardatan/graphql-tools'
with:
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-script: 'release:canary'
npm-script: 'yarn release:canary'
changesets: true
- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are available as alpha in npm: `${{ steps.canary.outputs.version }}`
Quickly update your package.json by running:
The latest changes of this PR are available as alpha in npm (based on the declared `changesets`):
npx match-version @graphql-tools ${{ steps.canary.outputs.version }}
```
${{ steps.canary.outputs.changesetsPublishedPackages}}
```
bot-token: ${{ secrets.GH_API_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish a empty message
if: steps.canary.outputs.released == 'false'
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are not available as alpha, since there are no linked `changesets` for this PR.
bot-token: ${{ secrets.GH_API_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Expand Up @@ -42,15 +42,13 @@ jobs:
run: yarn install && git checkout yarn.lock
- name: Build
run: yarn build
- name: Publish to NPM
run: npm run release
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Commit updated package.json files
run: |
git add .
git commit -m "${{ github.event.release.tag_name }}"
- name: Push all the changes
uses: ad-m/github-push-action@master
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish: yarn release
commit: 'chore(release): update monorepo packages versions'
title: 'Upcoming Release Changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
11 changes: 8 additions & 3 deletions package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Useful tools to create and manipulate GraphQL schemas.",
"private": true,
"scripts": {
"postinstall": "patch-package",
"predeploy:website": "yarn build:api-docs",
"deploy:website": "cd website && yarn deploy",
"ts:transpile": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.es5.json",
Expand All @@ -14,8 +15,10 @@
"prettier:check": "prettier --ignore-path .gitignore --check \"**/*.{ts,tsx,graphql,yml}\"",
"test": "jest --no-watchman --forceExit",
"test-and-build": "yarn build && yarn test",
"release": "node scripts/release.js",
"release:canary": "node scripts/release.js --canary"
"prerelease": "yarn build",
"prerelease-canary": "yarn build",
"release": "changeset publish",
"release:canary": "(node scripts/canary-release.js && yarn build && yarn changeset publish --tag alpha) || echo Skipping Canary..."
},
"repository": {
"type": "git",
Expand All @@ -39,6 +42,8 @@
"graphql": "^14.0.0 || ^15.0.0"
},
"devDependencies": {
"patch-package": "^6.2.2",
"@changesets/cli": "2.10.2",
"@types/fs-extra": "9.0.1",
"@types/jest": "26.0.14",
"@types/node": "14.11.2",
Expand Down Expand Up @@ -85,4 +90,4 @@
"resolutions": {
"graphql": "15.3.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/batch-delegate/package.json
Expand Up @@ -18,7 +18,7 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/delegate": "6.2.3",
"@graphql-tools/delegate": "^6.2.3",
"dataloader": "2.0.0",
"tslib": "~2.0.1"
},
Expand All @@ -31,4 +31,4 @@
"access": "public",
"directory": "dist"
}
}
}
6 changes: 3 additions & 3 deletions packages/delegate/package.json
Expand Up @@ -18,8 +18,8 @@
"input": "./src/index.ts"
},
"dependencies": {
"@graphql-tools/schema": "6.2.3",
"@graphql-tools/utils": "6.2.3",
"@graphql-tools/schema": "^6.2.3",
"@graphql-tools/utils": "^6.2.3",
"@ardatan/aggregate-error": "0.0.6",
"dataloader": "2.0.0",
"is-promise": "4.0.0",
Expand All @@ -29,4 +29,4 @@
"access": "public",
"directory": "dist"
}
}
}
4 changes: 2 additions & 2 deletions packages/graphql-tag-pluck/package.json
Expand Up @@ -18,7 +18,7 @@
"@babel/parser": "7.11.5",
"@babel/traverse": "7.11.5",
"@babel/types": "7.11.5",
"@graphql-tools/utils": "6.2.3",
"@graphql-tools/utils": "^6.2.3",
"tslib": "~2.0.1"
},
"optionalDependencies": {
Expand All @@ -32,4 +32,4 @@
"access": "public",
"directory": "dist"
}
}
}
46 changes: 23 additions & 23 deletions packages/graphql-tools/package.json
Expand Up @@ -19,28 +19,28 @@
"directory": "dist"
},
"dependencies": {
"@graphql-tools/batch-delegate": "6.2.3",
"@graphql-tools/delegate": "6.2.3",
"@graphql-tools/graphql-tag-pluck": "6.2.3",
"@graphql-tools/import": "6.2.3",
"@graphql-tools/links": "6.2.3",
"@graphql-tools/load": "6.2.3",
"@graphql-tools/code-file-loader": "6.2.3",
"@graphql-tools/git-loader": "6.2.3",
"@graphql-tools/github-loader": "6.2.3",
"@graphql-tools/graphql-file-loader": "6.2.3",
"@graphql-tools/json-file-loader": "6.2.3",
"@graphql-tools/module-loader": "6.2.3",
"@graphql-tools/url-loader": "6.2.3",
"@graphql-tools/load-files": "6.2.3",
"@graphql-tools/merge": "6.2.3",
"@graphql-tools/mock": "6.2.3",
"@graphql-tools/relay-operation-optimizer": "6.2.3",
"@graphql-tools/resolvers-composition": "6.2.3",
"@graphql-tools/schema": "6.2.3",
"@graphql-tools/stitch": "6.2.3",
"@graphql-tools/utils": "6.2.3",
"@graphql-tools/wrap": "6.2.3",
"@graphql-tools/batch-delegate": "^6.2.3",
"@graphql-tools/delegate": "^6.2.3",
"@graphql-tools/graphql-tag-pluck": "^6.2.3",
"@graphql-tools/import": "^6.2.3",
"@graphql-tools/links": "^6.2.3",
"@graphql-tools/load": "^6.2.3",
"@graphql-tools/code-file-loader": "^6.2.3",
"@graphql-tools/git-loader": "^6.2.3",
"@graphql-tools/github-loader": "^6.2.3",
"@graphql-tools/graphql-file-loader": "^6.2.3",
"@graphql-tools/json-file-loader": "^6.2.3",
"@graphql-tools/module-loader": "^6.2.3",
"@graphql-tools/url-loader": "^6.2.3",
"@graphql-tools/load-files": "^6.2.3",
"@graphql-tools/merge": "^6.2.3",
"@graphql-tools/mock": "^6.2.3",
"@graphql-tools/relay-operation-optimizer": "^6.2.3",
"@graphql-tools/resolvers-composition": "^6.2.3",
"@graphql-tools/schema": "^6.2.3",
"@graphql-tools/stitch": "^6.2.3",
"@graphql-tools/utils": "^6.2.3",
"@graphql-tools/wrap": "^6.2.3",
"tslib": "~2.0.1"
}
}
}
4 changes: 2 additions & 2 deletions packages/links/package.json
Expand Up @@ -23,7 +23,7 @@
"graphql-upload": "11.0.0"
},
"dependencies": {
"@graphql-tools/utils": "6.2.3",
"@graphql-tools/utils": "^6.2.3",
"apollo-link": "1.2.14",
"apollo-upload-client": "14.1.2",
"cross-fetch": "3.0.6",
Expand All @@ -35,4 +35,4 @@
"access": "public",
"directory": "dist"
}
}
}
6 changes: 3 additions & 3 deletions packages/load/package.json
Expand Up @@ -22,8 +22,8 @@
"graphql-type-json": "0.3.2"
},
"dependencies": {
"@graphql-tools/utils": "6.2.3",
"@graphql-tools/merge": "6.2.3",
"@graphql-tools/utils": "^6.2.3",
"@graphql-tools/merge": "^6.2.3",
"globby": "11.0.1",
"import-from": "3.0.0",
"is-glob": "4.0.1",
Expand All @@ -36,4 +36,4 @@
"access": "public",
"directory": "dist"
}
}
}

0 comments on commit 533d6d5

Please sign in to comment.