Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Re-enable VSIX signing #1435

Merged
merged 2 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,19 @@ steps:
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.StagingDirectory)\vscode-arduino.vsix
- script: python .\build\markExecutableFiles.py
displayName: Make serial monitor executable
- task: MSBuild@1
displayName: Sign VSIX
inputs:
solution: .\build\SignVsix.proj
msbuildArguments: /p:SignType=$(SignType)
# MicroBuild signing will always fail on public PRs.
# TODO: Signing the VSIX strips out the "main" executables for
# serial-monitor-cli on Mac and Linux, completely breaking serial
# functionality in the extension on these platforms. For now we disable VSIX
# signing because it's not a strict requirement, but we should investigate
# if we can either add extensions to these files or support extensionless
# files in VSIX signing.
condition: and(false, ne(variables['Build.Reason'], 'PullRequest'))
condition: ne(variables['Build.Reason'], 'PullRequest')
# VSIX signing removes the executable attributes on files. Luckily, the
# signature only seems to be based on the content of the files, not the
# attributes, so we can safely go back and mark the serial monitor as
# executable without invalidating the signature.
- script: python .\build\markExecutableFiles.py
displayName: Make serial monitor executable
- publish: $(Build.StagingDirectory)\vscode-arduino.vsix
artifact: VS Code extension VSIX
displayName: Publish extension VSIX as artifact
Expand Down
4 changes: 2 additions & 2 deletions build/markExecutableFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
output_archive_path = f"{staging_directory}/vscode-arduino-out.vsix"

filenames = [
"extension/out/serial-monitor-cli/darwin/main",
"extension/out/serial-monitor-cli/linux/main"
"extension/out/serial-monitor-cli/darwin/main.out",
"extension/out/serial-monitor-cli/linux/main.out"
]

input_archive = zipfile.ZipFile(input_archive_path, 'r')
Expand Down
2 changes: 1 addition & 1 deletion src/serialmonitor/serialportctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class SerialPortCtrl {
if (os.platform() === "win32") {
fileName = "main.exe"
} else if (os.platform() === "linux" || os.platform() === "darwin") {
fileName = "main"
fileName = "main.out"
}
const deviceContext = DeviceContext.getInstance();
return path.resolve(deviceContext.extensionPath, "out", "serial-monitor-cli", `${os.platform}`, fileName);
Expand Down