Skip to content

Commit

Permalink
Increase manifest version from APM (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev authored Jul 11, 2024
1 parent 0988e76 commit 183c7f8
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/tasks/publish/subtasks/getFetchApmVersionsTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "../../../files/index.js";
import { getNextVersionFromApm } from "../../../utils/versions/getNextVersionFromApm.js";
import path from "path";
import { Manifest } from "@dappnode/types";

export function getFetchApmVersionsTask({
releaseType,
Expand All @@ -28,12 +29,7 @@ export function getFetchApmVersionsTask({
return {
title: "Fetch current versions from APM",
task: async ctx => {
for (const [
variant,
{
manifest: { name, version }
}
] of Object.entries(variantsMap))
for (const [variant, { manifest }] of Object.entries(variantsMap))
await setNextVersionToContext({
ctx,
releaseType,
Expand All @@ -42,8 +38,7 @@ export function getFetchApmVersionsTask({
variantsDirPath,
composeFileName,
variant: variant === "default" ? null : variant,
name,
version
manifest
});
}
};
Expand All @@ -57,8 +52,7 @@ async function setNextVersionToContext({
variantsDirPath,
composeFileName,
variant,
name,
version
manifest
}: {
ctx: ListrContextPublish;
releaseType: ReleaseType;
Expand All @@ -67,13 +61,13 @@ async function setNextVersionToContext({
variantsDirPath: string;
composeFileName: string;
variant: string | null;
name: string;
version: string;
manifest: Manifest;
}): Promise<void> {
const { name, version } = manifest
ctx[name] = ctx[name] || {};

try {
ctx[name].nextVersion = await increaseFromApmVersion({
const nextVersion = await increaseFromApmVersion({
type: releaseType,
ethProvider,
dir,
Expand All @@ -82,6 +76,9 @@ async function setNextVersionToContext({
variantsDirPath,
ensName: name
});

ctx[name].nextVersion = nextVersion;
manifest.version = nextVersion;
} catch (e) {
if (e.message.includes("NOREPO")) ctx[name].nextVersion = version;
else throw e;
Expand Down

0 comments on commit 183c7f8

Please sign in to comment.