Skip to content

Commit

Permalink
Update Windows configuration to remove AppX ambiguity (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio authored Aug 8, 2024
1 parent df20f1e commit 98dfd5c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .buildkite/commands/package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If (Test-Path $certPath) {
[System.Environment]::SetEnvironmentVariable('CSC_LINK', $certPath, [System.EnvironmentVariableTarget]::Machine)
Write-Host "Environment variable CSC_LINK set to $certPath"
} else {
Write-Host "[!] certificate.pfx file does not exist."
Write-Host "[!] Certificate file does not exist at given path $certPath."
Exit 1
}

Expand All @@ -38,8 +38,8 @@ Import-PfxCertificate -FilePath $certPath -CertStoreLocation Cert:\LocalMachine\
Write-Host "--- :windows: Installing make"
choco install make

Write-Host "--- :npm: Installing dependencies"
npm ci --legacy-peer-deps
bash ".\.buildkite\commands\install_node_dependencies.sh"
If ($LastExitCode -ne 0) { Exit $LastExitCode }

Write-Host "--- :lock_with_ink_pen: Decrypting secrets"
make decrypt_conf
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ package: build-if-changed

.PHONY: package-win32
package-win32:
@echo Packaging .exe...
@echo "Packaging exe..."
@npx electron-builder --win -p $(PUBLISH)
ifeq ($(IS_WINDOWS),true)
@echo Packaging .appx as well...
# Note: the configuration required to generate a code signed exe via the `nsis` target will conflict with the `appx` configuration.
# In practice, "certificateSubjectName": "Automattic, Inc." is required to sign the exe, but if that setting is present and so are the `appx` settings, there will be a failure.
# Hence the need for a separate configuration here.
# See also in https://github.com/electron-userland/electron-builder/issues/6698
@echo "Packaging appx — with dedicated configuration to work around code signing conflicts..."
@npx electron-builder --win -p $(PUBLISH) --config=./electron-builder-appx.json
else
@echo Skipping packaging .appx because we are not running on a Windows machine.
endif

.PHONY: package-osx
package-osx: build-if-changed
Expand Down
8 changes: 3 additions & 5 deletions electron-builder-appx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"productName": "Simplenote",
"appId": "com.automattic.simplenote",
"directories": {
"output": "release",
"buildResources": "resources"
"output": "./release",
"buildResources": "./resources"
},
"files": ["desktop", "dist", "shared"],
"win": {
Expand All @@ -29,7 +29,5 @@
"name": "simplenote",
"schemes": ["simplenote"]
}
],
"afterSign": "./after_sign_hook.js",
"afterAllArtifactBuild": "./after_sign_hook.js"
]
}
8 changes: 0 additions & 8 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@
{
"target": "nsis",
"arch": ["ia32", "x64"]
},
{
"target": "appx",
"arch": ["ia32", "x64"]
}
]
},
"appx": {
"backgroundColor": "transparent",
"showNameOnTiles": true
},
"nsis": {
"artifactName": "Simplenote-win-${version}-${arch}.${ext}",
"deleteAppDataOnUninstall": true,
Expand Down

0 comments on commit 98dfd5c

Please sign in to comment.