mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
29 lines
1.1 KiB
JavaScript
Executable File
29 lines
1.1 KiB
JavaScript
Executable File
const exec = require('shell-utils').exec;
|
|
const {log, logSection, getVersionSafe, getReleaseNpmTag, getReleaseVersionType} = require('./utils/releaseArgs');
|
|
|
|
function run() {
|
|
logSection('Initializing');
|
|
exec.execSync('bash scripts/change_all_react_native_versions.sh')
|
|
exec.execSync('yarn install');
|
|
|
|
const versionType = getReleaseVersionType();
|
|
logSection(`Pre-calculating future version... (versionType=${versionType})`);
|
|
|
|
const npmTag = getReleaseNpmTag();
|
|
const preid = versionType.includes("pre") ? `--preid=${npmTag}` : '';
|
|
exec.execSync(`npm version ${versionType} ${preid} --no-git-tag-version`);
|
|
const futureVersion = getVersionSafe();
|
|
log('Version is: ' + futureVersion);
|
|
|
|
logSection('Packing up Android artifacts...');
|
|
log('Accepting all Android SDK licenses...');
|
|
exec.execSync(`yes | ${process.env.ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses`);
|
|
process.chdir('detox/android');
|
|
exec.execSync(`./gradlew clean detox:publish -Dversion=${futureVersion}`);
|
|
process.chdir('../Detox-android/');
|
|
exec.execSync(`tar -zcf ARCHIVE_${futureVersion}.tgz *`);
|
|
process.chdir(`../../`);
|
|
}
|
|
|
|
run();
|