Skip to content

uilib-native - add a snapshot release #3753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions lib/scripts/releaseNative.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
const exec = require('shell-utils').exec;
const p = require('path');

// Export buildkite variables for Release build
// We cast toString() because function returns 'object'
const IS_SNAPSHOT = process.env.BUILDKITE_MESSAGE?.match(/^snapshot$/i);
const VERSION_TAG = IS_SNAPSHOT ? 'snapshot' : 'latest';

function run() {
if (!validateEnv()) {
return;
}

const packageJsonVersion = require('../package.json').version;
const currentPublished = findCurrentPublishedVersion();
const packageJson = require('../package.json');
const newVersion = packageJson.version;
const newVersion = IS_SNAPSHOT
? `${packageJsonVersion}-snapshot.${process.env.BUILDKITE_BUILD_NUMBER}`
: packageJsonVersion;

if (currentPublished !== newVersion) {
if (currentPublished !== packageJsonVersion) {
createNpmRc();
versionTagAndPublish(currentPublished, newVersion);
}
Expand Down Expand Up @@ -49,8 +56,13 @@ function tryPublishAndTag(version) {
}

function tagAndPublish(newVersion) {
console.log(`Trying to publish ${newVersion}...`);
exec.execSync(`npm publish`);
console.log(`trying to publish ${newVersion}...`);
exec.execSync(`npm --no-git-tag-version version ${newVersion}`);
exec.execSync(`npm publish --tag ${VERSION_TAG}`);
if (!IS_SNAPSHOT) {
exec.execSync(`git tag -a ${newVersion} -m "${newVersion}"`);
}
exec.execSyncSilent(`git push deploy ${newVersion} || true`);
}

run();