From 97b0d86e88f32d7c9c934f3d1547ec6cf5ca35ae Mon Sep 17 00:00:00 2001 From: "Gilad S." <7817232+giladgd@users.noreply.github.com> Date: Tue, 24 Sep 2024 02:51:56 +0300 Subject: [PATCH] build: fix release job (#332) --- .github/workflows/build.yml | 2 +- .releaserc.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07c57291..86ce7c18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -502,7 +502,7 @@ jobs: GH_RELEASE_REF: ${{ github.ref }} run: | echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc - export DRY_RUN_RESULT="$(cat ./semanticReleaseDryRunReleaseResult.json)" + export DRY_RUN_RESULT_FILE_PATH="$(pwd)/semanticReleaseDryRunReleaseResult.json" npx semantic-release - name: Set npm package url to GITHUB_OUTPUT diff --git a/.releaserc.ts b/.releaserc.ts index b965624a..c79c05ef 100644 --- a/.releaserc.ts +++ b/.releaserc.ts @@ -1,4 +1,5 @@ import {createRequire} from "module"; +import fs from "fs-extra"; import {getBinariesGithubRelease} from "./dist/bindings/utils/binariesGithubRelease.js"; import {cliBinName, defaultLlamaCppGitHubRepo} from "./dist/config.js"; @@ -65,11 +66,13 @@ const config: Omit = { function getDryRunResult() { try { - const dryRunResultEnvVarValue = process.env.DRY_RUN_RESULT; + const dryRunResultEnvVarValue = process.env.DRY_RUN_RESULT_FILE_PATH; if (dryRunResultEnvVarValue == null) return null; - const res: SemanticReleaseDryRunResult = JSON.parse(dryRunResultEnvVarValue); + const dryRunResultValue = fs.readFileSync(dryRunResultEnvVarValue, "utf8"); + + const res: SemanticReleaseDryRunResult = JSON.parse(dryRunResultValue); if (res === false) return null;