-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
26,255 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.py linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
main.js | ||
main.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
language: typescript | ||
app: node main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
import * as dedent from 'dedent-js'; | ||
import { Construct } from "constructs"; | ||
import { App, Stack, Workflow, Job } from "cdkactions"; | ||
|
||
export class JSIIReleaseStack extends Stack { | ||
constructor(scope: Construct, name: string) { | ||
super(scope, name); | ||
|
||
// Build workflow | ||
const build = new Workflow(this, "build", { | ||
name: 'Build', | ||
on: ["pullRequest", "push"] | ||
}); | ||
|
||
new Job(build, 'build', { | ||
runsOn: 'ubuntu-latest', | ||
container: { | ||
image: 'jsii/superchain' | ||
}, | ||
steps: [ | ||
{ uses: 'actions/checkout@v2' }, | ||
{ | ||
name: 'Install dependencies', | ||
run: 'yarn install' | ||
}, | ||
{ | ||
name: 'Compile', | ||
run: dedent`tools/align-version.sh | ||
yarn build` | ||
}, | ||
{ | ||
name: 'Unit Tests', | ||
run: 'yarn test' | ||
}, | ||
{ | ||
name: 'Code Coverage', | ||
run: 'yarn codecov' | ||
}, | ||
{ | ||
name: 'Create Bundle', | ||
run: 'yarn package' | ||
}, | ||
{ | ||
name: 'Integration Tests', | ||
// run: 'yarn integration' | ||
run: 'echo TODO: add these' | ||
} | ||
] | ||
}); | ||
|
||
// Release workflow | ||
const release = new Workflow(this, "release", { | ||
name: 'Release', | ||
on: { push: { branches: ['master'] } } | ||
}); | ||
|
||
new Job(release, 'build_artifact', { | ||
name: 'Build and upload artifact', | ||
if: "github.repository == 'ArmaanT/cdkactions'", | ||
runsOn: 'ubuntu-latest', | ||
container: { | ||
image: 'jsii/superchain' | ||
}, | ||
steps: [ | ||
{ uses: 'actions/checkout@v2' }, | ||
{ | ||
name: 'Install dependencies', | ||
run: 'yarn install' | ||
}, | ||
{ | ||
name: 'Compile', | ||
run: dedent`tools/align-version.sh | ||
yarn build` | ||
}, | ||
{ | ||
name: 'Unit Tests', | ||
run: 'yarn test' | ||
}, | ||
{ | ||
name: 'Code Coverage', | ||
run: 'yarn codecov' | ||
}, | ||
{ | ||
name: 'Create Bundle', | ||
run: 'yarn package' | ||
}, | ||
{ | ||
name: 'Integration Tests', | ||
// run: 'yarn integration' | ||
run: 'echo TODO: add these' | ||
}, | ||
{ | ||
name: 'Upload artifact', | ||
uses: 'actions/upload-artifact@v1', | ||
with: { | ||
name: 'dist', | ||
path: 'dist' | ||
} | ||
}, | ||
{ | ||
name: 'Release to GitHub', | ||
run: 'tools/release-github.sh', | ||
env: { | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}', | ||
REPO: '${{ github.repository }}', | ||
} | ||
}, | ||
] | ||
}); | ||
|
||
new Job(release, 'release_npm', { | ||
name: 'Release to NPM', | ||
needs: 'build_artifact', | ||
runsOn: 'ubuntu-latest', | ||
container: { | ||
image: 'jsii/superchain' | ||
}, | ||
steps: [ | ||
{ | ||
name: 'Download build artifacts', | ||
uses: 'actions/download-artifact@v1', | ||
with: { | ||
name: 'dist' | ||
} | ||
}, | ||
{ | ||
name: 'Release', | ||
run: 'npx -p jsii-release jsii-release-npm', | ||
env: { | ||
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' | ||
} | ||
} | ||
] | ||
}); | ||
|
||
new Job(release, 'release_pypi', { | ||
name: 'Release to PyPI', | ||
needs: 'build_artifact', | ||
runsOn: 'ubuntu-latest', | ||
container: { | ||
image: 'jsii/superchain' | ||
}, | ||
steps: [ | ||
{ | ||
name: 'Download build artifacts', | ||
uses: 'actions/download-artifact@v1', | ||
with: { | ||
name: 'dist' | ||
} | ||
}, | ||
{ | ||
name: 'Release', | ||
run: 'npx -p jsii-release jsii-release-pypi', | ||
env: { | ||
TWINE_USERNAME: '${{ secrets.TWINE_USERNAME }}', | ||
TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD }}' | ||
} | ||
} | ||
] | ||
}); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
new JSIIReleaseStack(app, 'jsii'); | ||
app.synth(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "cdkactions-ci", | ||
"version": "0.1.0", | ||
"main": "main.js", | ||
"types": "main.ts", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"scripts": { | ||
"synth": "cdkactions synth", | ||
"compile": "tsc", | ||
"watch": "tsc -w", | ||
"build": "yarn compile && yarn synth", | ||
"upgrade-cdk": "yarn upgrade cdkactions@latest cdkactions-cli@latest" | ||
}, | ||
"dependencies": { | ||
"cdkactions": "^0.0.12", | ||
"constructs": "^3.2.9" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.6", | ||
"cdkactions-cli": "^0.0.12", | ||
"typescript": "^4.0.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"compilerOptions": { | ||
"alwaysStrict": true, | ||
"charset": "utf8", | ||
"declaration": true, | ||
"experimentalDecorators": true, | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"lib": [ | ||
"es2018" | ||
], | ||
"module": "CommonJS", | ||
"noEmitOnError": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"strictPropertyInitialization": true, | ||
"stripInternal": true, | ||
"target": "ES2018" | ||
}, | ||
"include": [ | ||
"**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
Oops, something went wrong.