Skip to content

Commit

Permalink
build: add build step (#27196)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Feb 9, 2024
1 parent 5c53138 commit b519eac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -598,3 +598,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # TODO: use action token?
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LOG_LEVEL: debug
17 changes: 17 additions & 0 deletions tools/prepare-release.ts
Expand Up @@ -3,6 +3,7 @@ import { logger } from '../lib/logger';
import { generateDocs } from './docs';
import { parseVersion } from './utils';
import { bake } from './utils/docker';
import { exec } from './utils/exec';

process.on('unhandledRejection', (err) => {
// Will print "unhandledRejection err is not defined"
Expand All @@ -29,6 +30,22 @@ void (async () => {
await program.parseAsync();
const opts = program.opts();
logger.info(`Preparing v${opts.version} ...`);
build();
await generateDocs();
await bake('build', opts);
})();

function build(): void {
logger.info('Building ...');
const res = exec('pnpm', ['build']);

if (res.signal) {
logger.error(`Signal received: ${res.signal}`);
process.exit(-1);
} else if (res.status && res.status !== 0) {
logger.error(`Error occured:\n${res.stderr || res.stdout}`);
process.exit(res.status);
} else {
logger.debug(`Build succeeded:\n${res.stdout || res.stderr}`);
}
}

0 comments on commit b519eac

Please sign in to comment.