Update signing script
This commit is contained in:
1 parent
826228e939
commit
ef17ff44af
2 files changed
+12
-6
No files matched your search
+1
-1
@@ -42,7 +42,7 @@ These are mostly the steps when releasing a new version:
|
|||||||
|
|
||||||
For releasing to the store (when needed), this is done following a Playlet lib release:
|
For releasing to the store (when needed), this is done following a Playlet lib release:
|
||||||
|
|
||||||
- Switch to main branch and pull changes - **match commit corresponding to the release.**
|
- Switch to main branch and pull changes, **including tags** - **match commit corresponding to the release.**
|
||||||
- `npm run build:release:ci`
|
- `npm run build:release:ci`
|
||||||
- This makes sure to have a valid app in the staging folder
|
- This makes sure to have a valid app in the staging folder
|
||||||
- `npm run sign-released-package`
|
- `npm run sign-released-package`
|
||||||
|
|||||||
@@ -13,16 +13,22 @@ shell.exec('git fetch --tags --force');
|
|||||||
const gitCommitHash = shell.exec('git rev-parse HEAD').stdout.trim();
|
const gitCommitHash = shell.exec('git rev-parse HEAD').stdout.trim();
|
||||||
|
|
||||||
// get current tag
|
// get current tag
|
||||||
const gitTag = shell.exec(`git describe --tags ${gitCommitHash} --abbrev=0`).stdout.trim();
|
const gitTags = shell.exec(`git tag --contains ${gitCommitHash}`)
|
||||||
|
.stdout.trim()
|
||||||
|
.split('\n')
|
||||||
|
.map(tag => tag.trim());
|
||||||
|
|
||||||
const expectedGitTag = `v${require('../package.json').version}`;
|
const expectedGitTag = `v${require('../package.json').version}`;
|
||||||
if (gitTag !== expectedGitTag) {
|
if (gitTags.length === 0) {
|
||||||
console.error(`Expected git tag ${expectedGitTag} but found ${gitTag}. Signing anyway...`);
|
console.error(`No git tag found. Signing anyway...`);
|
||||||
|
}
|
||||||
|
if (!gitTags.includes(expectedGitTag)) {
|
||||||
|
console.error(`Expected git tag ${expectedGitTag} but found [${gitTags.join(",")}]. Signing anyway...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// download playlet.zip from github
|
// download playlet.zip from github
|
||||||
const zipUrl = `https://github.com/iBicha/playlet/releases/download/${gitTag}/playlet.zip`
|
const zipUrl = `https://github.com/iBicha/playlet/releases/download/${expectedGitTag}/playlet.zip`
|
||||||
shell.exec(`curl -L -o release/playlet.zip "${zipUrl}"`);
|
shell.exec(`curl --fail -L -o release/playlet.zip "${zipUrl}"`);
|
||||||
|
|
||||||
// sign the package
|
// sign the package
|
||||||
shell.exec('node tools/sign-package.js');
|
shell.exec('node tools/sign-package.js');
|
||||||
Reference in new issue
Block a user