-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Changesets #10337
Merged
Merged
Introduce Changesets #10337
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/main/docs/common-questions.md) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ "repo": "apollographql/apollo-client" } | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Exit Prerelease Mode | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Exit prerelease mode on release branch" | ||
type: string | ||
default: "release-" | ||
required: true | ||
|
||
jobs: | ||
deploy: | ||
name: Changesets Exit Prerelease | ||
runs-on: ubuntu-latest | ||
# Allow GITHUB_TOKEN to have write permissions | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Checkout release branch entered when workflow was kicked off | ||
ref: ${{ github.event.inputs.branch }} | ||
# Fetch entire git history so Changesets can generate changelogs | ||
# with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Get latest tagged version | ||
id: previoustag | ||
uses: WyriHaximus/github-action-get-previous-tag@v1 | ||
|
||
- name: Remove 'v' prefix from version number (e.g. v1.0.0) | ||
uses: mad9000/actions-find-and-replace-string@1 | ||
id: formatversion | ||
with: | ||
source: ${{ steps.previoustag.outputs.tag }} | ||
find: "v" | ||
replace: "" | ||
|
||
- name: Write previous version to package.json | ||
uses: jaywcjlove/github-action-package@v1.3.0 | ||
with: | ||
version: ${{ steps.formatversion.outputs.value }} | ||
|
||
- name: Remove pre.json | ||
run: npx rimraf .changeset/pre.json | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Exit prerelease mode | ||
# Commit these changes to the branch workflow is running against | ||
branch: ${{ github.event.inputs.branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Prerelease | ||
|
||
on: | ||
push: | ||
branches: | ||
# Target release-x.x branches | ||
- "release-*" | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
prerelease: | ||
name: Changesets Prerelease | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Fetch entire git history so Changesets can generate changelogs | ||
# with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Append NPM token to .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install dependencies with cache | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Enter prerelease mode | ||
# if .changeset/pre.json does not exist and we did not recently exit | ||
# prerelease mode, enter prerelease mode with tag alpha | ||
run: | | ||
[ ! -f .changeset/pre.json && !contains(github.event.head_commit.message, 'Exit prerelease') ] \ | ||
&& npx changeset pre enter alpha \ | ||
|| echo 'Already in pre mode or recently exited' | ||
|
||
- name: Create release PR | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: npm run changeset-version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish alpha to npm | ||
if: "! test -f .changeset/pre.json" | ||
run: npm run changeset-publish | ||
|
||
# - name: Send a Slack notification on Publish | ||
# if: steps.changesets.outputs.published == 'true' | ||
# run: echo "Send message to Slack" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
name: Changesets Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Fetch entire git history so Changesets can generate changelogs | ||
# with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Append NPM token to .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install dependencies (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Create release PR or publish to npm + GitHub | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: npm run changeset-version | ||
publish: npm run changeset-publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# - name: Send a Slack notification on Publish | ||
# if: steps.changesets.outputs.published == 'true' | ||
# run: echo "Send message to Slack" |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken from https://github.com/apollographql/apollo-server/blob/6b4674dd80747a6a5f13ca9f4ca9ed5b0ee77813/.circleci/config.yml#L89 :)
An example of a PR with a failing changesets check: apollographql/apollo-server#7229