Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add check-relase script as part of perversion validations.
- Loading branch information
Showing
6 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const semver = require('semver'); | ||
//@ts-ignore | ||
const pck = require('../package.json'); | ||
|
||
const newUnleashVersion = process.argv[2]; | ||
const frontendVersion = pck.dependencies['unleash-frontend']; | ||
|
||
function isPrerelease(version) { | ||
const arr = semver.prerelease(version); | ||
return arr && arr.length > 0; | ||
} | ||
|
||
if (!newUnleashVersion) { | ||
console.error('You must provide the new Unleash version as argument'); | ||
process.exit(1); | ||
} | ||
|
||
if (!isPrerelease(newUnleashVersion)) { | ||
if (isPrerelease(frontendVersion)) { | ||
console.error( | ||
`A latest version of unleash-server (${newUnleashVersion}) cannot depend on a pre-release of unleash-frontend (${frontendVersion})`, | ||
); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
console.log( | ||
` Passed!\x1b[36m unleash-server v${newUnleashVersion}\x1b[0m can depend on\x1b[36m unleash-frontend v${frontendVersion}\x1b[0m`, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo -e "\n STEP 1. Check unleash-frontend version" | ||
node scripts/check-release.js $1 | ||
|
||
echo -e "\n STEP 2. Lint" | ||
yarn run lint | ||
|
||
echo -e "\n STEP 3. Build" | ||
yarn run build | ||
|
||
echo -e "\n STEP 4. Test" | ||
yarn run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,7 @@ | |
"snapshots", | ||
"coverage", | ||
"website", | ||
"setupJest.js" | ||
"setupJest.js", | ||
"scripts" | ||
] | ||
} |