Skip to content

Commit

Permalink
Release fix (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
lodmfjord authored Dec 8, 2023
1 parent 0f6e82d commit 44d7252
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
1 change: 0 additions & 1 deletion ci/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const GlobalConfig = (() => {
.parse(undefined);

const { version, sha, changelog } = getExtraReleaseVars(releaseBody);
console.log({ version, sha, changelog });
return {
workDir: "/pipes-ci",
sourceDir: z
Expand Down
31 changes: 3 additions & 28 deletions ci/src/create-release/create-release.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { GlobalConfig } from "../config.js";

import type { PipesGitHubModule } from "@island.is/pipes-module-github";

const defaultChangeLOG = [`First version`];
const defaultVersion = "0.1.0";
const releaseMARKDOWNTemplate = ({
version,
sha,
Expand Down Expand Up @@ -49,7 +47,6 @@ createReleaseContext.addScript(async (context, config) => {
const shaURL = getShaURL(sha);
await createTask(
async () => {
const previousVersion = await context.githubGetMatchingCommit({ sha, tagPattern: /^v.*/ });
const printmessage = async ({ id, url }: { id: number; url: string }) => {
await using _render = await PipesDOM.render(
<PipesDOM.Text>
Expand All @@ -60,34 +57,12 @@ createReleaseContext.addScript(async (context, config) => {
},
);
};
if (previousVersion == null) {
const version = defaultVersion;
const changelog = defaultChangeLOG;
const body = releaseMARKDOWNTemplate({
version,
changelog,
sha,
shaURL,
});
const title = getTitle({ version });
const value = await context.githubWriteIssue({
body,
title,
});
await printmessage(value);
return;
}
const commits = await context.githubGetCommitsBetween({ startSha: previousVersion.sha, endSha: sha });

// FOR NOW: By default lets just now patch the last number
const version = previousVersion.tag
.replace("v", "")
.split(".")
.map((value, index) => `${parseInt(value, 10) + (index === 2 ? 1 : 0)}`)
.join("\n");
const changelog = commits.map((e) => `[${e.commit}](${getShaURL(e.sha)})`);
const version = GlobalConfig.releaseVersion;
const body = releaseMARKDOWNTemplate({
version,
changelog,
changelog: (GlobalConfig.releaseChangelog ?? "").split("\n"),
sha,
shaURL,
});
Expand Down

0 comments on commit 44d7252

Please sign in to comment.