mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
chore(ci): use electron-forge hook for gathering artifacts
This commit is contained in:
parent
a709f68af9
commit
fae9a1f796
46
.github/actions/build-electron/action.yml
vendored
46
.github/actions/build-electron/action.yml
vendored
@ -158,49 +158,3 @@ runs:
|
|||||||
echo "Found ZIP: $zip_file"
|
echo "Found ZIP: $zip_file"
|
||||||
echo "Note: ZIP files are not code signed, but their contents should be"
|
echo "Note: ZIP files are not code signed, but their contents should be"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Prepare artifacts
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
mkdir -p upload
|
|
||||||
|
|
||||||
if [ "${{ inputs.os }}" = "macos" ]; then
|
|
||||||
# For macOS, we need to look in specific directories based on the maker
|
|
||||||
echo "Collecting macOS artifacts..."
|
|
||||||
|
|
||||||
# Look for DMG files recursively
|
|
||||||
echo "Looking for DMG files..."
|
|
||||||
dmg_file=$(find ./dist -name "*.dmg" -print -quit)
|
|
||||||
if [ -n "$dmg_file" ]; then
|
|
||||||
echo "Found DMG: $dmg_file"
|
|
||||||
cp "$dmg_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.dmg"
|
|
||||||
else
|
|
||||||
echo "Warning: No DMG file found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Look for ZIP files recursively
|
|
||||||
echo "Looking for ZIP files..."
|
|
||||||
zip_file=$(find ./dist -name "*.zip" -print -quit)
|
|
||||||
if [ -n "$zip_file" ]; then
|
|
||||||
echo "Found ZIP: $zip_file"
|
|
||||||
cp "$zip_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.zip"
|
|
||||||
else
|
|
||||||
echo "Warning: No ZIP file found"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# For other platforms, use the existing logic but with better error handling
|
|
||||||
echo "Collecting artifacts for ${{ inputs.os }}..."
|
|
||||||
for ext in ${{ inputs.extension }}; do
|
|
||||||
echo "Looking for .$ext files..."
|
|
||||||
file=$(find ./dist -name "*.$ext" -print -quit)
|
|
||||||
if [ -n "$file" ]; then
|
|
||||||
echo "Found $file for extension $ext"
|
|
||||||
cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.$ext"
|
|
||||||
else
|
|
||||||
echo "Warning: No file found with extension .$ext"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Final contents of upload directory:"
|
|
||||||
ls -la upload/
|
|
||||||
|
@ -129,7 +129,20 @@ module.exports = {
|
|||||||
name: "@electron-forge/plugin-auto-unpack-natives",
|
name: "@electron-forge/plugin-auto-unpack-natives",
|
||||||
config: {}
|
config: {}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
hooks: {
|
||||||
|
postMake(_, makeResults) {
|
||||||
|
const outputDir = path.join(__dirname, "upload");
|
||||||
|
fs.mkdirp(outputDir);
|
||||||
|
for (const makeResult of makeResults) {
|
||||||
|
for (const artifactPath of makeResult.artifacts) {
|
||||||
|
const outputPath = path.join(outputDir, path.basename(artifactPath));
|
||||||
|
console.log(`[Artifact] ${artifactPath} -> ${outputPath}`);
|
||||||
|
fs.copyFile(artifactPath, outputPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function getExtraResourcesForPlatform() {
|
function getExtraResourcesForPlatform() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user