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

CI and fixes for npm publishing #2

Merged
merged 18 commits into from
Feb 27, 2020
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2

jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:12
steps:
- checkout

- run:
name: update-npm
command: 'sudo npm install -g npm@latest'

- run: npm install

- run: npm run compile

- run: cp package.json ./build/package.json

- run: cp README.md ./build/README.md

- run: cd ./build && ls -al

- persist_to_workspace:
root: ~/repo
paths: .

publish:
working_directory: ~/repo
docker:
- image: circleci/node:12
steps:
- attach_workspace:
at: ~/repo

- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/repo/.npmrc

- run: cd ./build && npm --userconfig="../.npmrc" publish

workflows:
version: 2
publish:
jobs:
- build
- publish:
requires:
- build
filters:
tags:
only: /\d+\.\d+\.\d+/
branches:
ignore: /.*/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# No sops binary
provider/sops

# No build
build/

# No package-lock.json
package-lock.json

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tag-version-prefix=""
registry=https://registry.npmjs.org/
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"postinstall": "npm run tsc && npm run get-sops",
"get-sops": "wget https://github.com/mozilla/sops/releases/download/v3.5.0/sops-v3.5.0.linux -O ./provider/sops && chmod a+x ./provider/sops",
"tsc": "tsc",
"clean": "rm -rf build/",
"compile": "npm run -- tsc --outDir build/ && cp -R ./provider ./build/provider",
"version": "auto-changelog --template ./changelog_template.hbs -p && git add CHANGELOG.md"
},
"dependencies": {
Expand All @@ -19,9 +21,20 @@
"@aws-cdk/aws-secretsmanager": "^1.21.1",
"@aws-cdk/core": "^1.21.1",
"@aws-cdk/custom-resources": "^1.21.1",
"@aws-cdk/aws-cloudformation": "^1.21.1"
"@aws-cdk/aws-cloudformation": "^1.21.1",
"typescript": ">=3.0.0"
},
"devDependencies": {
"auto-changelog": "^1.16.2"
"auto-changelog": "^1.16.2",
"@aws-cdk/aws-lambda": "^1.21.1",
"@aws-cdk/aws-iam": "^1.21.1",
"@aws-cdk/aws-s3": "^1.21.1",
"@aws-cdk/aws-s3-assets": "^1.21.1",
"@aws-cdk/aws-kms": "^1.21.1",
"@aws-cdk/aws-secretsmanager": "^1.21.1",
"@aws-cdk/core": "^1.21.1",
"@aws-cdk/custom-resources": "^1.21.1",
"@aws-cdk/aws-cloudformation": "^1.21.1",
"typescript": ">=3.0.0"
}
}