mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Switch to Changesets-based release process (#118)
* Switch to Changesets-based release process * Bump version * drop unused variable * Update .github/workflows/version-or-publish.yml Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> * Push also to a release line branch when releasing * Change node version used in the version-or-publish workflow * Switch to using the local action Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> * build the action before trying to use it the workflow * Add changeset and actually setup Changesets, lol Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com>
This commit is contained in:
co-authored by
Nicola Molinari
parent
21240c3cd1
commit
05c863d3f9
@@ -0,0 +1,19 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { exec } = require("@actions/exec");
|
||||
|
||||
process.chdir(path.join(__dirname, ".."));
|
||||
|
||||
(async () => {
|
||||
await exec("changeset", ["version"]);
|
||||
|
||||
const releaseLine = `v${require("../package.json").version.split(".")[0]}`;
|
||||
|
||||
const readmePath = path.join(__dirname, "..", "README.md");
|
||||
const content = fs.readFileSync(readmePath, "utf8");
|
||||
const updatedContent = content.replace(
|
||||
/changesets\/action@[^\s]+/g,
|
||||
`changesets/action@${releaseLine}`
|
||||
);
|
||||
fs.writeFileSync(readmePath, updatedContent);
|
||||
})();
|
||||
Reference in New Issue
Block a user