Skip to content

Commit

Permalink
chore: master version in one place (aws#6410)
Browse files Browse the repository at this point in the history
* chore: set lerna version 999.999.999

To avoid merge conflicts when merging back a release, update the checked-in repo version number to 999.999.999.

Also, use fixed versions across the board (no carets!).

* chore: store version only in root package.json

Store the current repo version only in the root pacakge.json in order to avoid the need to specify the version number everywhere in the codebase.

In order to achieve that, I changed all package.json files to use a version marker 999.999.999 to indicate it's a local dependency. This marker is better than 0.0.0.0 since it will make sure cache is invalidated for various languages (for example, Maven will only bring in a new version if the local cache has an older version).

Then, we needed to change a couple of other things:

- The bump script is now very simple. It merely updates the root package.json and creates the CHANGELOG. That's it.
- Before running a CI build (buildspec.yml), we run `scripts/set-version.sh` which uses lerna to update the version in all package.json files. This means that build artifacts that are produced in CI builds get the actual repo version, and dev builds all use 999.999.999.

* Use 999.0.0 instead of 999.999.999

* Move all configuration to bump.sh

Move configuration from package.json to bump.sh and change the commit title to `chore(release): vX.Y.Z`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Elad Ben-Israel and mergify[bot] authored Feb 24, 2020
1 parent 8d5ee04 commit c193aac
Show file tree
Hide file tree
Showing 163 changed files with 2,363 additions and 2,541 deletions.
1 change: 1 addition & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ phases:
- /bin/bash ./fetch-dotnet-snk.sh
build:
commands:
- /bin/bash ./scripts/align-version.sh
- /bin/bash ./build.sh
post_build:
commands:
Expand Down
22 changes: 9 additions & 13 deletions bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ version=${1:-minor}

echo "Starting ${version} version bump"

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

/bin/bash ./install.sh

npx lerna version ${version} --yes --exact --force-publish=* --no-git-tag-version --no-push

# Another round of install to fix package-lock.jsons
/bin/bash ./install.sh

# align "peerDependencies" to actual dependencies after bump
# this is technically only required for major version bumps, but in the meantime we shall do it in every bump
/bin/bash scripts/fix-peer-deps.sh
# /bin/bash ./install.sh

# Generate CHANGELOG and create a commit
npx standard-version --release --skip.tag=true --commit-all
# --skip.tag because we create the tag as part of creating the github release
npx standard-version \
--bumpFiles package.json \
--release-as ${version} \
--skip.tag=true \
--releaseCommitMessageFormat="chore(release): v{{currentTag}}" \
--commit-all

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.25.0"
"version": "999.0.0"
}
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": "./build.sh",
"pack": "./pack.sh",
"compat": "./scripts/check-api-compatibility.sh",
"bump": "./bump.sh",
"build-all": "tsc -b"
},
"devDependencies": {
Expand All @@ -19,19 +20,13 @@
"jsii-pacmak": "^0.22.0",
"jsii-rosetta": "^0.22.0",
"lerna": "^3.20.2",
"standard-version": "^7.1.0",
"typescript": "~3.8.2"
},
"repository": {
"type": "git",
"url": "git://github.com/aws/aws-cdk"
},
"standard-version": {
"releaseCommitMessageFormat": "v{{currentTag}}",
"scripts": {
"prebump": "echo $(node -pe \"require('./lerna.json').version\")",
"precommit": "git add ."
}
},
"license": "Apache-2.0",
"author": {
"name": "Amazon Web Services",
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/alexa-ask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/alexa-ask",
"version": "1.25.0",
"version": "999.0.0",
"description": "The CDK Construct Library for Alexa::ASK",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -80,16 +80,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"cdk-build-tools": "1.25.0",
"cfn2ts": "1.25.0",
"pkglint": "1.25.0"
"@aws-cdk/assert": "999.0.0",
"cdk-build-tools": "999.0.0",
"cfn2ts": "999.0.0",
"pkglint": "999.0.0"
},
"dependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
44 changes: 22 additions & 22 deletions packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aws-cdk/app-delivery",
"description": "Continuous Integration / Continuous Delivery for CDK Applications",
"version": "1.25.0",
"version": "999.0.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"jsii": {
Expand Down Expand Up @@ -40,24 +40,24 @@
"compat": "cdk-compat"
},
"dependencies": {
"@aws-cdk/aws-cloudformation": "1.25.0",
"@aws-cdk/aws-codebuild": "1.25.0",
"@aws-cdk/aws-codepipeline": "1.25.0",
"@aws-cdk/aws-codepipeline-actions": "1.25.0",
"@aws-cdk/aws-events": "1.25.0",
"@aws-cdk/aws-iam": "1.25.0",
"@aws-cdk/core": "1.25.0",
"@aws-cdk/cx-api": "1.25.0"
"@aws-cdk/aws-cloudformation": "999.0.0",
"@aws-cdk/aws-codebuild": "999.0.0",
"@aws-cdk/aws-codepipeline": "999.0.0",
"@aws-cdk/aws-codepipeline-actions": "999.0.0",
"@aws-cdk/aws-events": "999.0.0",
"@aws-cdk/aws-iam": "999.0.0",
"@aws-cdk/core": "999.0.0",
"@aws-cdk/cx-api": "999.0.0"
},
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"@aws-cdk/aws-s3": "1.25.0",
"@aws-cdk/assert": "999.0.0",
"@aws-cdk/aws-s3": "999.0.0",
"@types/nodeunit": "^0.0.30",
"cdk-build-tools": "1.25.0",
"cdk-integ-tools": "1.25.0",
"cdk-build-tools": "999.0.0",
"cdk-integ-tools": "999.0.0",
"fast-check": "^1.22.2",
"nodeunit": "^0.11.3",
"pkglint": "1.25.0"
"pkglint": "999.0.0"
},
"repository": {
"type": "git",
Expand All @@ -76,14 +76,14 @@
"cdk"
],
"peerDependencies": {
"@aws-cdk/aws-cloudformation": "1.25.0",
"@aws-cdk/aws-codebuild": "1.25.0",
"@aws-cdk/aws-codepipeline": "1.25.0",
"@aws-cdk/aws-codepipeline-actions": "1.25.0",
"@aws-cdk/aws-events": "1.25.0",
"@aws-cdk/aws-iam": "1.25.0",
"@aws-cdk/core": "1.25.0",
"@aws-cdk/cx-api": "1.25.0"
"@aws-cdk/aws-cloudformation": "999.0.0",
"@aws-cdk/aws-codebuild": "999.0.0",
"@aws-cdk/aws-codepipeline": "999.0.0",
"@aws-cdk/aws-codepipeline-actions": "999.0.0",
"@aws-cdk/aws-events": "999.0.0",
"@aws-cdk/aws-iam": "999.0.0",
"@aws-cdk/core": "999.0.0",
"@aws-cdk/cx-api": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
15 changes: 8 additions & 7 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/assert",
"version": "1.25.0",
"version": "999.0.0",
"description": "An assertion library for use with CDK Apps",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -30,17 +30,18 @@
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^25.1.2",
"cdk-build-tools": "1.25.0",
"cdk-build-tools": "999.0.0",
"jest": "^24.9.0",
"pkglint": "1.25.0",
"pkglint": "999.0.0",
"ts-jest": "^25.2.0"
},
"dependencies": {
"@aws-cdk/cloudformation-diff": "1.25.0",
"@aws-cdk/core": "1.25.0",
"@aws-cdk/cx-api": "1.25.0"
"@aws-cdk/cloudformation-diff": "999.0.0",
"@aws-cdk/core": "999.0.0",
"@aws-cdk/cx-api": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "999.0.0",
"jest": "^24.9.0"
},
"repository": {
Expand All @@ -57,4 +58,4 @@
"node": ">= 10.3.0"
},
"stability": "experimental"
}
}
20 changes: 10 additions & 10 deletions packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/assets",
"version": "1.25.0",
"version": "999.0.0",
"description": "Integration of CDK apps with local assets",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -63,27 +63,27 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"@aws-cdk/assert": "999.0.0",
"@types/minimatch": "^3.0.3",
"@types/nodeunit": "^0.0.30",
"@types/sinon": "^7.5.0",
"aws-cdk": "1.25.0",
"cdk-build-tools": "1.25.0",
"cdk-integ-tools": "1.25.0",
"aws-cdk": "999.0.0",
"cdk-build-tools": "999.0.0",
"cdk-integ-tools": "999.0.0",
"nodeunit": "^0.11.3",
"pkglint": "1.25.0",
"pkglint": "999.0.0",
"sinon": "^9.0.0",
"ts-mock-imports": "^1.2.6"
},
"dependencies": {
"@aws-cdk/core": "1.25.0",
"@aws-cdk/cx-api": "1.25.0",
"@aws-cdk/core": "999.0.0",
"@aws-cdk/cx-api": "999.0.0",
"minimatch": "^3.0.4"
},
"homepage": "https://github.com/aws/aws-cdk",
"peerDependencies": {
"@aws-cdk/core": "1.25.0",
"@aws-cdk/cx-api": "1.25.0"
"@aws-cdk/core": "999.0.0",
"@aws-cdk/cx-api": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-accessanalyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/aws-accessanalyzer",
"version": "1.25.0",
"version": "999.0.0",
"description": "The CDK Construct Library for AWS::AccessAnalyzer",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -81,16 +81,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"cdk-build-tools": "1.25.0",
"cfn2ts": "1.25.0",
"pkglint": "1.25.0"
"@aws-cdk/assert": "999.0.0",
"cdk-build-tools": "999.0.0",
"cfn2ts": "999.0.0",
"pkglint": "999.0.0"
},
"dependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-acmpca/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/aws-acmpca",
"version": "1.25.0",
"version": "999.0.0",
"description": "The CDK Construct Library for AWS::ACMPCA",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -81,16 +81,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"cdk-build-tools": "1.25.0",
"cfn2ts": "1.25.0",
"pkglint": "1.25.0"
"@aws-cdk/assert": "999.0.0",
"cdk-build-tools": "999.0.0",
"cfn2ts": "999.0.0",
"pkglint": "999.0.0"
},
"dependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-amazonmq/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/aws-amazonmq",
"version": "1.25.0",
"version": "999.0.0",
"description": "The CDK Construct Library for AWS::AmazonMQ",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -80,16 +80,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"cdk-build-tools": "1.25.0",
"cfn2ts": "1.25.0",
"pkglint": "1.25.0"
"@aws-cdk/assert": "999.0.0",
"cdk-build-tools": "999.0.0",
"cfn2ts": "999.0.0",
"pkglint": "999.0.0"
},
"dependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-amplify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-cdk/aws-amplify",
"version": "1.25.0",
"version": "999.0.0",
"description": "The CDK Construct Library for AWS::Amplify",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -81,16 +81,16 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "1.25.0",
"cdk-build-tools": "1.25.0",
"cfn2ts": "1.25.0",
"pkglint": "1.25.0"
"@aws-cdk/assert": "999.0.0",
"cdk-build-tools": "999.0.0",
"cfn2ts": "999.0.0",
"pkglint": "999.0.0"
},
"dependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "1.25.0"
"@aws-cdk/core": "999.0.0"
},
"engines": {
"node": ">= 10.3.0"
Expand Down
Loading

0 comments on commit c193aac

Please sign in to comment.