Skip to content

Commit

Permalink
Add changesets (#4154)
Browse files Browse the repository at this point in the history
* add first changesets integration

* remove readme

* readd readme

* update auto-release workflow logic

* update auto-release script order, fix prettier

* change access to public

* update release script

* try to fix changesets

* add experimental snapshot version config

* try fixing

* remove excess

* switch auto-release branch to master

* add release pull request workflow

* add changeset todo to pr template

* update changeset
  • Loading branch information
ianstormtaylor authored Mar 31, 2021
1 parent a8187e2 commit 7283c51
Show file tree
Hide file tree
Showing 9 changed files with 856 additions and 29 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
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/master/docs/common-questions.md)
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [["slate", "slate-history", "slate-hyperscript", "slate-react"]],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"useCalculatedVersionForSnapshots": true
}
}
8 changes: 8 additions & 0 deletions .changeset/lovely-rats-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'slate': patch
'slate-history': patch
'slate-hyperscript': patch
'slate-react': patch
---

**Start using [🦋 Changesets](https://github.com/atlassian/changesets) to manage releases.** Going forward, whenever a pull request is made that fixes or adds functionality to Slate, it will need to be accompanied by a changset Markdown file describing the change. These files will be automatically used in the release process when bump the versions of Slate and compiling the changelog.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ If your change is non-trivial, please include a description of how the new logic
- [ ] The tests pass with `yarn test`.
- [ ] The linter passes with `yarn lint`. (Fix errors with `yarn fix`.)
- [ ] The relevant examples still work. (Run examples with `yarn start`.)
- [ ] You've [added a changeset](https://github.com/atlassian/changesets/blob/master/docs/adding-a-changeset.md) if changing functionality. (Add one with `yarn changeset add`.)

36 changes: 36 additions & 0 deletions .github/workflows/auto-release-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto-release @dev

on:
push:
branches:
- master

jobs:
release:
name: Auto-release @dev
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@master
with:
node-version: 12.x
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn

- name: Prepare release
run: yarn prerelease

- name: Release to @dev channel
run: |
yarn changeset version --snapshot
yarn changeset publish --tag dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/create-release-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create release PR

on:
push:
branches:
- master

jobs:
release:
name: Create release PR
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@master
with:
node-version: 12.x
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn

- name: Prepare release
run: yarn prerelease

# https://github.com/changesets/action
- name: Create release pull request
uses: changesets/action@master
with:
publish: yarn changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"release:latest": "yarn prerelease && lerna publish --force-publish",
"release:next": "yarn prerelease && lerna publish --dist-tag next --force-publish",
"release:experimental": "yarn prerelease && lerna publish --dist-tag experimental",
"internal:release:next": "yarn prerelease && lerna publish --dist-tag next --force-publish --conventional-commits --yes",
"internal:release:next": "yarn prerelease && yarn changeset publish --tag next",
"serve": "cd ./site && next",
"start": "npm-run-all --parallel --print-label watch serve",
"test": "mocha --require ./config/babel/register.cjs ./packages/*/test/index.js",
Expand All @@ -45,6 +45,7 @@
"@babel/preset-typescript": "^7.7.4",
"@babel/register": "^7.7.4",
"@babel/runtime": "^7.7.4",
"@changesets/cli": "^2.14.1",
"@types/lodash": "^4.14.149",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.14",
Expand Down
Loading

0 comments on commit 7283c51

Please sign in to comment.