diff --git a/.github/tools/appimagetool-x86_64.AppImage b/.github/tools/appimagetool-x86_64.AppImage new file mode 100755 index 000000000..aaf491c29 Binary files /dev/null and b/.github/tools/appimagetool-x86_64.AppImage differ diff --git a/.github/tools/github-cli.sources b/.github/tools/github-cli.sources new file mode 100644 index 000000000..fc314908c --- /dev/null +++ b/.github/tools/github-cli.sources @@ -0,0 +1,6 @@ +Types: deb +URIs: https://cli.github.com/packages +Suites: stable +Components: main +Signed-By: /etc/apt/keyrings/githubcli-archive-keyring.gpg +Architectures: amd64 diff --git a/.github/tools/githubcli-archive-keyring.gpg b/.github/tools/githubcli-archive-keyring.gpg new file mode 100644 index 000000000..21d24c4f4 Binary files /dev/null and b/.github/tools/githubcli-archive-keyring.gpg differ diff --git a/.github/workflows/KeepWorkflowsAlive.yml b/.github/workflows/KeepWorkflowsAlive.yml new file mode 100644 index 000000000..f63a05ed0 --- /dev/null +++ b/.github/workflows/KeepWorkflowsAlive.yml @@ -0,0 +1,14 @@ +name: Keep Workflows alive +on: + workflow_dispatch: + push: + schedule: + - cron: '0 1 1 * *' # every first Day of Month at 01:00 +jobs: + workflow-keepalive: + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: keepalive + uses: gneiss15/WorkflowKeepAliveByGhEnable@v1 diff --git a/.github/workflows/LinuxBuild.yml b/.github/workflows/LinuxBuild.yml new file mode 100644 index 000000000..a105dc9b6 --- /dev/null +++ b/.github/workflows/LinuxBuild.yml @@ -0,0 +1,104 @@ +name: Arduino2 IDE (Linux-AppImage-Build) +on: + #push: + workflow_dispatch: +env: + NODE_VERSION: '18.17' + YARN_VERSION: '1.22' + GO_VERSION: '1.21' + GH_TOKEN: ${{ github.token }} +jobs: + build: + name: build Linux + runs-on: ubuntu-latest + container: { "image": "ghcr.io/arduino/arduino-ide/linux:main" } + defaults: + run: + shell: bash + timeout-minutes: 90 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + - name: Install Yarn + run: npm install --global "yarn@${{ env.YARN_VERSION }}" + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + - name: Install Taskfile + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + - name: Package + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: './' + run: | + #set -x + #set -v + npx node-gyp install + yarn install + yarn --cwd arduino-ide-extension build + yarn --cwd electron-app rebuild + yarn --cwd electron-app build + yarn --cwd electron-app package + cp /__w/arduino-ide/arduino-ide/electron-app/dist/*.AppImage . + - name: Mod AppImage to use chrome-sandbox of local os + if: ${{ success() }} + run: | + #set -x + #set -v + EXE=$(readlink -f *.AppImage) + chmod a+x "${EXE}" + mkdir t + cd t + "${EXE}" --appimage-extract + cd squashfs-root/ + rm chrome-sandbox + ln -s /opt/google/chrome/chrome-sandbox chrome-sandbox + cd .. + TOOL="${GITHUB_WORKSPACE}/.github/tools/appimagetool-x86_64.AppImage" + APPIMAGE_EXTRACT_AND_RUN=1 ARCH=x86_64 "${TOOL}" squashfs-root + rm -r squashfs-root/ + rm "${EXE}" + mv *.AppImage "${EXE}" + cd .. + rm -r t + - name: Install gh and jq + if: ${{ success() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: './' + run: | + #set -x + #set -v + mkdir -p /etc/apt/keyrings/ + mkdir -p /etc/apt/sources.list.d/ + cp .github/tools/githubcli-archive-keyring.gpg /etc/apt/keyrings/githubcli-archive-keyring.gpg + cp .github/tools/github-cli.sources /etc/apt/sources.list.d/github-cli.sources + apt update + apt install -y gh jq + - name: Upload to GitHub Releases + if: ${{ success() }} + run: | + set -x + set -v + TAG_List=$(gh release list -R "$GITHUB_REPOSITORY" --json tagName | jq -r 'map(select(true))[] | (.tagName)') + TAG="$(date +%Y%m%d)" + for i in $TAG_List; do + if [[ "$i" = "$TAG" ]]; then + gh release delete "$TAG" -y + fi + done + OLDFN=$(ls *.AppImage) + NEWFN=$(sed -e s/snapshot[^_]*/$TAG-GN/g <<<$OLDFN) + mv $OLDFN $NEWFN + gh release create "$TAG" "$NEWFN" --title "$TAG" + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e56db0a40..27224325e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -369,7 +369,7 @@ jobs: working-directory: ${{ matrix.config.working-directory || './' }} run: | # See: https://www.electron.build/code-signing - if [ $CAN_SIGN = false ] || [ $IS_WINDOWS_CONFIG = true ]; then + if [[ $CAN_SIGN = false ]] || [[ $IS_WINDOWS_CONFIG = true ]]; then echo "Skipping the app signing: certificate not provided." else export CSC_LINK="${{ runner.temp }}/signing_certificate.${{ matrix.config.certificate-extension }}" @@ -544,11 +544,11 @@ jobs: run: | export LATEST_TAG=$(git describe --abbrev=0) export GIT_LOG=$(git log --pretty=" - %s [%h]" $LATEST_TAG..HEAD | sed 's/ *$//g') - if [ "$IS_RELEASE" = true ]; then + if [[ "$IS_RELEASE" = true ]]; then export BODY=$(echo -e "$GIT_LOG") else export LATEST_TAG_WITH_LINK=$(echo "[$LATEST_TAG](https://github.com/arduino/arduino-ide/releases/tag/$LATEST_TAG)") - if [ -z "$GIT_LOG" ]; then + if [[ -z "$GIT_LOG" ]]; then export BODY="There were no changes since version $LATEST_TAG_WITH_LINK." else export BODY=$(echo -e "Changes since version $LATEST_TAG_WITH_LINK:\n$GIT_LOG") diff --git a/.github/workflows/upstream-merge.yml b/.github/workflows/upstream-merge.yml new file mode 100644 index 000000000..a914b23bc --- /dev/null +++ b/.github/workflows/upstream-merge.yml @@ -0,0 +1,76 @@ +name: Merge upstream/main into local main +on: + workflow_dispatch: + schedule: + - cron: '30 0 1/7 * *' # every every 7th Day of Month at 00:30 + #- cron: '30 0 * * *' # every Day at 00:30 +jobs: + merge-upstream: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # wichtig, damit git alle Commits kennt + - name: Set up Git + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - name: Add upstream remote + run: | + git remote add upstream https://github.com/arduino/arduino-ide.git + git fetch upstream + - name: Check for relevant changes (skip merge if only .github/ etc.) + id: Check + run: | + git checkout main + git fetch upstream + #ROOT_FILES=$(grep -Ev '^\.github/|^\.git/|^[^/]+$') + BASE=$(git merge-base HEAD upstream/main) + DIFF_FILES=$(git diff --name-only $BASE upstream/main | grep -Ev '^(\.github/|\.git/|^[^/]+$)' || true) + echo "DIFF_FILES: $DIFF_FILES" + if [[ -z "$DIFF_FILES" ]]; then + echo "❌ Only ignored files changed. Exiting." + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "❎ Relevant files changed." + echo "skip=false" >> $GITHUB_OUTPUT + fi + - name: Merge upstream/main into local main + if: steps.Check.outputs.skip == 'false' + run: | + git merge upstream/main --no-edit + continue-on-error: true # erlaubt Fehler z. B. bei Konflikten + - name: Check for merge conflicts + if: steps.Check.outputs.skip == 'false' + run: | + if git ls-files -u | grep .; then + echo "❌ Merge conflicts detected!" + exit 1 + fi + echo "✅ No merge conflicts" + - name: Install GitHub CLI + if: ${{ success() && steps.Check.outputs.skip == 'false' }} + run: sudo apt-get install gh -y + - name: Create branch, push and open PR + if: ${{ success() && steps.Check.outputs.skip == 'false' }} + env: + GH_TOKEN: ${{ secrets.PAT }} + run: | + # 🟢 Option 1: Direkt pushen (Standard) + #git push origin main + + # 🟡 Option 2: PR statt direktem Merge (kommentieren, falls gewünscht) + #echo $GH_TOKEN | gh auth login --with-token + BRANCH="upstream-merge-$(date +%s)" + git checkout -b $BRANCH + git push origin $BRANCH + gh pr create --title "Merge from upstream" --body "Automatisch erstellter PR" --base main --head $BRANCH + - name: Trigger BuildLinux workflow + if: ${{ false && success() && steps.Check.outputs.skip == 'false' }} + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: LinuxBuild.yml + ref: main + token: ${{ secrets.PAT }} + diff --git a/README.md b/README.md index b5825e18f..9aa71585f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ +# Arduino IDE 2.x (Special build) + +### Preface + +This repository is a fork of the official [Arduino IDE](https://github.com/arduino/arduino-ide). +It seams that this project is currently inactive (2 Month no commit). +- My PR [Order custom board option menus as defined in platform configuration](https://github.com/arduino/arduino-ide/pull/2717) ist still not merged. +- There is an additional BUG inside the original AppImage: It fails to run if not started with "--no-sandbxox" (on newer Linux systems). +So this repo will generate only the AppImage that: +- includes my PR +- replaces the executable "chrome-sandbox" included inside the AppImage with a symlink to /opt/google/chrome/chrome-sandbox, that should be exist on most newer Linux systems. + +### Download + +Latest: [Download](/../../releases/latest) + +All Releases: [Releases](/../../releases) + +[![Arduino2 IDE (Linux-AppImage-Build)](https://github.com/gneiss15/arduino-ide/actions/workflows/LinuxBuild.yml/badge.svg)](https://github.com/gneiss15/arduino-ide/actions/workflows/LinuxBuild.yml) +## All Below is from the original "Arduino IDE" Repo +
+ Show # Arduino IDE 2.x @@ -53,3 +75,5 @@ This open source code was written by the Arduino team and is maintained on a dai ## License The code contained in this repository and the executable distributions are licensed under the terms of the GNU AGPLv3. The executable distributions contain third-party code licensed under other compatible licenses such as GPLv2, MIT and BSD-3. If you have questions about licensing please contact us at [license@arduino.cc](mailto:license@arduino.cc). +
+ diff --git a/arduino-ide-extension/src/browser/contributions/boards-data-menu-updater.ts b/arduino-ide-extension/src/browser/contributions/boards-data-menu-updater.ts index 382e0f2ef..a467bb47d 100644 --- a/arduino-ide-extension/src/browser/contributions/boards-data-menu-updater.ts +++ b/arduino-ide-extension/src/browser/contributions/boards-data-menu-updater.ts @@ -7,7 +7,6 @@ import { inject, injectable } from '@theia/core/shared/inversify'; import PQueue from 'p-queue'; import { BoardIdentifier, - ConfigOption, isBoardIdentifierChangeEvent, Programmer, } from '../../common/protocol'; @@ -71,10 +70,11 @@ export class BoardsDataMenuUpdater extends Contribution { ...ArduinoMenus.TOOLS__BOARD_SETTINGS_GROUP, 'z01_boardsConfig', ]; // `z_` is for ordering. - for (const { label, option, values } of configOptions.sort( - ConfigOption.LABEL_COMPARATOR - )) { - const menuPath = [...boardsConfigMenuPath, `${option}`]; + let i:number = 0; + for (const { label, option, values } of configOptions) { + // We want Menu Entries in order of configOptions + const order = String(i++).padStart(4) + const menuPath = [...boardsConfigMenuPath, `${order}`]; const commands = new Map< string, Disposable & { label: string } diff --git a/arduino-ide-extension/src/common/protocol/boards-service.ts b/arduino-ide-extension/src/common/protocol/boards-service.ts index a97dc9057..81c3d8268 100644 --- a/arduino-ide-extension/src/common/protocol/boards-service.ts +++ b/arduino-ide-extension/src/common/protocol/boards-service.ts @@ -377,12 +377,6 @@ export namespace ConfigOption { Object.setPrototypeOf(this, ConfigOptionError.prototype); } } - - export const LABEL_COMPARATOR = (left: ConfigOption, right: ConfigOption) => - naturalCompare( - left.label.toLocaleLowerCase(), - right.label.toLocaleLowerCase() - ); } export interface ConfigValue {