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;