diff --git a/.gitattributes b/.gitattributes index 942d91799..0d876456e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,7 +7,7 @@ /.github/workflows/provider-upgrade.yml linguist-generated /.github/workflows/release.yml linguist-generated /.github/workflows/stale.yml linguist-generated -/.github/workflows/upgrade.yml linguist-generated +/.github/workflows/upgrade-main.yml linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated /.projen/** linguist-generated @@ -17,4 +17,5 @@ /LICENSE linguist-generated /package.json linguist-generated /README.md linguist-generated +/tsconfig.dev.json linguist-generated /yarn.lock linguist-generated \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ec04c800..67df30f4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Set git identity run: |- - git config user.name "Automation" + git config user.name "github-actions" git config user.email "github-actions@github.com" - name: Setup Node.js uses: actions/setup-node@v2.2.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eead6c85..ce75952d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - name: Set git identity run: |- - git config user.name "Automation" + git config user.name "github-actions" git config user.email "github-actions@github.com" - name: Setup Node.js uses: actions/setup-node@v2.2.0 @@ -87,7 +87,30 @@ jobs: NPM_REGISTRY: registry.npmjs.org NPM_TOKEN: ${{ secrets.NPM_TOKEN }} container: - image: jsii/superchain:node14 + image: jsii/superchain:1-buster-slim-node14 + release_maven: + name: Publish to Maven Central + needs: release + runs-on: ubuntu-latest + permissions: + contents: read + if: needs.release.outputs.latest_commit == github.sha + steps: + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + - name: Release + run: npx -p jsii-release@latest jsii-release-maven + env: + MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_STAGING_PROFILE_ID: ${{ secrets.MAVEN_STAGING_PROFILE_ID }} + container: + image: jsii/superchain:1-buster-slim-node14 release_pypi: name: Publish to PyPI needs: release @@ -107,7 +130,7 @@ jobs: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} container: - image: jsii/superchain:node14 + image: jsii/superchain:1-buster-slim-node14 release_nuget: name: Publish to NuGet Gallery needs: release @@ -126,4 +149,4 @@ jobs: env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} container: - image: jsii/superchain:node14 + image: jsii/superchain:1-buster-slim-node14 diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade-main.yml similarity index 72% rename from .github/workflows/upgrade.yml rename to .github/workflows/upgrade-main.yml index dd07c3b23..505279a13 100644 --- a/.github/workflows/upgrade.yml +++ b/.github/workflows/upgrade-main.yml @@ -1,6 +1,6 @@ # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -name: upgrade +name: upgrade-main on: workflow_dispatch: {} schedule: @@ -16,6 +16,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: main + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" - name: Setup Node.js uses: actions/setup-node@v2.2.0 with: @@ -50,6 +56,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: main + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" - name: Download patch uses: actions/download-artifact@v2 with: @@ -76,8 +88,8 @@ jobs: ------ - *Automatically created by projen via the "upgrade" workflow* - branch: github-actions/upgrade + *Automatically created by projen via the "upgrade-main" workflow* + branch: github-actions/upgrade-main title: "chore(deps): upgrade dependencies" body: >- Upgrades project dependencies. See details in [workflow run]. @@ -89,18 +101,20 @@ jobs: ------ - *Automatically created by projen via the "upgrade" workflow* - author: Automation - committer: Automation + *Automatically created by projen via the "upgrade-main" workflow* + author: github-actions + committer: github-actions + signoff: true - name: Update status check if: steps.create-pr.outputs.pull-request-url != '' run: "curl -i --fail -X POST -H \"Accept: application/vnd.github.v3+json\" -H \"Authorization: token ${GITHUB_TOKEN}\" https://api.github.com/repos/${{ github.repository }}/check-runs -d - '{\"name\":\"build\",\"head_sha\":\"github-actions/upgrade\",\"status\ - \":\"completed\",\"conclusion\":\"${{ needs.upgrade.outputs.conclusion - }}\",\"output\":{\"title\":\"Created via the upgrade - workflow.\",\"summary\":\"Action run URL: https://github.com/${{ - github.repository }}/actions/runs/${{ github.run_id }}\"}}'" + '{\"name\":\"build\",\"head_sha\":\"github-actions/upgrade-main\",\"s\ + tatus\":\"completed\",\"conclusion\":\"${{ + needs.upgrade.outputs.conclusion }}\",\"output\":{\"title\":\"Created + via the upgrade-main workflow.\",\"summary\":\"Action run URL: + https://github.com/${{ github.repository }}/actions/runs/${{ + github.run_id }}\"}}'" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index e71187b41..b065abdc5 100644 --- a/.gitignore +++ b/.gitignore @@ -33,9 +33,9 @@ jspm_packages/ !/.github/workflows/build.yml /dist/changelog.md /dist/version.txt -!/.github/workflows/upgrade.yml !/.github/pull_request_template.md !/test/ +!/tsconfig.dev.json !/src/ /lib /dist/ @@ -50,3 +50,4 @@ package-lock.json !/.github/workflows/provider-upgrade.yml !/.github/workflows/automerge.yml !/.github/workflows/release.yml +!/.github/workflows/upgrade-main.yml diff --git a/.npmignore b/.npmignore index a11ed1b11..03d50f1ce 100644 --- a/.npmignore +++ b/.npmignore @@ -3,6 +3,7 @@ /dist/changelog.md /dist/version.txt /test/ +/tsconfig.dev.json /src/ !/lib/ !/lib/**/*.js diff --git a/.projen/tasks.json b/.projen/tasks.json index 6e3e0a0a4..091178658 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -120,48 +120,6 @@ } ] }, - "upgrade": { - "name": "upgrade", - "description": "upgrade dependencies", - "env": { - "CI": "0" - }, - "steps": [ - { - "exec": "npm-check-updates --upgrade --target=minor --reject='projen'" - }, - { - "exec": "yarn install --check-files" - }, - { - "exec": "yarn upgrade @cdktf/provider-project @types/node cdktf-cli cdktf constructs dot-prop jsii jsii-diff jsii-docgen jsii-pacmak npm-check-updates standard-version typescript cdktf constructs" - }, - { - "exec": "npx projen" - } - ] - }, - "upgrade-projen": { - "name": "upgrade-projen", - "description": "upgrade projen", - "env": { - "CI": "0" - }, - "steps": [ - { - "exec": "npm-check-updates --upgrade --target=minor --filter='projen'" - }, - { - "exec": "yarn install --check-files" - }, - { - "exec": "yarn upgrade projen" - }, - { - "exec": "npx projen" - } - ] - }, "default": { "name": "default", "steps": [ @@ -213,6 +171,22 @@ } ] }, + "publish:maven": { + "name": "publish:maven", + "description": "Publish this package to Maven Central", + "requiredEnv": [ + "MAVEN_GPG_PRIVATE_KEY", + "MAVEN_GPG_PRIVATE_KEY_PASSPHRASE", + "MAVEN_PASSWORD", + "MAVEN_USERNAME", + "MAVEN_STAGING_PROFILE_ID" + ], + "steps": [ + { + "exec": "npx -p jsii-release@latest jsii-release-maven" + } + ] + }, "publish:pypi": { "name": "publish:pypi", "description": "Publish this package to PyPI", @@ -270,6 +244,72 @@ "exec": "git diff --ignore-space-at-eol --exit-code" } ] + }, + "upgrade": { + "name": "upgrade", + "description": "upgrade dependencies", + "env": { + "CI": "0" + }, + "steps": [ + { + "exec": "npm-check-updates --dep dev --upgrade --target=minor --reject='projen'" + }, + { + "exec": "npm-check-updates --dep optional --upgrade --target=minor --reject='projen'" + }, + { + "exec": "npm-check-updates --dep peer --upgrade --target=minor --reject='projen'" + }, + { + "exec": "npm-check-updates --dep prod --upgrade --target=minor --reject='projen'" + }, + { + "exec": "npm-check-updates --dep bundle --upgrade --target=minor --reject='projen'" + }, + { + "exec": "yarn install --check-files" + }, + { + "exec": "yarn upgrade @cdktf/provider-project @types/node cdktf-cli cdktf constructs dot-prop jsii jsii-diff jsii-docgen jsii-pacmak npm-check-updates standard-version typescript cdktf constructs" + }, + { + "exec": "npx projen" + } + ] + }, + "upgrade-projen": { + "name": "upgrade-projen", + "description": "upgrade projen", + "env": { + "CI": "0" + }, + "steps": [ + { + "exec": "npm-check-updates --dep dev --upgrade --target=minor --filter='projen'" + }, + { + "exec": "npm-check-updates --dep optional --upgrade --target=minor --filter='projen'" + }, + { + "exec": "npm-check-updates --dep peer --upgrade --target=minor --filter='projen'" + }, + { + "exec": "npm-check-updates --dep prod --upgrade --target=minor --filter='projen'" + }, + { + "exec": "npm-check-updates --dep bundle --upgrade --target=minor --filter='projen'" + }, + { + "exec": "yarn install --check-files" + }, + { + "exec": "yarn upgrade projen" + }, + { + "exec": "npx projen" + } + ] } }, "env": { diff --git a/package.json b/package.json index 0d4c15d2f..0fe849730 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,18 @@ "bump": "npx projen bump", "unbump": "npx projen unbump", "publish:github": "npx projen publish:github", - "upgrade": "npx projen upgrade", - "upgrade-projen": "npx projen upgrade-projen", "default": "npx projen default", "watch": "npx projen watch", "package": "npx projen package", "compat": "npx projen compat", "publish:npm": "npx projen publish:npm", + "publish:maven": "npx projen publish:maven", "publish:pypi": "npx projen publish:pypi", "publish:nuget": "npx projen publish:nuget", "docgen": "npx projen docgen", "release": "npx projen release", + "upgrade": "npx projen upgrade", + "upgrade-projen": "npx projen upgrade-projen", "projen": "npx projen", "fetch": "mkdir -p src && rm -rf ./src/* && cdktf get && cp -R .gen/providers/datadog/* ./src/", "commit": "git add -A && git commit -am \"Update provider\" || echo \"No changes to commit\"", @@ -49,7 +50,7 @@ "jsii-docgen": "^1.8.110", "jsii-pacmak": "^1.33.0", "npm-check-updates": "^11", - "projen": "^0.28.28", + "projen": "^0.30.2", "standard-version": "^9", "typescript": "^4.3.5" }, @@ -79,6 +80,13 @@ "jsii": { "outdir": "dist", "targets": { + "java": { + "package": "com.hashicorp.cdktf.providers.datadog", + "maven": { + "groupId": "com.hashicorp", + "artifactId": "cdktf-provider-datadog" + } + }, "python": { "distName": "cdktf-cdktf-provider-datadog", "module": "cdktf_cdktf_provider_datadog" diff --git a/tsconfig.dev.json b/tsconfig.dev.json new file mode 100644 index 000000000..2e29dbaa7 --- /dev/null +++ b/tsconfig.dev.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019" + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019" + }, + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" + ], + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." +} diff --git a/yarn.lock b/yarn.lock index 78f39e884..b2e81e5d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -138,9 +138,9 @@ node-fetch "^2.6.1" "@cdktf/provider-project@^0.2.8": - version "0.2.18" - resolved "https://registry.yarnpkg.com/@cdktf/provider-project/-/provider-project-0.2.18.tgz#fb246c1cec22f50703a810ce5e9503ec0be69f22" - integrity sha512-Em/bbT3d2Q+9fWh0eXdQP7mfofKbkdOIU84V7pu/BiFKkTAeAJ8XXthB9kmVrPuvHsDT23bTneeAMtDqDXxO3w== + version "0.2.20" + resolved "https://registry.yarnpkg.com/@cdktf/provider-project/-/provider-project-0.2.20.tgz#1f8e5114044a4129001f5386d584bf689256dc10" + integrity sha512-sw4f8xTGbc3ns+Og2+vEm9zca7R0xuyDJ+HyajuYs2Nm0YW8RyB9/FyrmD2jFDqrDZ2sOtX7Kp6m7VPdqPFO+A== dependencies: change-case "^4.1.2" @@ -4532,10 +4532,10 @@ progress@^2.0.3: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.28.28: - version "0.28.28" - resolved "https://registry.yarnpkg.com/projen/-/projen-0.28.28.tgz#91a8dfae026fbbb063db16f864aed33b5656d8d7" - integrity sha512-iDObwAukBeFdN2dPLRipLlhdeN90gfGinr7JDQcWlityhA7PFUMYTkTBr035XZnNrgLgu44pAiIZPki22CyUwg== +projen@^0.30.2: + version "0.30.2" + resolved "https://registry.yarnpkg.com/projen/-/projen-0.30.2.tgz#8912a3684a802d660eebba07569abbd82fa6465b" + integrity sha512-zubNg8khVSEsdx0f9Hu0uv+IFaUoYNG4kSAqpo5D96RRkrvCxSjcjyhCxc+RnhXbz31/zClJFyBWA9C+r9foFA== dependencies: "@iarna/toml" "^2.2.5" chalk "^4.1.2"