electron-builder
electron-builder copied to clipboard
Artifact name not used as GitHub file name
- Electron-Builder Version: 24.9.1
- Node Version: 18
- Electron Version: 28
- Electron Type (current, beta, nightly): current
- Target: Mac, Windows, Linux
When using the Github publisher the build.artifactName
is not used as the file upload name. I would like the file name in GitHub to be My-Software-1.1.1+000.exe
. Renaming it manually in GitHub is possible, so this is not a limitation of GitHub file names. I would suggest forwarding the artifactName
without any validation to GitHub and see if it likes it or not.
You can set up the asset name of the build with placeholders, like this:
"build": {
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"
}
and set the whenever you like name in the build.productName
field. It works fine.
@kashamalasha
I'm using My-Software-${env.npm_package_version}.${ext}
as artifact name. However the resulting name in Github is my-software-1.2.3.exe
. The two mistakes are that the capital letters are removed as well as the semver build version (should be 1.2.3+000
). In the env variable npm_package_version
the build version is still included.
When building locally the name is also set correctly. Just not when uploading to Github.
Try to set the My-Software as the build.productName and put the placeholder in the artifact as ${productName}. In my build it works fine. All Cap letters are still Capitalized in the release assets after uploading to GitHub.
Yes, I tried that too. No success either. Also the +000
build number will not work for an application name on MacOs meanig the build fails.
@kashamalasha What is your electron-builder
version? I haven't updated since opening this issue and still use 24.9.1
.
This is the output of the Github action:
• building target=DMG arch=x64 file=dist/My-App-1.3.5+000.dmg
• building block map blockMapFile=dist/My-App-1.3.5+000.dmg.blockmap
• publishing publisher=Github (owner: DreiDe, project: My-App, version: 1.3.5)
• uploading file=my-app-1.3.5.dmg.blockmap provider=github
• uploading file=my-app-1.3.5.dmg provider=github
"electron-builder": "^24.12.0"
this is my Actions output: https://github.com/kashamalasha/nightscout-widget-electron/actions/runs/7697577426/job/20974885587
• notarizing finished successfully for the Owlet.app
• building target=macOS zip arch=arm64 file=dist/Owlet-0.8.2-beta-mac-arm64.zip
• building target=DMG arch=arm64 file=dist/Owlet-0.8.2-beta-mac-arm64.dmg
• building block map blockMapFile=dist/Owlet-0.8.2-beta-mac-arm64.dmg.blockmap
• uploading file=Owlet-0.8.2-beta-mac-arm64.dmg.blockmap provider=github
• uploading file=Owlet-0.8.2-beta-mac-arm64.dmg provider=github
• building block map blockMapFile=dist/Owlet-0.8.2-beta-mac-arm64.zip.blockmap
• uploading file=Owlet-0.8.2-beta-mac-arm64.zip.blockmap provider=github
• uploading file=Owlet-0.8.2-beta-mac-arm64.zip provider=github