Skip to content

Commit 31fb7ba

Browse files
committed
fix: configure next-release workflow to only run on next branch
- Change next-release.yaml to trigger on 'next' branch instead of 'main' - Update next-release.ts to handle rn-new package versioning - Ensure main branch only publishes to 'latest' tag via changesets - Ensure next branch publishes to 'next' tag for development releases
1 parent 3a435e7 commit 31fb7ba

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/next-release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release Next
22
on:
33
push:
44
branches:
5-
- main
5+
- next
66

77
permissions:
88
id-token: write
@@ -103,3 +103,6 @@ jobs:
103103
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
104104
cd ./cli
105105
npm publish --provenance --access public --ignore-scripts --tag next
106+
cd ../packages/rn-new
107+
bun run build
108+
npm publish --provenance --access public --ignore-scripts --tag next

scripts/next-release.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ async function createNextRelease() {
2424

2525
const content = JSON.stringify(packageJson, null, '\t') + '\n';
2626
await Bun.write(process.cwd() + '/cli/package.json', content);
27+
28+
/**
29+
* Also update the rn-new package.json with the same next version
30+
*/
31+
const rnNewPackageJson = await Bun.file(process.cwd() + '/packages/rn-new/package.json').json();
32+
const rnNewVersion = releasePlan.releases.find((release) => release.name === rnNewPackageJson.name)?.newVersion;
33+
34+
if (rnNewVersion) {
35+
rnNewPackageJson.version = `${rnNewVersion}-next.${commitHash}`;
36+
// Update the dependency to point to the next version of create-expo-stack
37+
rnNewPackageJson.dependencies['create-expo-stack'] = `^${newNextVersion}-next.${commitHash}`;
38+
39+
const rnNewContent = JSON.stringify(rnNewPackageJson, null, '\t') + '\n';
40+
await Bun.write(process.cwd() + '/packages/rn-new/package.json', rnNewContent);
41+
}
2742
}
2843
} catch (error) {
2944
console.log(error);

0 commit comments

Comments
 (0)