Skip to content

Commit e5b72e0

Browse files
author
bweigel
committed
refactor: build tasks
1 parent 67ef379 commit e5b72e0

File tree

11 files changed

+109
-66
lines changed

11 files changed

+109
-66
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.yml

Lines changed: 12 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/upgrade.yml renamed to .github/workflows/upgrade-master.yml

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/deps.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/files.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { exec } from 'child_process';
22
import { awscdk, Component, github } from 'projen';
33
import { NodeProject, TrailingComma, UpgradeDependenciesSchedule } from 'projen/lib/javascript';
4+
import { ReleaseTrigger } from 'projen/lib/release';
45

56
const project = new awscdk.AwsCdkTypeScriptApp({
67
cdkVersion: '2.63.2',
@@ -9,7 +10,6 @@ const project = new awscdk.AwsCdkTypeScriptApp({
910
description: 'A layer for AWS Lambda containing the tesseract C libraries and tesseract executable. ',
1011
projenrcTs: true,
1112
srcdir: 'continous-integration',
12-
1313
// Use built-in dep upgrades
1414
dependabot: false,
1515
gitignore: ['layer', '.serverless', '.mypy_cache', '*.zip', '**/*test-output.txt'],
@@ -28,6 +28,8 @@ const project = new awscdk.AwsCdkTypeScriptApp({
2828
//postinstall: 'npm ci --prefix example/cdk && npm ci --prefix example/serverless',
2929
'post-upgrade': 'npx projen upgrade:ci:py',
3030
},
31+
release: true,
32+
releaseTrigger: ReleaseTrigger.scheduled({ schedule: '0 17 * * *' }),
3133
githubOptions: {
3234
mergify: true,
3335
projenCredentials: github.GithubCredentials.fromApp(),
@@ -54,10 +56,6 @@ const project = new awscdk.AwsCdkTypeScriptApp({
5456

5557
buildWorkflow: true,
5658
package: false,
57-
postBuildSteps: [
58-
{ name: 'test-integration-sam-local', run: 'npx projen test:integration' },
59-
{ name: 'bundle', run: 'npx projen bundle:binary' },
60-
],
6159
eslint: true,
6260
prettier: false,
6361
eslintOptions: {
@@ -118,7 +116,7 @@ project.addTask(`test:integration:node16`, {
118116
},
119117
],
120118
});
121-
project.addTask(`test:integration`, {
119+
const testIntegration = project.addTask(`test:integration`, {
122120
steps: [
123121
{
124122
spawn: `test:integration:py38`,
@@ -128,7 +126,7 @@ project.addTask(`test:integration`, {
128126
},
129127
],
130128
});
131-
project.addTask(`bundle:binary`, {
129+
const bundle = project.addTask(`bundle:binary`, {
132130
steps: [
133131
{
134132
spawn: `synth:silent`,
@@ -141,6 +139,8 @@ project.addTask(`bundle:binary`, {
141139
},
142140
],
143141
});
142+
project.packageTask.prependSpawn(testIntegration);
143+
project.packageTask.prependSpawn(bundle);
144144
project.packageTask.prependExec(`mkdir -p ./dist`);
145145
project.packageTask.prependExec(`rm -rf ./dist`);
146146
project.packageTask.exec(`zip -r ../../dist/tesseract-al2-x86.zip .`, { cwd: './ready-to-use/amazonlinux-2' });

0 commit comments

Comments
 (0)