Skip to content

Development to Main #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
631bcfc
Show filename when transferring files
murilopolese Apr 25, 2024
d7a2114
Removed automatic creation of lib folder.
ubidefeo Nov 6, 2024
b05f397
Merge pull request #138 from arduino/feature/remove-lib-creation
ubidefeo Nov 7, 2024
c49a333
Merge branch 'development' into feature/show-filename-transfer
murilopolese Nov 7, 2024
f6a1cfa
Include file name on folder transfer
murilopolese Nov 7, 2024
954f9cf
Prompting to save before quit also for new files
murilopolese Nov 7, 2024
befd117
Prompt to save before closing tab of new file
murilopolese Nov 7, 2024
b3b91f5
Merge pull request #139 from arduino/bugfix/prompt-to-save-before-quit
murilopolese Nov 7, 2024
4e139e6
Merge pull request #120 from arduino/feature/show-filename-transfer
murilopolese Nov 11, 2024
153e575
Implemented binary file download.
ubidefeo Nov 13, 2024
2da943e
Removed some redundancy, left commented methods for reference.
ubidefeo Nov 14, 2024
dd741df
Leveraging micropython.js implementation of fs_cat_binary.
ubidefeo Nov 14, 2024
10f6608
Bumped micropython.js version to 1.5.0 to allow for binary fs_cat.
ubidefeo Nov 14, 2024
ae2c82a
Removed log, fixed conversion from Array of Numbers to String.
ubidefeo Nov 14, 2024
64a9aae
Implement Windows signing - update Node.
ubidefeo Nov 19, 2024
819a6dd
Merge pull request #140 from arduino/feature/download-file-as-binary
ubidefeo Nov 19, 2024
274930a
XMerge branch 'development' into github/windows-signing-2024
ubidefeo Nov 19, 2024
20fcc7a
Merge pull request #142 from arduino/github/windows-signing-2024
ubidefeo Nov 19, 2024
85c937d
Fix path resolution
murilopolese Nov 27, 2024
c5e69e8
Replace frontend confirmation with Electron dialog
murilopolese Dec 2, 2024
fe97045
Fixed windows path slashes on uploadFile.
ubidefeo Dec 2, 2024
a4677a2
Ensured all occurrences of path.win32.sep are replaced with path.posi…
ubidefeo Dec 2, 2024
28b69de
Merge pull request #146 from arduino/bugfix/recursive-upload-patch
ubidefeo Dec 2, 2024
345a7b3
Merge pull request #145 from arduino/bugfix/windows-focus
murilopolese Dec 3, 2024
3f749ed
Removing obsolete code
murilopolese Dec 4, 2024
098b935
Merge pull request #143 from arduino/bugfix/recursive-upload
murilopolese Dec 4, 2024
8838ede
Bumped release version for 0.11.0 build.
ubidefeo Dec 5, 2024
94d0263
Merge pull request #147 from arduino/release/bump-version
ubidefeo Dec 5, 2024
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
20 changes: 15 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

env:
JOB_TRANSFER_ARTIFACT: build-artifacts
NODE_VERSION: 18.17

jobs:
build:
Expand All @@ -22,7 +23,7 @@ jobs:
fail-fast: false
matrix:
config:
- os: windows-2019
- os: [self-hosted, windows-sign-pc]
- os: ubuntu-latest
- os: macos-13
- os: macos-14
Expand All @@ -31,15 +32,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Node.js 16.x
uses: actions/setup-node@v3
- name: Install Node.js ${{ env.NODE_VERSION }}
if: runner.name != 'WINDOWS-SIGN-PC'
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'

- name: Install Python 3.x
if: runner.name != 'WINDOWS-SIGN-PC'
uses: actions/setup-python@v4
with:
python-version: '3.11.x'
Expand All @@ -51,11 +54,18 @@ jobs:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_TEAM_ID: ${{ secrets.AC_TEAM_ID }}
INSTALLER_CERT_WINDOWS_CER: "/tmp/cert.cer"
# We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
# Keep in mind that this path could change when upgrading to a new runner version
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 }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# IS_NIGHTLY: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }}
IS_FORK: ${{ github.event.pull_request.head.repo.fork == true }}

run: |
# See: https://www.electron.build/code-signing
if [ $IS_FORK = true ]; then
Expand Down
11 changes: 9 additions & 2 deletions backend/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
getAllFiles
} = require('./helpers.js')

module.exports = function registerIPCHandlers(win, ipcMain, app) {
module.exports = function registerIPCHandlers(win, ipcMain, app, dialog) {
ipcMain.handle('open-folder', async (event) => {
console.log('ipcMain', 'open-folder')
const folder = await openFolderDialog(win)
Expand Down Expand Up @@ -43,7 +43,8 @@ module.exports = function registerIPCHandlers(win, ipcMain, app) {

ipcMain.handle('save-file', (event, filePath, content) => {
console.log('ipcMain', 'save-file', filePath, content)
fs.writeFileSync(filePath, content, 'utf8')
const data = Buffer.from(content);
fs.writeFileSync(filePath, data)
return true
})

Expand Down Expand Up @@ -122,6 +123,12 @@ module.exports = function registerIPCHandlers(win, ipcMain, app) {
return app.getAppPath()
})

ipcMain.handle('open-dialog', (event, opt) => {
console.log('ipcMain', 'open-dialog', opt)
const response = dialog.showMessageBoxSync(win, opt)
return response != opt.cancelId
})

win.on('close', (event) => {
console.log('BrowserWindow', 'close')
event.preventDefault()
Expand Down
30 changes: 30 additions & 0 deletions build_resources/windowsCustomSign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const childProcess = require('child_process');

exports.default = async function (configuration) {
if (!process.env.GITHUB_ACTIONS) {
return;
}

const SIGNTOOL_PATH = process.env.SIGNTOOL_PATH;
const INSTALLER_CERT_WINDOWS_CER = process.env.INSTALLER_CERT_WINDOWS_CER;
const CERT_PASSWORD = process.env.WIN_CERT_PASSWORD;
const CONTAINER_NAME = process.env.WIN_CERT_CONTAINER_NAME;
const filePath = configuration.path;

if (
SIGNTOOL_PATH &&
INSTALLER_CERT_WINDOWS_CER &&
CERT_PASSWORD &&
CONTAINER_NAME
) {
childProcess.execSync(
`"${SIGNTOOL_PATH}" sign -d "Arduino Lab for MicroPython" -f "${INSTALLER_CERT_WINDOWS_CER}" -csp "eToken Base Cryptographic Provider" -k "[{{${CERT_PASSWORD}}}]=${CONTAINER_NAME}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${filePath}"`,
{ stdio: 'inherit' }
);
} else {
console.warn(
`Custom windows signing was no performed one of the following variables was not provided: SIGNTOOL_PATH (${SIGNTOOL_PATH}), INSTALLER_CERT_WINDOWS_CERT (${INSTALLER_CERT_WINDOWS_CER}), CERT_PASSWORD (${CERT_PASSWORD}), CONTAINER_NAME (${CONTAINER_NAME})`
);
process.exit(1);
}
};
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain } = require('electron')
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
const path = require('path')
const fs = require('fs')

Expand Down Expand Up @@ -49,7 +49,7 @@ function createWindow () {
win.show()
})

registerIPCHandlers(win, ipcMain, app)
registerIPCHandlers(win, ipcMain, app, dialog)
registerMenu(win)

app.on('activate', () => {
Expand Down
Loading