feat(forge): match name for artifacts

This commit is contained in:
Elian Doran 2025-03-24 19:10:29 +02:00
parent 4108f7f353
commit a7d6bf1bd8
No known key found for this signature in database
2 changed files with 10 additions and 2 deletions

View File

@ -81,6 +81,7 @@ runs:
APPLE_ID: ${{ env.APPLE_ID }} APPLE_ID: ${{ env.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }} APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }} WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
TRILIUM_ARTIFACT_NAME_HINT: TriliumNextNotes ${{ inputs.os }} ${{ inputs.arch }}
run: | run: |
npm run electron-forge:make -- \ npm run electron-forge:make -- \
--arch=${{ inputs.arch }} \ --arch=${{ inputs.arch }} \

View File

@ -143,11 +143,18 @@ module.exports = {
for (const makeResult of makeResults) { for (const makeResult of makeResults) {
for (const artifactPath of makeResult.artifacts) { for (const artifactPath of makeResult.artifacts) {
// Ignore certain artifacts. // Ignore certain artifacts.
const fileName = path.basename(artifactPath); let fileName = path.basename(artifactPath);
if (fileName === "RELEASES" || path.extname(fileName) === ".nupkg") { const extension = path.extname(fileName);
if (fileName === "RELEASES" || extension === ".nupkg") {
continue; 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); const outputPath = path.join(outputDir, fileName);
console.log(`[Artifact] ${artifactPath} -> ${outputPath}`); console.log(`[Artifact] ${artifactPath} -> ${outputPath}`);
fs.copyFile(artifactPath, outputPath); fs.copyFile(artifactPath, outputPath);