mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 08:43:10 -07:00
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { $ } from 'bun';
|
|
|
|
const version = process.argv[2];
|
|
|
|
if (!version) {
|
|
console.error('Usage: bun run release <version>');
|
|
console.error('Example: bun run release v0.1.0');
|
|
process.exit(1);
|
|
}
|
|
|
|
if (!version.startsWith('v')) {
|
|
console.error('Version must start with "v" (e.g., v0.1.0)');
|
|
process.exit(1);
|
|
}
|
|
|
|
try {
|
|
const status = await $`git status --porcelain`.text();
|
|
if (status.trim()) {
|
|
console.error('You have uncommitted changes. Commit or stash them first.');
|
|
process.exit(1);
|
|
}
|
|
|
|
try {
|
|
await $`git rev-parse ${version}`.quiet();
|
|
console.error(`Tag ${version} already exists`);
|
|
process.exit(1);
|
|
} catch {}
|
|
|
|
console.log(`Creating release ${version}...`);
|
|
|
|
await $`git tag ${version}`;
|
|
console.log(`Created tag ${version}`);
|
|
|
|
await $`git push origin ${version}`;
|
|
console.log(`Pushed tag to GitHub`);
|
|
|
|
console.log(`
|
|
Release ${version} triggered!
|
|
|
|
GitHub Actions will now:
|
|
1. Build signed Android APK
|
|
2. Create GitHub release
|
|
3. Upload APK with SHA256 hash
|
|
|
|
Check progress: https://github.com/lone-cloud/sup/actions
|
|
`);
|
|
} catch (error) {
|
|
console.error('Release failed:', error);
|
|
process.exit(1);
|
|
}
|