Skip to content

Commit

Permalink
Automate releases with changesets (#2510)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel K <daniel@lovemyvoice.app>
  • Loading branch information
FredyC and Daniel K committed Oct 13, 2020
1 parent 903c782 commit 8e67484
Show file tree
Hide file tree
Showing 11 changed files with 845 additions and 273 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)
6 changes: 6 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"changelog": ["@changesets/changelog-github", { "repo": "mobxjs/mobx" }],
"commit": false,
"access": "public",
"baseBranch": "mobx6"
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question-discussion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ labels: question

We are open to your questions or discussion, but keep in mind it might take a while for us to respond. For a faster response, you can try the following channels.

- MobX Spectrum community: https://spectrum.chat/mobx
- GitHub discussions: https://github.com/mobxjs/mobx/discussions
- StackOverflow (`mobx` tag): https://stackoverflow.com/questions/tagged/mobx
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
### Code change checklist

- [ ] Added/updated unit tests
- [ ] Updated changelog
- [ ] Updated `/docs`. For new functionality, at least `API.md` should be updated
- [ ] Verified that there is no significant performance drop (`npm run perf`)

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
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.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
commit: Version release
title: Next release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
website/**/*
dist/
docs/assets/
*.yml
224 changes: 112 additions & 112 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

_Simple, scalable state management._

[![Discuss on Github](https://img.shields.io/badge/discuss%20on-GitHub-orange)](https://github.com/mobxjs/mobx/discussions)
[![npm version](https://badge.fury.io/js/mobx.svg)](https://badge.fury.io/js/mobx)
[![OpenCollective](https://opencollective.com/mobx/backers/badge.svg)](docs/backers-sponsors.md#backers)
[![OpenCollective](https://opencollective.com/mobx/sponsors/badge.svg)](docs/backers-sponsors.md#sponsors)

[![Discuss on Github](https://img.shields.io/badge/discuss%20on-GitHub-orange)](https://github.com/mobxjs/mobx/discussions)
[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/mobx)

---

MobX is made possible by the generosity of the sponsors below, and many other [individual backers](docs/backers-sponsors.md#backers). Sponsoring directly impacts the longevity of this project.
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"prebuild": "rimraf lib",
"build": "tsdx build --name mobx --format esm,cjs,umd",
"postbuild": "cp flow-typed/mobx.js dist/index.js.flow",
"release": "node scripts/publish.js",
"release": "yarn build && yarn changeset publish",
"publish-script": "yarn release",
"docs:build": "yarn --cwd website build",
"docs:start": "yarn --cwd website start",
Expand Down Expand Up @@ -65,6 +65,8 @@
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
"@babel/runtime": "^7.9.2",
"@changesets/changelog-github": "^0.2.7",
"@changesets/cli": "^2.11.0",
"@types/jest": "^25.2.1",
"@types/node": "^11.15.12",
"@typescript-eslint/eslint-plugin": "^2.29.0",
Expand Down Expand Up @@ -140,4 +142,4 @@
"pre-commit": "pretty-quick --staged"
}
}
}
}
139 changes: 0 additions & 139 deletions scripts/publish.js

This file was deleted.

Loading

0 comments on commit 8e67484

Please sign in to comment.