Skip to content
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

Fix experimental releases for pnpm #9015

Merged
merged 1 commit into from Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-experimental.yml
Expand Up @@ -67,4 +67,4 @@ jobs:
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc

- name: 🚀 Publish
run: npm run publish
run: pnpm run publish
8 changes: 7 additions & 1 deletion scripts/publish.js
Expand Up @@ -15,7 +15,13 @@ function getTaggedVersion() {
* @param {string} tag
*/
function publish(dir, tag) {
execSync(`pnpm publish ${dir} --access public --tag ${tag}`, {
let args = ["--access public", `--tag ${tag}`];
if (tag === "experimental") {
args.push(`--no-git-checks`);
} else {
args.push("--publish-branch release-next");
}
Comment on lines +18 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, pnpm will only publish from main. Turn off this check when publishing an experimental from release-experimental-* and change the allowed publish branch to release-next for normal releases.

execSync(`pnpm publish ${dir} ${args.join(" ")}`, {
stdio: "inherit",
});
}
Expand Down
8 changes: 7 additions & 1 deletion scripts/utils.js
Expand Up @@ -191,14 +191,20 @@ const updateDenoImportMap = async (importMapPath, nextVersion) => {
/**
* @param {string} nextVersion
*/
async function incrementRemixVersion(nextVersion) {
async function incrementRemixVersion(nextVersion, syncLockFile = false) {
// Update version numbers in package.json for all packages
await updateRemixVersion("remix", nextVersion);
await updateRemixVersion("create-remix", nextVersion);
for (let name of remixPackages.all) {
await updateRemixVersion(`remix-${name}`, nextVersion);
}

// Sync up the pnpm-lock.yaml file with the new experimental version
if (syncLockFile) {
console.log(chalk.green(" Syncing pnpm lockfile..."));
execSync("pnpm install --no-frozen-lockfile");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do this with the version bump otherwise the CI run will fail on pnpm install --frozen-lockfile

}

// Update version numbers in Deno's import maps
await Promise.all(
[
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.js
Expand Up @@ -42,7 +42,7 @@ async function run(args) {
if (answer === false) return 0;
}

await incrementRemixVersion(nextVersion);
await incrementRemixVersion(nextVersion, givenVersion === "experimental");
}

/**
Expand Down