Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(release-automation): fix issues uncovered by 1st release #80

Merged
merged 2 commits into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@
"tslib": "^1.7.1"
},
"lint-staged": {
"*.ts": [
"prettier --write --parser typescript",
"tslint",
"git add"
]
"*.ts": ["prettier --write --parser typescript", "tslint", "git add"]
},
"scripts": {
"build": "lerna run build",
Expand All @@ -94,6 +90,7 @@
"precommit": "lint-staged",
"bootstrap": "lerna bootstrap",
"postinstall": "npm run bootstrap",
"prerelease:prepare": "lerna bootstrap && npm test",
"release:prepare": "lerna publish --skip-git --skip-npm --yes && node ./support/changelog.js",
"release:review": "git --no-pager diff --word-diff",
"release:publish": "./support/publish.sh",
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"prebuild": "rimraf dist",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../rollup.config.umd.js",
"build:node": "tsc --module commonjs --outDir ./dist/node"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-common-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"author": "",
"license": "Apache-2.0",
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:esm",
"build:esm": "tsc --module es2015 --outDir ./dist/esm --sourceMap --declaration --declarationDir ./dist/types",
"postbuild": "rimraf dist/esm"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-geocoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc -p ./tsconfig.json --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../rollup.config.umd.js",
"build:node": "tsc -p ./tsconfig.json --module commonjs --outDir ./dist/node"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-groups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc -p ./tsconfig.json --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../rollup.config.umd.js",
"build:node": "tsc -p ./tsconfig.json --module commonjs --outDir ./dist/node"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-items/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc -p ./tsconfig.json --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../rollup.config.umd.js",
"build:node": "tsc -p ./tsconfig.json --module commonjs --outDir ./dist/node"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
4 changes: 3 additions & 1 deletion packages/arcgis-rest-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"tslib": "^1.7.1"
},
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../rollup.config.umd.js",
"build:node": "tsc --module commonjs --outDir ./dist/node"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Esri/arcgis-rest-js.git"
Expand Down
16 changes: 10 additions & 6 deletions support/publish.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
#!/bin/bash

# Extract the version from lerna.json (this was updated by `npm run release:prepare`)
VERSION=$(node --eval "console.log(require('./lerna.json').version);")
TEMP_FOLDER=arcgis-rest-js-v$VERSION;

# commit the changes from npm run release:prepare
# incriment the package.json version to the lerna version so gh-release works
npm version $VERSION --allow-same-version

# commit the changes from `npm run release:prepare` and our new package.json version
git add --all
git commit -am "Prepare v$VERSION" --no-verify

# incriment the package.json version to the lerna version so gh-release works
npm version $VERSION

# push the changes and tag to github
git push https://github.com/Esri/arcgis-rest-js.git master
git push --tags

# publish each package on npm
lerna exec -- npm publish
lerna publish --skip-git --yes --repo-version $VERSION

# create a ZIP archive of the dist files
TEMP_FOLDER=arcgis-rest-js-v$VERSION;
mkdir $TEMP_FOLDER
cp packages/*/dist/umd/* $TEMP_FOLDER
zip -r $TEMP_FOLDER.zip $TEMP_FOLDER
rm -rf $TEMP_FOLDER

# Run gh-release to create a new release with our changelog changes and ZIP archive
gh-release --t v$VERSION --repo arcgis-rest-js --owner Esri -a $TEMP_FOLDER.zip

# Delete the ZIP archive
rm $TEMP_FOLDER.zip