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 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
3,725 changes: 2,335 additions & 1,390 deletions package-lock.json

Large diffs are not rendered by default.

65 changes: 31 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,67 @@
"description": "Compact, modular JavaScript wrappers for the ArcGIS REST API that run in Node.js and modern browsers.",
"devDependencies": {
"@types/es6-promise": "0.0.32",
"@types/fetch-mock": "^5.8.3",
"@types/fetch-mock": "^5.12.2",
"@types/isomorphic-fetch": "0.0.34",
"@types/jasmine": "^2.5.53",
"@types/node": "^6.0.82",
"@types/jasmine": "^2.8.2",
"@types/node": "^6.0.95",
"acetate": "github:patrickarlt/acetate#acetate-2",
"acetate-cli": "^1.0.1",
"changelog-parser": "^2.0.5",
"changelog-parser": "^2.1.0",
"cheerio": "^1.0.0-rc.2",
"commitizen": "^2.9.6",
"concurrently": "^3.5.0",
"concurrently": "^3.5.1",
"cpx": "^1.5.0",
"cross-spawn": "^5.1.0",
"cz-lerna-changelog": "github:patrickarlt/cz-lerna-changelog#3fe7650a2e2e624b1f46e5031c96119759698288",
"date-fns": "^1.28.5",
"fetch-mock": "^5.12.1",
"date-fns": "^1.29.0",
"fetch-mock": "^5.13.1",
"gh-pages": "^1.1.0",
"gh-release": "^3.1.1",
"husky": "^0.14.3",
"inspect-process": "^0.5.0",
"jasmine": "^2.7.0",
"jasmine-core": "^2.6.4",
"karma": "^1.7.0",
"jasmine": "^2.8.0",
"jasmine-core": "^2.8.0",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.0",
"karma-jasmine-diff-reporter": "^1.1.0",
"karma-jasmine": "^1.1.1",
"karma-jasmine-diff-reporter": "^1.1.1",
"karma-safari-launcher": "^1.0.0",
"karma-typescript": "^3.0.4",
"karma-typescript-es6-transform": "^1.0.2",
"lerna": "^2.0.0",
"lint-staged": "^4.0.2",
"karma-typescript": "^3.0.9",
"karma-typescript-es6-transform": "^1.0.3",
"lerna": "^2.5.1",
"lint-staged": "^4.3.0",
"minimatch": "^3.0.4",
"node-sass": "^4.5.3",
"onchange": "^3.2.1",
"prettier": "^1.5.3",
"resolve": "^1.3.3",
"node-sass": "^4.7.2",
"onchange": "^3.3.0",
"prettier": "^1.9.2",
"resolve": "^1.5.0",
"rollup": "^0.45.2",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-filesize": "^1.4.2",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-filesize": "^1.5.0",
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-typescript2": "^0.4.6",
"rollup-plugin-uglify": "^2.0.1",
"shelljs": "^0.7.8",
"slug": "^0.9.1",
"ts-node": "^3.3.0",
"tslint": "^5.5.0",
"tslint-config-prettier": "^1.3.0",
"tslint": "^5.8.0",
"tslint-config-prettier": "^1.6.0",
"tslint-config-standard": "^6.0.1",
"typedoc": "^0.8.0",
"typescript": "^2.4.1"
"typescript": "^2.6.2"
},
"dependencies": {
"es6-promise": "^4.1.1",
"es6-promise": "^4.2.1",
"isomorphic-fetch": "^2.2.1",
"isomorphic-form-data": "^1.0.0",
"tslib": "^1.7.1"
"tslib": "^1.8.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,10 +90,11 @@
"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",
"c": "npm run precommit && git-cz"
"c": "git add --all && npm run precommit && git-cz"
},
"repository": {
"type": "git",
Expand Down
5 changes: 4 additions & 1 deletion packages/arcgis-rest-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"prepare": "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
5 changes: 4 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,14 @@
"author": "",
"license": "Apache-2.0",
"scripts": {
"prepublish": "npm run build",
"prepare": "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
5 changes: 4 additions & 1 deletion packages/arcgis-rest-geocoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"prepare": "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
5 changes: 4 additions & 1 deletion packages/arcgis-rest-groups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"prepare": "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
5 changes: 4 additions & 1 deletion packages/arcgis-rest-items/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
"@esri/arcgis-rest-request": "^1.0.0"
},
"scripts": {
"prepublish": "npm run build",
"prepare": "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
5 changes: 4 additions & 1 deletion packages/arcgis-rest-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
"tslib": "^1.7.1"
},
"scripts": {
"prepublish": "npm run build",
"prepare": "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
2 changes: 1 addition & 1 deletion support/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getCommitData(from, to) {
}

function getPackageVersion() {
return require(path.resolve(process.cwd(), "./lerna.json")).version;
return require(resolve(process.cwd(), "./lerna.json")).version;
}

function pairReleases(releases) {
Expand Down
16 changes: 12 additions & 4 deletions support/publish.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
#!/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
# commit the changes from `npm run release:prepare`
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
npm version $VERSION --allow-same-version

# amend the changes from `npm version` to the release commit
git add --all
git commit -am "Prepare v$VERSION" --no-verify --amend
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these two lines (14,15) are unnecessary. npm version $VERSION --allow-same-version already adds a commit named $VERSION, so there are no uncommitted files to clean up. When lines 14 and 15 are run, that commit is renamed Prepare v$VERSION, resulting in two Prepare v$VERSION commits.

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch @noahmulfinger!


# 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