Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Switch from CircleCI -> local release process (#3054)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkillian authored and adidahiya committed Jul 19, 2017
1 parent b5cc207 commit c32bdc4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ Creating a new release

1. Bump the version number in `package.json` and `src/linter.ts`
2. Add release notes in `CHANGELOG.md`
3. `yarn verify` to build the latest sources from a clean state
4. Commit with message `Prepare release <version>`
5. Run `npm publish`
6. Create a git tag for the new release and push it ([see existing tags here](https://github.com/palantir/tslint/tags))
5. Push your branch to GitHub and make a PR
6. Once your PR is merged, wait for the tests to pass on CircleCI for develop
7. Create a "Release" on GitHub with the proper tag version and notes from the changelog.
The tag should be identical to the version in `package.json`
8. Run 'yarn run publish:local'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"lint": "npm-run-all -p lint:global lint:from-bin",
"lint:global": "tslint --project test/tsconfig.json --format stylish # test includes 'src' too",
"lint:from-bin": "node bin/tslint --project test/tsconfig.json --format stylish",
"publish:local": "./scripts/npmPublish.sh",
"test": "npm-run-all test:pre -p test:mocha test:rules",
"test:pre": "cd ./test/config && npm install --no-save",
"test:mocha": "mocha --reporter spec --colors \"build/test/**/*Tests.js\"",
Expand Down
28 changes: 23 additions & 5 deletions scripts/npmPublish.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
#!/usr/bin/env bash

cd $(dirname $0)/..
# Publishes TSLint to NPM based on the current version in package.json
# This script must be run with yarn: "yarn run publish:local"
# A user running this script must have Palantir NPM organization credentials

set -e

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
chmod 0600 .npmrc
rm -rf tempPublish
mkdir tempPublish

git clone [email protected]:palantir/tslint.git tempPublish
cd tempPublish
git checkout $npm_package_version

yarn install --pure-lockfile
yarn run verify

# courtesy of https://stackoverflow.com/a/3232082/3124288
read -r -p "Are you sure you want to publish version $npm_package_version? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
yarn publish --tag latest
else
echo "Publishing aborted"
fi

echo "Publishing..."
npm publish --tag $1
cd ..
rm -rf tempPublish

0 comments on commit c32bdc4

Please sign in to comment.