Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,30 @@

- There are some suggested VSCode extensions in `.vscode/extensions.json` and additional docs at [docs/vscode.md](docs/vscode.md).

## Deployments
## Commits and Deployments

Circle CI is set up to publish reaction-force in a consistent and reliable way. To update the package version and deploy it on NPM.
Circle CI is set up to publish releases to NPM automatically via [semantic-release](https://github.com/semantic-release/semantic-release) following every successful merge to master.

$ npm version <new_version>
$ git push --follow-tags
Release versions (major, minor, patch) are triggered [by commit messages](https://github.com/semantic-release/semantic-release#commit-message-format), when they adhere to [Ember conventions](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-ember/readme.md):

The package.json file will be updated and a commit staged. When a tag is pushed to `master`, Circle CI will publish to NPM. See [circle.yml](https://circleci.com/docs/1.0/npm-continuous-deployment/) and the [npm docs](https://docs.npmjs.com/getting-started/publishing-npm-packages).
```
[TAG context] commit message
```

[Valid tags](https://github.com/artsy/reaction/blob/master/package.json#L175) for release include PATCH, DOC, FIX (patch), FEATURE (minor), and BREAKING (major). Commits that do not adhere to this convention will not trigger an NPM release.

##### Example Patch Release
```
[FIX onboarding] Modal does not open
[PATCH] Bump version
```

##### Example Minor (Feature) Release
```
[FEATURE auctions] Add relay-based slider component
```

##### Example Major (Breaking) Release
```
[BREAKING publishing] Replace children with props for caption editing
```
8 changes: 3 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ test:
- yarn test -- --runInBand

deployment:
release:
branch: master
- yarn run semantic-release
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is some legacy stuff around here that relates to legacy deployment process. Once we've verified that this works we should make sure to remove that and update README.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure!

demo:
branch: master
commands:
- cp .env.oss .env
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artsy/reaction-force",
"version": "0.23.1",
"version": "0.0.0-development",
Copy link
Copy Markdown
Contributor

@damassi damassi Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this account for existing packages that have already been published to NPM? Does it determine from there that the current release is 0.23.1 and update accordingly?

Copy link
Copy Markdown
Contributor Author

@eessex eessex Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should fetch the version number from the existing package on npm. This version number is a placeholder and will always read 0.0.0.

Copy link
Copy Markdown
Contributor Author

@eessex eessex Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging, the build on Circle will log which commits trigger changes, as well as the new version number.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, just wanted to double check 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also wanted to note it looks like this version number is being overwritten when I push a commit, but don't see where this is being set.

"description": "Force’s React Components",
"main": "dist/index.js",
"repository": "https://github.com/artsy/reaction.git",
Expand Down Expand Up @@ -42,7 +42,8 @@
"test": "node verify-node-version.js && jest",
"test:watch": "jest --watch --runInBand",
"type-check": "tsc --noEmit --pretty",
"watch": "gulp watch"
"watch": "gulp watch",
"semantic-release": "semantic-release"
},
"resolutions": {
"graphql": "^0.12.3",
Expand Down Expand Up @@ -79,6 +80,7 @@
"babel-types": "^6.2.0",
"cache-loader": "^1.2.0",
"concurrently": "^3.5.0",
"conventional-changelog-ember": "^0.3.4",
"dotenv": "^4.0.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
Expand Down Expand Up @@ -107,6 +109,7 @@
"react-test-renderer": "^16.0.0",
"relay-compiler": "https://github.com/alloy/relay/releases/download/v1.5.0-artsy.3/relay-compiler-1.5.0-artsy.3.tgz",
"relay-compiler-language-typescript": "^0.9.0",
"semantic-release": "^12.4.1",
"styled-components": "^3.1.5",
"ts-loader": "^3.5.0",
"tslint": "^4.5.0",
Expand Down Expand Up @@ -178,5 +181,17 @@
"*.json": [
"npm run prettier-write --"
]
},
"release": {
"analyzeCommits": {
"preset": "ember",
"releaseRules": [
{"tag": "DOC", "release": "patch"},
{"tag": "FIX", "release": "patch"},
{"tag": "PATCH", "release": "patch"},
{"tag": "FEATURE", "release": "minor"},
{"tag": "BREAKING", "release": "major"}
]
}
}
}
Loading