Push to play store last in deploy.mjs

If the play store is acting up then it should still
at least push the tags so f-droid can update.
This commit is contained in:
Brandon Presley 2024-02-08 20:58:57 +13:00
parent 07c704841d
commit 5991a6de39
1 changed files with 15 additions and 10 deletions

View File

@ -29,16 +29,21 @@ let packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
packageJson.version = versionName;
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
const git = simpleGit();
await git.add([packageJsonPath, buildFilePath]);
await git.log(['-1']).then(log => {
const lastCommitMessage = log.latest.message;
const newCommitMessage = lastCommitMessage + ` - ${versionName} 🚀`;
return git.commit(newCommitMessage, [], ['--amend']);
}).then(() => {
return git.addTag(versionCode.toString());
}).then(() => {
return git.push('origin', 'HEAD', ['--tags']);
}).catch(err => {
console.error('Error amending commit:', err);
});
const isWindows = os.platform() === 'win32';
execSync(isWindows ? '.\\gradlew.bat bundleRelease' : './gradlew bundleRelease', { stdio: 'inherit' });
execSync('bundle install', { stdio: 'inherit' });
execSync('bundle exec fastlane supply --aab app/build/outputs/bundle/release/app-release.aab', { stdio: 'inherit' });
const git = simpleGit();
git.log(['-1']).then(log => {
const lastCommitMessage = log.latest.message;
const newCommitMessage = lastCommitMessage + ` - ${versionName} 🚀`;
return git.commit(newCommitMessage, [buildFilePath, packageJsonPath]);
}).then(() => git.addTag(versionCode.toString()))
.then(() => git.push('origin', 'HEAD'))
.then(() => git.pushTags('origin'));
execSync('bundle exec fastlane supply --aab app/build/outputs/bundle/release/app-release.aab', { stdio: 'inherit' });