-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: setup canary releases using changesets #3466
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Canary Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
NODE_VERSION_USED_FOR_DEVELOPMENT: 17 | ||
jobs: | ||
publish-canary: | ||
name: Publish Canary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Main | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
cache: npm | ||
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }} | ||
|
||
- name: Install Dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Setup NPM credentials | ||
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not ok with putting NPM token on FS, it means all subsequent scripts have access to it. |
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | ||
|
||
- name: Release Canary | ||
id: canary | ||
uses: 'kamilkisiela/release-canary@master' | ||
with: | ||
npm-token: ${{ secrets.NODE_AUTH_TOKEN }} | ||
npm-script: 'npm run release:canary' | ||
changesets: true | ||
|
||
- name: Publish a message | ||
if: steps.canary.outputs.released | ||
uses: 'kamilkisiela/pr-comment@master' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This custom guild stuff, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can make it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how it's different from https://github.com/graphql/graphql-js/blob/main/resources/build-deno.js vs |
||
with: | ||
message: | | ||
The latest changes of this PR are available as alpha in npm (based on the declared `changesets`): | ||
``` | ||
${{ steps.canary.outputs.changesetsPublishedPackages}} | ||
``` | ||
bot-token: ${{ secrets.GH_API_TOKEN }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can use |
||
bot: 'theguild-bot' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think you can use |
||
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 }} |
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.
I guess we need the 2nd workflow for release? this way we can release using
changeset
as well. What do you think @IvanGoncharov ?(Changesets collects all changeset files and keep an updated Release PR, so when it's merged, you get the actual version bump and NPM release)
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.
We discuss canary release so let's address that and see how it goes.