Skip to content

Commit

Permalink
Ci/configure gulp for ci (#13)
Browse files Browse the repository at this point in the history
* ci: configure gulp

* ci: read package version directly

* ci: skip release commits
  • Loading branch information
Wroud authored Sep 8, 2024
1 parent dc0f7d0 commit 5b43fb0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/ci/gulp/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ const commitPath = ".";
const changeLogFile = "CHANGELOG.md";
// print output of commands into the terminal
const stdio = "inherit";
const commitsConfig = { path: commitPath, ignore: /^chore: release/ };

async function bumpVersion(preset) {
const bumper = new RestrictEmptyCommits(process.cwd())
.loadPreset(preset)
.tag({
prefix: tagPrefix,
})
.commits({ path: commitPath });
.commits(commitsConfig);

const recommendation = await bumper.bump();

Expand All @@ -46,7 +47,7 @@ async function changelog(preset, version) {
tagPrefix,
},
undefined,
{ path: commitPath },
commitsConfig,
);

const combinedStream = combineStreams(
Expand All @@ -70,11 +71,13 @@ async function commitTagPush(version) {
await execa("git", ["push", "--follow-tags"], { stdio });
}

async function githubRelease() {
async function githubRelease(preset) {
await new Promise((resolve, reject) => {
conventionalGithubReleaser(
{ type: "oauth", token: process.env.GITHUB_TOKEN },
{ preset, tagPrefix, commitPath },
{ config: preset, tagPrefix },
undefined,
commitsConfig,
(err, success) => {
if (err) {
reject(err);
Expand All @@ -96,5 +99,5 @@ task("ci:prepublish", async () => {

await changelog(preset, version);
await commitTagPush(version);
await githubRelease();
await githubRelease(preset);
});

0 comments on commit 5b43fb0

Please sign in to comment.