jsii-release 0.2.151 → 0.2.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,7 +43,9 @@ You can also execute individual publishers:
43
43
 
44
44
  ## npm
45
45
 
46
- Publishes all `*.tgz` files from `DIR` to [npmjs](npmjs.com) or [GitHub Packages](https://github.com/features/packages).
46
+ Publishes all `*.tgz` files from `DIR` to [npmjs](npmjs.com), [GitHub Packages](https://github.com/features/packages) or [AWS CodeArtifact](https://aws.amazon.com/codeartifact/).
47
+
48
+ If AWS CodeArtifact is used as npm registry, a temporary npm authorization token is created using AWS CLI. Therefore, it is necessary to provide the necessary [configuration settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html), e.g. by passing access key ID and secret access key to this script.
47
49
 
48
50
  **Usage:**
49
51
 
@@ -57,9 +59,11 @@ npx jsii-release-npm [DIR]
57
59
 
58
60
  |Option|Required|Description|
59
61
  |------|--------|-----------|
60
- |`NPM_TOKEN`|Required|Registry authentication token (either [npm.js publishing token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) or a [GitHub personal access token](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages))|
61
- |`NPM_REGISTRY`|Optional|The registry URL (defaults to "registry.npmjs.org"). Use "npm.pkg.github.com" to publish to GitHub Packages|
62
+ |`NPM_TOKEN`|Optional|Registry authentication token (either [npm.js publishing token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) or a [GitHub personal access token](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages)), not used for AWS CodeArtifact|
63
+ |`NPM_REGISTRY`|Optional|The registry URL (defaults to "registry.npmjs.org"). Use "npm.pkg.github.com" to publish to GitHub Packages. Use repository endpoint for AWS CodeAtifact, e.g. "my-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/".|
62
64
  |`NPM_DIST_TAG`|Optional|Registers the published package with the given [dist-tag](https://docs.npmjs.com/cli/dist-tag) (e.g. `next`, default is `latest`)|
65
+ |`AWS_ACCESS_KEY_ID`|Optional|If AWS CodeArtifact is used as registry, an AWS access key can be spedified.|
66
+ |`AWS_SECRET_ACCESS_KEY`|Optional|Secret access key that belongs to the AWS access key.|
63
67
 
64
68
  ## Maven
65
69
 
@@ -9,14 +9,23 @@ set -eu
9
9
  #
10
10
  # DIR: directory where npm tarballs are found (default is `dist/js`).
11
11
  #
12
- # NPM_TOKEN (required): registry authentication token (either from npmjs or a GitHub personal access token)
12
+ # NPM_TOKEN (optional): registry authentication token (either from npmjs or a GitHub personal access token), not used for AWS CodeArtifact
13
13
  # NPM_REGISTRY (optional): the registry URL (defaults to "registry.npmjs.org")
14
+ # AWS_ACCESS_KEY_ID (optional): If AWS CodeArtifact is used as registry, an AWS access key can be spedified.
15
+ # AWS_SECRET_ACCESS_KEY (optional): Secret access key that belongs to the AWS access key.
14
16
  #
15
17
  ###
16
18
 
17
19
  dir="${1:-"dist/js"}"
18
20
 
19
- if [ -z "${NPM_TOKEN:-}" ]; then
21
+
22
+ if ! [ -z "${NPM_REGISTRY:-}" ] && [[ $NPM_REGISTRY =~ .codeartifact.*.amazonaws.com ]]; then
23
+ codeartifact_account="$(echo $NPM_REGISTRY | cut -d. -f1 | rev | cut -d- -f1 | rev)"
24
+ codeartifact_subdomain="$(echo $NPM_REGISTRY | cut -d. -f1)"
25
+ codeartifact_domain="$(echo $codeartifact_subdomain | cut -b -$((${#codeartifact_subdomain}-${#codeartifact_account}-1)))"
26
+ codeartifact_region="$(echo $NPM_REGISTRY | cut -d. -f4)"
27
+ NPM_TOKEN=`aws codeartifact get-authorization-token --domain $codeartifact_domain --domain-owner $codeartifact_account --region $codeartifact_region --query authorizationToken --output text`
28
+ elif [ -z "${NPM_TOKEN:-}" ]; then
20
29
  echo "NPM_TOKEN is required"
21
30
  exit 1
22
31
  fi
package/package.json CHANGED
@@ -68,7 +68,7 @@
68
68
  "main": "lib/index.js",
69
69
  "license": "Apache-2.0",
70
70
  "homepage": "https://github.com/aws/jsii-release",
71
- "version": "0.2.151",
71
+ "version": "0.2.152",
72
72
  "jest": {
73
73
  "testMatch": [
74
74
  "**/__tests__/**/*.ts?(x)",