-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): Add release automation
Add publish script and process documentation. Add npm script to publish to npm. Update `build:dist` to use cross-env library. Updates npmignore to clean up deployment package.
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
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 |
---|---|---|
@@ -1,2 +1,13 @@ | ||
example/ | ||
example | ||
scripts | ||
src | ||
test | ||
.github | ||
.gitattributes | ||
.babelrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.travis.yml | ||
CONTRIBUTING.md | ||
webpack.config.babel.js |
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,16 @@ | ||
###Tag and Release process | ||
|
||
> Starting from a state where everything is in master that we want released. | ||
*The GitHub Portion* | ||
* Increment the version in the package.json and save. | ||
* Generate the changelog for the new release version `npm run generate.changelog`. | ||
* Run `git add .` to stage the changes. | ||
* Commit changelog & package version updates as `chore(release): karma-webpack <package version>`. | ||
* Run `git push` to send the changes to origin. | ||
* Run `git tag <package version>` to create our release tag. | ||
* Run `git push --tags` to send the tag to origin. | ||
|
||
*The NPM Portion* | ||
* `npm login` to the user with rights to publish to NPM | ||
* `npm run publish.version` which executes a `dist` build and publishes using the tag created above. |
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,27 @@ | ||
#!/usr/bin/env bash | ||
# Accepts a single argument as the tag for the release (such as "next"). | ||
# Run this script from the root of the repo. | ||
|
||
# `npm whoami` errors and dies if you're not logged in, | ||
# so we redirect the stderr output to /dev/null since we don't care. | ||
NPM_USER=$(npm whoami 2> /dev/null) | ||
|
||
if [ "${NPM_USER}" != "mikaak" ]; then | ||
echo "Publishing limited to 'mikaak'. Did you forget to 'npm login'." | ||
exit | ||
fi | ||
|
||
# Defaults to latest github tag | ||
NPM_TAG="latest" | ||
if [ "$1" ] ; then | ||
NPM_TAG=${1} | ||
fi | ||
|
||
# Sets the above | ||
set -ex | ||
|
||
# Publishing the defined tag to npm | ||
npm publish --access public --tag ${NPM_TAG} | ||
|
||
# Logs out of npm when publish is complete. | ||
npm logout |