Use split publishing workflow (#679)

* fix release line timing

* Use split publishing workflow

* remove release check, handle through publish plan

* remove unused script

* remove unused publish plan output

* fmt

* update a thing

* fmt

* simplify

* update pre

* update changesets cli
This commit is contained in:
Mateusz Burzyński
2026-07-01 12:24:41 +00:00
committed by GitHub
parent 73591071e6
commit cf45e93c21
8 changed files with 62 additions and 56 deletions
+11 -31
View File
@@ -1,6 +1,6 @@
import { Buffer } from "node:buffer";
import path from "node:path";
import { exec, getExecOutput } from "@actions/exec";
import { exec } from "@actions/exec";
import pkgJson from "../package.json" with { type: "json" };
const tag = `v${pkgJson.version}`;
@@ -20,37 +20,17 @@ const gitEnv = {
process.chdir(path.join(import.meta.dirname, ".."));
(async () => {
const { exitCode, stderr } = await getExecOutput(
`git`,
["ls-remote", "--exit-code", "origin", "--tags", `refs/tags/${tag}`],
{
ignoreReturnCode: true,
},
);
if (exitCode === 0) {
console.log(
`Action is not being published because version ${tag} is already published`,
);
return;
}
if (exitCode !== 2) {
throw new Error(`git ls-remote exited with ${exitCode}:\n${stderr}`);
}
await exec("git", ["checkout", "--detach"]);
await exec("git", ["add", "--force", "dist"]);
await exec("git", ["commit", "-m", tag]);
await exec("git", ["checkout", "--detach"]);
await exec("git", ["add", "--force", "dist"]);
await exec("git", ["commit", "-m", tag]);
await exec("changeset", ["git-tag"]);
if (isPrerelease) {
await exec("git", ["push", "origin", `refs/tags/${tag}`], {
env: gitEnv,
});
return;
}
await exec("changeset", ["git-tag"]);
if (isPrerelease) {
await exec("git", ["push", "origin", `refs/tags/${tag}`], {
env: gitEnv,
});
} else {
await exec(
"git",
[
@@ -64,4 +44,4 @@ process.chdir(path.join(import.meta.dirname, ".."));
env: gitEnv,
},
);
})();
}