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.name "playwright-devops"
|
||||
npm version "$(node utils/canary_version.js)"
|
||||
- run: npm publish --tag next
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
# - run: npm publish --tag next
|
||||
# env:
|
||||
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- run:
|
||||
node -p "require('./package.json').version"
|
||||
|
|
|
@ -14,23 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// This script generates the canary version to publish to npm, based on the verison of playwright.
|
||||
// It should not be used to publish a release version.
|
||||
//
|
||||
// 1. Takes timestamp from the playwright@next version, so that language packages
|
||||
// have easier time syncing between the two.
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
const { execSync } = require('child_process');
|
||||
const timestamp = execSync('git show -s --format=%ct HEAD', {
|
||||
stdio: ['ignore', 'pipe', 'ignore']
|
||||
}).toString('utf8').trim() + '000';
|
||||
const packageJSON = require('../package.json');
|
||||
console.log(packageJSON.version + '-' + timestamp);
|
||||
|
|
Загрузка…
Ссылка в новой задаче