mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: generate version on pre-publish (#8872)
This commit is contained in:
parent
37906f4708
commit
3499e1292e
3
.github/workflows/pre-release.yml
vendored
3
.github/workflows/pre-release.yml
vendored
@ -19,8 +19,9 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Build
|
||||
env:
|
||||
PUBLISH: 1
|
||||
run: |
|
||||
npm run generate:sources
|
||||
npm run docs
|
||||
- name: Version docs
|
||||
working-directory: ./website
|
||||
|
@ -77,20 +77,21 @@ const INCLUDED_FOLDERS = ['common', 'node', 'generated', 'util'];
|
||||
.outputs(['src/types.ts'])
|
||||
.build();
|
||||
|
||||
job('', async ({inputs, outputs}) => {
|
||||
const version = JSON.parse(await readFile(inputs[0]!, 'utf8')).version;
|
||||
await writeFile(
|
||||
outputs[0]!,
|
||||
(
|
||||
await readFile(outputs[0]!, {
|
||||
encoding: 'utf-8',
|
||||
})
|
||||
).replace("'NEXT'", `v${version}`)
|
||||
);
|
||||
})
|
||||
.inputs(['package.json'])
|
||||
.outputs(['versions.js'])
|
||||
.build();
|
||||
if (process.env['PUBLISH']) {
|
||||
job('', async ({inputs}) => {
|
||||
const version = JSON.parse(await readFile(inputs[0]!, 'utf8')).version;
|
||||
await writeFile(
|
||||
inputs[1]!,
|
||||
(
|
||||
await readFile(inputs[1]!, {
|
||||
encoding: 'utf-8',
|
||||
})
|
||||
).replace("'NEXT'", `'v${version}'`)
|
||||
);
|
||||
})
|
||||
.inputs(['package.json', 'versions.js'])
|
||||
.build();
|
||||
}
|
||||
|
||||
job('', async ({inputs, outputs}) => {
|
||||
const version = JSON.parse(await readFile(inputs[0]!, 'utf8')).version;
|
||||
|
Loading…
Reference in New Issue
Block a user