From a7d6bf1bd8764c775a3be0023ee98bee4c732213 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 19:10:29 +0200 Subject: [PATCH] feat(forge): match name for artifacts --- .github/actions/build-electron/action.yml | 1 + forge.config.cjs | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index dc203c667..6c1b6d819 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -81,6 +81,7 @@ runs: APPLE_ID: ${{ env.APPLE_ID }} APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }} WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }} + TRILIUM_ARTIFACT_NAME_HINT: TriliumNextNotes ${{ inputs.os }} ${{ inputs.arch }} run: | npm run electron-forge:make -- \ --arch=${{ inputs.arch }} \ diff --git a/forge.config.cjs b/forge.config.cjs index 6032eec04..ba3d8c3ff 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -143,11 +143,18 @@ module.exports = { for (const makeResult of makeResults) { for (const artifactPath of makeResult.artifacts) { // Ignore certain artifacts. - const fileName = path.basename(artifactPath); - if (fileName === "RELEASES" || path.extname(fileName) === ".nupkg") { + let fileName = path.basename(artifactPath); + const extension = path.extname(fileName); + if (fileName === "RELEASES" || extension === ".nupkg") { continue; } + // Override the extension for the CI. + const { TRILIUM_ARTIFACT_NAME_HINT } = process.env; + if (TRILIUM_ARTIFACT_NAME_HINT) { + fileName = TRILIUM_ARTIFACT_NAME_HINT + extension; + } + const outputPath = path.join(outputDir, fileName); console.log(`[Artifact] ${artifactPath} -> ${outputPath}`); fs.copyFile(artifactPath, outputPath);