summaryrefslogtreecommitdiff
path: root/.ci/ci.ts
blob: 7c95e770ec6aee08a3bbd5ec4362eca5f517ad11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env node

import { DefaultGitHookPipelineBuilder, NpmPublishJob } from '@emprespresso/ci_model';

const getPipeline = () => {
    const gitHookPipeline = new DefaultGitHookPipelineBuilder();
    const branch = gitHookPipeline.getBranch();
    if (!branch || branch !== 'release') return gitHookPipeline.build();

    const publish: NpmPublishJob = {
        type: 'npm_publish.js',
        arguments: {
            source: '.',
            registry: '//registry.npmjs.org/',
        },
    };
    gitHookPipeline.addStage({ parallelJobs: [publish] });

    return gitHookPipeline.build();
};

const main = () => {
    const data = getPipeline().serialize();
    process.stdout.write(data);
};

main();