chore: update canary_version to work with new setup (#200)
This commit is contained in:
Родитель
a8f6c6af20
Коммит
281119ec63
|
@ -23,6 +23,8 @@ jobs:
|
||||||
git config user.email "devops@playwright.dev"
|
git config user.email "devops@playwright.dev"
|
||||||
git config user.name "playwright-devops"
|
git config user.name "playwright-devops"
|
||||||
npm version "$(node utils/canary_version.js)"
|
npm version "$(node utils/canary_version.js)"
|
||||||
- run: npm publish --tag next
|
# - run: npm publish --tag next
|
||||||
env:
|
# env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
- run:
|
||||||
|
node -p "require('./package.json').version"
|
||||||
|
|
|
@ -14,23 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This script generates the canary version to publish to npm, based on the verison of playwright.
|
const { execSync } = require('child_process');
|
||||||
// It should not be used to publish a release version.
|
const timestamp = execSync('git show -s --format=%ct HEAD', {
|
||||||
//
|
stdio: ['ignore', 'pipe', 'ignore']
|
||||||
// 1. Takes timestamp from the playwright@next version, so that language packages
|
}).toString('utf8').trim() + '000';
|
||||||
// have easier time syncing between the two.
|
const packageJSON = require('../package.json');
|
||||||
//
|
console.log(packageJSON.version + '-' + timestamp);
|
||||||
// 2. Appends git hash:
|
|
||||||
// - Avoids accidentally generating a release version.
|
|
||||||
// - Ensures that we can publish packages that have the same version of
|
|
||||||
// both playwright and playwright-cli, but different content.
|
|
||||||
|
|
||||||
const childProcess = require('child_process');
|
|
||||||
const json = require('../package.json');
|
|
||||||
const hash = childProcess.execSync('git rev-parse --short HEAD').toString().trim();
|
|
||||||
if (json.dependencies['playwright-core'].includes('next')) {
|
|
||||||
const timestamp = json.dependencies['playwright-core'].replace(/.*next\./, '');
|
|
||||||
console.log(json.version + '-' + timestamp + '-' + hash);
|
|
||||||
} else {
|
|
||||||
console.log(json.version + '-' + hash);
|
|
||||||
}
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче