From 5991a6de39261f0e24f844b9fec30ffb0900a410 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 8 Feb 2024 20:58:57 +1300 Subject: [PATCH] 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. --- deploy.mjs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/deploy.mjs b/deploy.mjs index d52e36c..9c2c56d 100644 --- a/deploy.mjs +++ b/deploy.mjs @@ -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')); \ No newline at end of file +execSync('bundle exec fastlane supply --aab app/build/outputs/bundle/release/app-release.aab', { stdio: 'inherit' }); \ No newline at end of file