diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 865c0562e..f35d97f16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -286,6 +286,8 @@ jobs: SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe" WIN_CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} WIN_CERT_CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} + WIN_SIGNING_ENABLED: ${{ !github.event.pull_request.head.repo.fork }} + strategy: matrix: config: ${{ fromJson(needs.select-targets.outputs.build-matrix) }} diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index b28dda5a5..8b3f7093b 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -1,6 +1,6 @@ { "name": "arduino-ide-extension", - "version": "2.3.3", + "version": "2.3.4", "description": "An extension for Theia building the Arduino IDE", "license": "AGPL-3.0-or-later", "scripts": { diff --git a/arduino-ide-extension/src/node/service-error.ts b/arduino-ide-extension/src/node/service-error.ts index a42c05d8a..0b6021ff0 100644 --- a/arduino-ide-extension/src/node/service-error.ts +++ b/arduino-ide-extension/src/node/service-error.ts @@ -6,7 +6,7 @@ import { ProgrammerIsRequiredForUploadError } from './cli-protocol/cc/arduino/cl type ProtoError = typeof ProgrammerIsRequiredForUploadError; const protoErrorsMap = new Map([ [ - 'type.googleapis.com/cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError', + 'cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError', ProgrammerIsRequiredForUploadError, ], // handle other cli defined errors here @@ -22,30 +22,33 @@ export namespace ServiceError { return arg instanceof Error && isStatusObject(arg); } - export function isInstanceOf(arg: unknown, type: unknown): boolean { + export function isInstanceOf( + arg: unknown, + type: new (...args: unknown[]) => ProtoError + ): arg is ProtoError { if (!isStatusObject(arg)) { return false; } - const bin = arg.metadata.get('grpc-status-details-bin')[0]; + try { + const bin = arg.metadata.get('grpc-status-details-bin')[0]; + const uint8Array = + typeof bin === 'string' + ? stringToUint8Array(bin) + : new Uint8Array(bin.buffer, bin.byteOffset, bin.byteLength); - const uint8Array = - typeof bin === 'string' - ? stringToUint8Array(bin) - : new Uint8Array(bin.buffer, bin.byteOffset, bin.byteLength); + const errors = Status.deserializeBinary(uint8Array) + .getDetailsList() + .map((details) => { + const typeName = details.getTypeName(); + const ErrorType = protoErrorsMap.get(typeName); + return ErrorType?.deserializeBinary(details.getValue_asU8()); + }); - const errors = Status.deserializeBinary(uint8Array) - .getDetailsList() - .map((details) => { - const typeUrl = details.getTypeUrl(); - const ErrorType = protoErrorsMap.get(typeUrl); - return ErrorType?.deserializeBinary(details.getValue_asU8()); - }); - - return !!errors.find((error) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return error && error instanceof type; - }); + return !!errors.find((error) => error && error instanceof type); + } catch { + return false; + } } function isStatusObject(arg: unknown): arg is StatusObject { diff --git a/docs/development.md b/docs/development.md index 367d2139b..84cd32c66 100644 --- a/docs/development.md +++ b/docs/development.md @@ -50,6 +50,7 @@ This repository contains the main code, but two more repositories are included d - To build the application, follow the Theia IDE [prerequisites](https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites). - This project recommends using [Visual Studio Code (VS Code)](https://code.visualstudio.com/) for the development. +- The build system might also need to build the [Arduino CLI](https://github.com/arduino/arduino-cli), the [Arduino Language Server](https://github.com/arduino/arduino-language-server), and other tools from the sources. In this case it is also necessary to have the build prerequisites for those projects installed. For more details, refer to the Arduino CLI's [prerequisites section](https://arduino.github.io/arduino-cli/latest/CONTRIBUTING/#prerequisites). ## Build from source diff --git a/electron-app/package.json b/electron-app/package.json index 0451107f1..c959f3548 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "electron-app", - "version": "2.3.3", + "version": "2.3.4", "license": "AGPL-3.0-or-later", "main": "./src-gen/backend/electron-main.js", "dependencies": { @@ -19,7 +19,7 @@ "@theia/preferences": "1.41.0", "@theia/terminal": "1.41.0", "@theia/workspace": "1.41.0", - "arduino-ide-extension": "2.3.3" + "arduino-ide-extension": "2.3.4" }, "devDependencies": { "@theia/cli": "1.41.0", diff --git a/electron-app/scripts/windowsCustomSign.js b/electron-app/scripts/windowsCustomSign.js index 29fbc5fad..41fc6d3b2 100644 --- a/electron-app/scripts/windowsCustomSign.js +++ b/electron-app/scripts/windowsCustomSign.js @@ -1,7 +1,10 @@ const childProcess = require('child_process'); exports.default = async function (configuration) { - if (!process.env.GITHUB_ACTIONS) { + if ( + !process.env.GITHUB_ACTIONS || + process.env.WIN_SIGNING_ENABLED !== 'true' + ) { return; } diff --git a/package.json b/package.json index 2e4dd1a64..88ebc27c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-ide", - "version": "2.3.3", + "version": "2.3.4", "description": "Arduino IDE", "repository": "https://github.com/arduino/arduino-ide.git", "author": "Arduino SA",