From eece777e285563d51d68d9afd999bbb320594f46 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Tue, 12 Aug 2025 14:11:35 +0200 Subject: [PATCH 01/10] Adding classic confinment support + refactor for later flathub --- .github/workflows/release-gradle.yml | 1 + app/build.gradle.kts | 81 +++++++++++----------------- app/linux/snapcraft.base.yml | 42 +++++++++++++++ 3 files changed, 75 insertions(+), 49 deletions(-) create mode 100644 app/linux/snapcraft.base.yml diff --git a/.github/workflows/release-gradle.yml b/.github/workflows/release-gradle.yml index 16e8984e3b..8ec45cad0b 100644 --- a/.github/workflows/release-gradle.yml +++ b/.github/workflows/release-gradle.yml @@ -153,6 +153,7 @@ jobs: ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.password: ${{ secrets.PROCESSING_APP_PASSWORD }} ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.teamID: ${{ secrets.PROCESSING_TEAM_ID }} ORG_GRADLE_PROJECT_snapname: ${{ vars.SNAP_NAME }} + ORG_GRADLE_PROJECT_snapconfinement: ${{ vars.SNAP_CONFINEMENT }} - name: Sign files with Trusted Signing if: runner.os == 'Windows' diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5323a1a829..b536208583 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -228,61 +228,44 @@ tasks.register("packageCustomMsi"){ tasks.register("generateSnapConfiguration"){ - val name = findProperty("snapname") ?: rootProject.name + onlyIf { OperatingSystem.current().isLinux } + + val distributable = tasks.named("createDistributable").get() + dependsOn(distributable) + + val name = findProperty("snapname") as String? ?: rootProject.name val arch = when (System.getProperty("os.arch")) { "amd64", "x86_64" -> "amd64" "aarch64" -> "arm64" else -> System.getProperty("os.arch") } - - onlyIf { OperatingSystem.current().isLinux } - val distributable = tasks.named("createDistributable").get() - dependsOn(distributable) - + val confinement = findProperty("snapconfinement") as String? ?: "strict" val dir = distributable.destinationDir.get() - val content = """ - name: $name - version: $version - base: core22 - summary: A creative coding editor - description: | - Processing is a flexible software sketchbook and a programming language designed for learning how to code. - confinement: strict - - apps: - processing: - command: opt/processing/bin/Processing - desktop: opt/processing/lib/processing-Processing.desktop - environment: - LD_LIBRARY_PATH: ${'$'}SNAP/opt/processing/lib/runtime/lib:${'$'}LD_LIBRARY_PATH - LIBGL_DRIVERS_PATH: ${'$'}SNAP/usr/lib/${'$'}SNAPCRAFT_ARCH_TRIPLET/dri - plugs: - - desktop - - desktop-legacy - - wayland - - x11 - - network - - opengl - - home - - removable-media - - audio-playback - - audio-record - - pulseaudio - - gpio - - parts: - processing: - plugin: dump - source: deb/processing_$version-1_$arch.deb - source-type: deb - stage-packages: - - openjdk-17-jre - override-prime: | - snapcraftctl prime - rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts - chmod -R +x opt/processing/lib/app/resources/jdk - """.trimIndent() - dir.file("../snapcraft.yaml").asFile.writeText(content) + val base = layout.projectDirectory.file("linux/snapcraft.base.yml") + + doFirst { + + var content = base + .asFile + .readText() + .replace("\$name", name) + .replace("\$arch", arch) + .replace("\$version", version as String) + .replace("\$confinement", confinement) + .let { + if (confinement != "classic") return@let it + // If confinement is not strict, remove the PLUGS section + val start = it.indexOf("# PLUGS START") + val end = it.indexOf("# PLUGS END") + if (start != -1 && end != -1) { + val before = it.substring(0, start) + val after = it.substring(end + "# PLUGS END".length) + return@let before + after + } + return@let it + } + dir.file("../snapcraft.yaml").asFile.writeText(content) + } } tasks.register("packageSnap"){ diff --git a/app/linux/snapcraft.base.yml b/app/linux/snapcraft.base.yml new file mode 100644 index 0000000000..4847f0a7c8 --- /dev/null +++ b/app/linux/snapcraft.base.yml @@ -0,0 +1,42 @@ +name: $name +version: $version +base: core22 +summary: A creative coding editor +description: | + Processing is a flexible software sketchbook and a programming language designed for learning how to code. +confinement: $confinement + +apps: + processing: + command: opt/processing/bin/Processing + desktop: opt/processing/lib/processing-Processing.desktop + environment: + LD_LIBRARY_PATH: $SNAP/opt/processing/lib/runtime/lib:$LD_LIBRARY_PATH + LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri + # PLUGS START + plugs: + - desktop + - desktop-legacy + - wayland + - x11 + - network + - opengl + - home + - removable-media + - audio-playback + - audio-record + - pulseaudio + - gpio + # PLUGS END + +parts: + processing: + plugin: dump + source: deb/processing_$version-1_$arch.deb + source-type: deb + stage-packages: + - openjdk-17-jre + override-prime: | + snapcraftctl prime + rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts + chmod -R +x opt/processing/lib/app/resources/jdk \ No newline at end of file From 193cfac840103b3a3843ebee1dbeca3d58b4a65c Mon Sep 17 00:00:00 2001 From: stefterv Date: Tue, 12 Aug 2025 18:02:07 +0200 Subject: [PATCH 02/10] Flatpak configuration file --- app/linux/org.processing.pde.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/linux/org.processing.pde.yml diff --git a/app/linux/org.processing.pde.yml b/app/linux/org.processing.pde.yml new file mode 100644 index 0000000000..b76bac3be5 --- /dev/null +++ b/app/linux/org.processing.pde.yml @@ -0,0 +1,44 @@ +id: org.processing.processingide +runtime: org.freedesktop.Platform +runtime-version: '24.08' +sdk: org.freedesktop.Sdk +command: processing +finish-args: + - --socket=x11 + - --share=ipc + - --device=all + - --filesystem=home + - --socket=pulseaudio + - --share=network +modules: + - name: "processing" + buildsystem: "simple" + build-commands: + - install -d /app/share/processing + - cp -r app/* /app/share/processing + - install -D processing.sh /app/bin/processing + - install -D src/build/linux/desktop.template /app/share/applications/org.processing.processingide.desktop + - install -D src/build/linux/processing.svg /app/share/icons/hicolor/scalable/apps/org.processing.processingide.svg + - install -D app/lib/app/resources/lib/icons/app-16.png /app/share/icons/hicolor/16x16/apps/org.processing.processingide.png +# # TODO: Add mimetype icons and app icon + sources: + - type: git + url: https://github.com/processing/processing4.git + tag: processing-1304-4.4.4 + dest: src + - type: archive + url: https://github.com/processing/processing4/releases/download/processing-1304-4.4.4/processing-4.4.4-linux-x64-portable.zip + sha256: 8f5141d09c06bc68a3c58ec3bd0e707003a347ea96e742f83f1868b9c460bb6f + only-arches: + - x86_64 + dest: app + - type: archive + url: https://github.com/processing/processing4/releases/download/processing-1304-4.4.4/processing-4.4.4-linux-aarch64-portable.zip + only-arches: + - aarch64 + dest: app + - type: script + dest-filename: "processing.sh" + commands: [ + "exec /app/share/processing/bin/Processing" + ] \ No newline at end of file From 362328abc7345511c86ddac370798818091f4335 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 11:28:24 +0200 Subject: [PATCH 03/10] file-associations --- app/build.gradle.kts | 8 ++-- app/linux/org.processing.pde.yml | 31 +++++++++++--- build/linux/processing-pde.xml | 69 ++++++++++++++++---------------- 3 files changed, 65 insertions(+), 43 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5323a1a829..e64bd2ab92 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -86,10 +86,10 @@ compose.desktop { // Fix fonts on some Linux distributions jvmArgs("-Dawt.useSystemAAFontSettings=on") - fileAssociation("pde", "Processing Source Code", "application/x-processing") - fileAssociation("pyde", "Processing Python Source Code", "application/x-processing") - fileAssociation("pdez", "Processing Sketch Bundle", "application/x-processing") - fileAssociation("pdex", "Processing Contribution Bundle", "application/x-processing") + fileAssociation("pde", "Processing Source Code", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("pyde", "Processing Python Source Code", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("pdez", "Processing Sketch Bundle", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("pdex", "Processing Contribution Bundle", "application/x-processing", rootProject.file("build/shared/lib/icons/pde-1024.png")) } } } diff --git a/app/linux/org.processing.pde.yml b/app/linux/org.processing.pde.yml index b76bac3be5..cc151c3fa3 100644 --- a/app/linux/org.processing.pde.yml +++ b/app/linux/org.processing.pde.yml @@ -1,4 +1,4 @@ -id: org.processing.processingide +id: org.processing.pde runtime: org.freedesktop.Platform runtime-version: '24.08' sdk: org.freedesktop.Sdk @@ -10,6 +10,10 @@ finish-args: - --filesystem=home - --socket=pulseaudio - --share=network + +env: + PROCESSING_ID: "org.processing.pde" + modules: - name: "processing" buildsystem: "simple" @@ -17,10 +21,27 @@ modules: - install -d /app/share/processing - cp -r app/* /app/share/processing - install -D processing.sh /app/bin/processing - - install -D src/build/linux/desktop.template /app/share/applications/org.processing.processingide.desktop - - install -D src/build/linux/processing.svg /app/share/icons/hicolor/scalable/apps/org.processing.processingide.svg - - install -D app/lib/app/resources/lib/icons/app-16.png /app/share/icons/hicolor/16x16/apps/org.processing.processingide.png -# # TODO: Add mimetype icons and app icon + + # Install the desktop file and icon + - install -D src/build/linux/desktop.template /app/share/applications/${PROCESSING_ID}.desktop + - sed -i 's/^Icon=.*/Icon=${PROCESSING_ID}/' /app/share/applications/${PROCESSING_ID}.desktop + + # Install icons in various sizes + - install -D src/build/linux/processing.svg /app/share/icons/hicolor/scalable/apps/${PROCESSING_ID}.svg + - install -D app/lib/app/resources/lib/icons/app-16.png /app/share/icons/hicolor/16x16/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-32.png /app/share/icons/hicolor/32x32/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-48.png /app/share/icons/hicolor/48x48/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-64.png /app/share/icons/hicolor/64x64/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-128.png /app/share/icons/hicolor/128x128/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-256.png /app/share/icons/hicolor/256x256/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/app-512.png /app/share/icons/hicolor/512x512/apps/${PROCESSING_ID}.png + - install -D app/lib/app/resources/lib/icons/pde-16.png /app/share/icons/hicolor/16x16/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-32.png /app/share/icons/hicolor/32x32/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-48.png /app/share/icons/hicolor/48x48/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-64.png /app/share/icons/hicolor/64x64/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-128.png /app/share/icons/hicolor/128x128/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-256.png /app/share/icons/hicolor/256x256/mimetypes/${PROCESSING_ID}-text-x-processing.png + - install -D app/lib/app/resources/lib/icons/pde-512.png /app/share/icons/hicolor/512x512/mimetypes/${PROCESSING_ID}-text-x-processing.png sources: - type: git url: https://github.com/processing/processing4.git diff --git a/build/linux/processing-pde.xml b/build/linux/processing-pde.xml index 3b8a6837be..a869b1977d 100644 --- a/build/linux/processing-pde.xml +++ b/build/linux/processing-pde.xml @@ -2,41 +2,42 @@ Processing source code - شفرة مصدر Processing - Kryničny kod Processing - Изходен код на Processing - codi font en Processing - Processingkildekode - Processing-Quelltext - πηγαίος κώδικας Processing - Processing source code - Processing-fontkodo - código fuente en Processing - Processing iturburu-kodea - Processing-lähdekoodi - code source Processing - cód foinseach Processing - Processing-forráskód - Kode program Processing - Codice sorgente Processing - Processing ソースコード - Processing pradinis kodas - Processing pirmkods - Kod sumber Processing - Processing-kildekode - Processing-broncode - Processing-kjeldekode - Kod źródłowy Processing - código fonte Processing - Código fonte Processing - исходный код Processing - Kod burues Processing - Processing-källkod - Вихідний код на мові Processing - Mã nguồn Processing - Processing 源代码 - Processing 源代碼 + شفرة مصدر Processing + Kryničny kod Processing + Изходен код на Processing + codi font en Processing + Processingkildekode + Processing-Quelltext + πηγαίος κώδικας Processing + Processing source code + Processing-fontkodo + código fuente en Processing + Processing iturburu-kodea + Processing-lähdekoodi + code source Processing + cód foinseach Processing + Processing-forráskód + Kode program Processing + Codice sorgente Processing + Processing ソースコード + Processing pradinis kodas + Processing pirmkods + Kod sumber Processing + Processing-kildekode + Processing-broncode + Processing-kjeldekode + Kod źródłowy Processing + código fonte Processing + Código fonte Processing + исходный код Processing + Kod burues Processing + Processing-källkod + Вихідний код на мові Processing + Mã nguồn Processing + Processing 源代码 + Processing 源代碼 + From 562a018d0b9b4eedfc0c704c75e7f4ad407d4094 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 12:40:59 +0200 Subject: [PATCH 04/10] Fixing file associations --- app/build.gradle.kts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e64bd2ab92..241460758e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -80,16 +80,17 @@ compose.desktop { upgradeUuid = "89d8d7fe-5602-4b12-ba10-0fe78efbd602" } linux { - appCategory = "Programming" + debMaintainer = "hello@processing.org" menuGroup = "Development;Programming;" + appCategory = "Programming" iconFile = rootProject.file("build/linux/processing.png") // Fix fonts on some Linux distributions jvmArgs("-Dawt.useSystemAAFontSettings=on") - fileAssociation("pde", "Processing Source Code", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("pyde", "Processing Python Source Code", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("pdez", "Processing Sketch Bundle", "application/x-processing",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("pdex", "Processing Contribution Bundle", "application/x-processing", rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-1024.png")) } } } From fd1473d1373312b87d5d01c55552188a3b5f19ea Mon Sep 17 00:00:00 2001 From: stefterv Date: Wed, 13 Aug 2025 13:12:08 +0200 Subject: [PATCH 05/10] Flatpak configuration file --- app/linux/org.processing.pde.yml | 68 ++++++++++---------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/app/linux/org.processing.pde.yml b/app/linux/org.processing.pde.yml index cc151c3fa3..2d14a06695 100644 --- a/app/linux/org.processing.pde.yml +++ b/app/linux/org.processing.pde.yml @@ -2,7 +2,7 @@ id: org.processing.pde runtime: org.freedesktop.Platform runtime-version: '24.08' sdk: org.freedesktop.Sdk -command: processing +command: Processing finish-args: - --socket=x11 - --share=ipc @@ -11,55 +11,29 @@ finish-args: - --socket=pulseaudio - --share=network -env: - PROCESSING_ID: "org.processing.pde" - modules: - - name: "processing" - buildsystem: "simple" + - name: Processing + buildsystem: simple build-commands: - - install -d /app/share/processing - - cp -r app/* /app/share/processing - - install -D processing.sh /app/bin/processing + # Unpack Processing deb + - ar x processing.deb + - tar --zstd -xf data.tar.zst + - mv opt/processing/* /app/ + - find /app/lib/app/resources/jdk/bin -type f -exec chmod +x {} + + # Install the desktop file and icon - - install -D src/build/linux/desktop.template /app/share/applications/${PROCESSING_ID}.desktop - - sed -i 's/^Icon=.*/Icon=${PROCESSING_ID}/' /app/share/applications/${PROCESSING_ID}.desktop + - install -D /app/lib/processing-Processing.desktop /app/share/applications/org.processing.pde.desktop + - sed -i 's/^Icon=.*/Icon=org.processing.pde/' /app/share/applications/org.processing.pde.desktop + - sed -i 's/^Exec=.*/Exec=\/app\/bin\/Processing/' /app/share/applications/org.processing.pde.desktop + + # Install the mimetype info + - install -D /app/lib/processing-Processing-MimeInfo.xml /app/share/mime/packages/org.processing.pde.xml + +# - install -D /app/lib/Processing.png /app/share/icons/hicolor/512x512/apps/org.processing.pde.png +# - install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/org.processing.pde-text-x-processing.png - # Install icons in various sizes - - install -D src/build/linux/processing.svg /app/share/icons/hicolor/scalable/apps/${PROCESSING_ID}.svg - - install -D app/lib/app/resources/lib/icons/app-16.png /app/share/icons/hicolor/16x16/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-32.png /app/share/icons/hicolor/32x32/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-48.png /app/share/icons/hicolor/48x48/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-64.png /app/share/icons/hicolor/64x64/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-128.png /app/share/icons/hicolor/128x128/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-256.png /app/share/icons/hicolor/256x256/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/app-512.png /app/share/icons/hicolor/512x512/apps/${PROCESSING_ID}.png - - install -D app/lib/app/resources/lib/icons/pde-16.png /app/share/icons/hicolor/16x16/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-32.png /app/share/icons/hicolor/32x32/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-48.png /app/share/icons/hicolor/48x48/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-64.png /app/share/icons/hicolor/64x64/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-128.png /app/share/icons/hicolor/128x128/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-256.png /app/share/icons/hicolor/256x256/mimetypes/${PROCESSING_ID}-text-x-processing.png - - install -D app/lib/app/resources/lib/icons/pde-512.png /app/share/icons/hicolor/512x512/mimetypes/${PROCESSING_ID}-text-x-processing.png sources: - - type: git - url: https://github.com/processing/processing4.git - tag: processing-1304-4.4.4 - dest: src - - type: archive - url: https://github.com/processing/processing4/releases/download/processing-1304-4.4.4/processing-4.4.4-linux-x64-portable.zip - sha256: 8f5141d09c06bc68a3c58ec3bd0e707003a347ea96e742f83f1868b9c460bb6f - only-arches: - - x86_64 - dest: app - - type: archive - url: https://github.com/processing/processing4/releases/download/processing-1304-4.4.4/processing-4.4.4-linux-aarch64-portable.zip - only-arches: - - aarch64 - dest: app - - type: script - dest-filename: "processing.sh" - commands: [ - "exec /app/share/processing/bin/Processing" - ] \ No newline at end of file + - type: file + path: ../build/compose/binaries/main/deb/processing_1.0.0-1_amd64.deb + dest-filename: processing.deb \ No newline at end of file From b338d518d7bffda5f54b15ff2c3ce6eb726572e1 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 14:29:24 +0200 Subject: [PATCH 06/10] file association fix --- app/build.gradle.kts | 8 ++++---- app/linux/org.processing.pde.yml | 3 +-- build/shared/lib/icons/app-linux.svg | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 build/shared/lib/icons/app-linux.svg diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 31462fdff6..8212b879bd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -87,10 +87,10 @@ compose.desktop { // Fix fonts on some Linux distributions jvmArgs("-Dawt.useSystemAAFontSettings=on") - fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-1024.png")) - fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-1024.png")) + fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-512.png")) + fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-512.png")) + fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-512.png")) + fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-512.png")) } } } diff --git a/app/linux/org.processing.pde.yml b/app/linux/org.processing.pde.yml index 2d14a06695..587bc22236 100644 --- a/app/linux/org.processing.pde.yml +++ b/app/linux/org.processing.pde.yml @@ -21,7 +21,6 @@ modules: - mv opt/processing/* /app/ - find /app/lib/app/resources/jdk/bin -type f -exec chmod +x {} + - # Install the desktop file and icon - install -D /app/lib/processing-Processing.desktop /app/share/applications/org.processing.pde.desktop - sed -i 's/^Icon=.*/Icon=org.processing.pde/' /app/share/applications/org.processing.pde.desktop @@ -31,7 +30,7 @@ modules: - install -D /app/lib/processing-Processing-MimeInfo.xml /app/share/mime/packages/org.processing.pde.xml # - install -D /app/lib/Processing.png /app/share/icons/hicolor/512x512/apps/org.processing.pde.png -# - install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/org.processing.pde-text-x-processing.png + - install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/org.processing.pde-text-x-processing.png sources: - type: file diff --git a/build/shared/lib/icons/app-linux.svg b/build/shared/lib/icons/app-linux.svg new file mode 100644 index 0000000000..9b5ccd52b1 --- /dev/null +++ b/build/shared/lib/icons/app-linux.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + From 39e2d03ce99d943579d07d1a46a337d730e03e23 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 14:41:25 +0200 Subject: [PATCH 07/10] delete legacy build system --- .github/workflows/build.yml | 77 ------------------- .github/workflows/lock.yml | 29 ------- .github/workflows/pull_request.yml | 63 --------------- .github/workflows/release.yml | 118 ----------------------------- 4 files changed, 287 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/lock.yml delete mode 100644 .github/workflows/pull_request.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b1b7f9ad62..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Branch Builds (Legacy) -on: - push: - paths-ignore: - - '**/*.md' - - '.all-contributorsrc' - -jobs: - test: - runs-on: ubuntu-latest - name: Run Tests - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: x64 - - name: Build - run: > - cd build; - ant -noinput build test; - build: - name: Create Pre-release for ${{ matrix.os_prefix }} (${{ matrix.arch }}) - needs: test - runs-on: ${{ matrix.os }} - permissions: - contents: write - strategy: - fail-fast: false - matrix: - include: - # compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit) - - os: [self-hosted, linux, ARM] - os_prefix: linux - arch: arm - - os: ubuntu-latest - os_prefix: linux - arch: x64 - - os: windows-latest - os_prefix: windows - arch: x64 - - os: macos-latest - os_prefix: macos - arch: x64 - - os: macos-latest - os_prefix: macos - arch: aarch64 - - os: macos-latest - os_prefix: linux - arch: aarch64 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Checkout Examples Repository - uses: actions/checkout@v4 - with: - repository: processing/processing-examples - path: processing-examples - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Ant - uses: cedx/setup-ant@v3 - - name: Build Release - run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ github.sha }}" - - name: Add artifact - uses: actions/upload-artifact@v4 - with: - name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-ant - path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-* - retention-days: 1 diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 1997a5a4e9..0000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '0 6 * * *' - -permissions: - contents: read - -jobs: - lock: - permissions: - issues: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v4 - with: - github-token: ${{ github.token }} - issue-lock-inactive-days: '30' - issue-lock-comment: > - This issue has been automatically locked. To avoid confusion - with reports that have already been resolved, closed issues - are automatically locked 30 days after the last comment. - Please open a new issue for related bugs. - pr-lock-comment: > - This pull request has been automatically locked. - Pull requests that have been closed are automatically - locked 30 days after the last comment. diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 5831a166a4..0000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Pull Requests (Legacy) -on: - pull_request: - paths-ignore: - - '**/*.md' - branches: - - main - -jobs: - build: - name: Create Pull Request Build for ${{ matrix.os_prefix }} (${{ matrix.arch }}) - runs-on: ${{ matrix.os }} - permissions: - pull-requests: write - contents: read - strategy: - fail-fast: false - matrix: - include: - # compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit) - - os: [self-hosted, linux, ARM] - os_prefix: linux - arch: arm - - os: ubuntu-latest - os_prefix: linux - arch: x64 - - os: windows-latest - os_prefix: windows - arch: x64 - - os: macos-latest - os_prefix: macos - arch: x64 - - os: macos-latest - os_prefix: macos - arch: aarch64 - - os: macos-latest - os_prefix: linux - arch: aarch64 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Checkout Examples Repository - uses: actions/checkout@v4 - with: - repository: processing/processing-examples - path: processing-examples - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Ant - uses: cedx/setup-ant@v3 - - name: Build Release - run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ github.sha }}" -Dplatform=${{ matrix.os_prefix }} - - name: Add artifact - uses: actions/upload-artifact@v4 - id: upload - with: - name: processing-pr${{ github.event.pull_request.number }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-ant - path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-* - retention-days: 5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index bf4d33cd89..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Releases (Legacy) -on: - release: - types: [published] - -jobs: - version: - runs-on: ubuntu-latest - outputs: - build_number: ${{ steps.tag_info.outputs.build_number }} - version: ${{ steps.tag_info.outputs.version }} - steps: - - name: Extract version and build number - id: tag_info - shell: bash - run: | - TAG_NAME="${GITHUB_REF#refs/tags/}" - BUILD_NUMBER=$(echo "$TAG_NAME" | cut -d'-' -f2) - VERSION=$(echo "$TAG_NAME" | cut -d'-' -f3) - - # Set outputs for use in later jobs or steps - echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT - echo "version=$VERSION" >> $GITHUB_OUTPUT - publish: - name: Publish Processing Core to Maven Central - runs-on: ubuntu-latest - needs: version - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Build with Gradle - run: ./gradlew publish - env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} - - ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} - build: - name: Publish Release for ${{ matrix.os_prefix }} (${{ matrix.arch }}) - runs-on: ${{ matrix.os }} - needs: version - permissions: - contents: write - strategy: - fail-fast: false - matrix: - include: - # compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit) - - os: [self-hosted, linux, ARM] - os_prefix: linux - arch: arm - - os: ubuntu-latest - os_prefix: linux - arch: x64 - - os: windows-latest - os_prefix: windows - arch: x64 - - os: macos-latest - os_prefix: macos - arch: x64 - - os: macos-latest - os_prefix: macos - arch: aarch64 - - os: macos-latest - os_prefix: linux - arch: aarch64 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Checkout Examples Repository - uses: actions/checkout@v4 - with: - repository: processing/processing-examples - path: processing-examples - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Ant - uses: cedx/setup-ant@v3 - - name: Write build_number and revision to todo.txt and Base.java - run: | - echo "${{ needs.version.outputs.build_number }} (${{ needs.version.outputs.version }})" > todo.txt - perl -pi -e 's/static private final int REVISION = \d+;/static private final int REVISION = ${{ needs.version.outputs.build_number }};/g; s/static private String VERSION_NAME = "\d+";\s*\/\/\$NON-NLS-1\$/static private String VERSION_NAME = "${{ needs.version.outputs.build_number }}"; \/\/\$NON-NLS-1\$/g' app/src/processing/app/Base.java - - name: Install Certificates for Code Signing - if: ${{ matrix.os_prefix == 'macos' }} - uses: apple-actions/import-codesign-certs@v3 - with: - p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} - p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} - - name: Build Release - run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ needs.version.outputs.version }}" -Dplatform=${{ matrix.os_prefix }} - env: - PROCESSING_APP_SIGNING: true - PROCESSING_APP_PASSWORD: ${{ secrets.PROCESSING_APP_PASSWORD }} - PROCESSING_APPLE_ID: ${{ secrets.PROCESSING_APPLE_ID }} - PROCESSING_TEAM_ID: ${{ secrets.PROCESSING_TEAM_ID }} - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./build/${{ matrix.os_prefix }}/processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix}}-* - file_glob: true From 8c3cd277243bf1b20257cceb7a51469c237d64fa Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 14:42:27 +0200 Subject: [PATCH 08/10] Rename action files --- .github/workflows/{build-gradle.yml => build.yml} | 0 .github/workflows/{pull_request-gradle.yml => pr.yml} | 0 .github/workflows/{release-gradle.yml => release.yml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-gradle.yml => build.yml} (100%) rename .github/workflows/{pull_request-gradle.yml => pr.yml} (100%) rename .github/workflows/{release-gradle.yml => release.yml} (100%) diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build-gradle.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/pull_request-gradle.yml b/.github/workflows/pr.yml similarity index 100% rename from .github/workflows/pull_request-gradle.yml rename to .github/workflows/pr.yml diff --git a/.github/workflows/release-gradle.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release-gradle.yml rename to .github/workflows/release.yml From ab3ce636148c0f0825a656fe08b5a3b1bf3356b5 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 13 Aug 2025 15:08:38 +0200 Subject: [PATCH 09/10] Github actions simplification --- .github/actions/setup/action.yml | 18 ++ .github/workflows/build.yml | 40 +-- .github/workflows/pr.yml | 32 +- .github/workflows/release.yml | 300 +++++++++++++----- app/build.gradle.kts | 150 ++++++--- .../{org.processing.pde.yml => flathub.yml} | 16 +- .../{snapcraft.base.yml => snapcraft.yml} | 2 +- 7 files changed, 384 insertions(+), 174 deletions(-) create mode 100644 .github/actions/setup/action.yml rename app/linux/{org.processing.pde.yml => flathub.yml} (67%) rename app/linux/{snapcraft.base.yml => snapcraft.yml} (95%) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000000..cc65b83095 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,18 @@ +name: "Setup Processing" +description: "Setup the required contents for Processing to build" +inputs: + arch: + description: 'Architecture of the JDK to download' + required: false +runs: + using: "composite" + steps: + - name: Install Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + architecture: ${{ inputs.arch }} + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 254433edd0..53944d10df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,12 @@ on: paths-ignore: - '**/*.md' - '.all-contributorsrc' + pull_request: + paths-ignore: + - '**/*.md' + branches: + - main + jobs: test: @@ -12,13 +18,9 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + + - name: Setup Processing + uses: ./.github/actions/setup - name: Build with Gradle run: ./gradlew test @@ -33,11 +35,11 @@ jobs: - os: ubuntu-24.04-arm os_prefix: linux arch: aarch64 - binary: processing*.snap + binary: deb/processing*.deb - os: ubuntu-latest os_prefix: linux arch: x64 - binary: processing*.snap + binary: deb/processing*.deb - os: windows-latest os_prefix: windows arch: x64 @@ -51,25 +53,13 @@ jobs: arch: aarch64 binary: dmg/Processing-*.dmg steps: - - name: Install Snapcraft - if: runner.os == 'Linux' - uses: samuelmeuli/action-snapcraft@v3 - - name: Install LXD - if: runner.os == 'Linux' - uses: canonical/setup-lxd@main - - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Build with Gradle + - name: Setup Processing + uses: ./.github/actions/setup + + - name: Package Processing with Gradle run: ./gradlew packageDistributionForCurrentOS - name: Add artifact diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4ea0bcc9db..c822c46e7d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,13 +13,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'temurin' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + fetch-depth: 0 + + - name: Setup Processing + uses: ./.github/actions/setup - name: Build with Gradle run: ./gradlew test @@ -34,11 +32,11 @@ jobs: - os: ubuntu-24.04-arm os_prefix: linux arch: aarch64 - binary: processing*.snap + binary: deb/processing*.deb - os: ubuntu-latest os_prefix: linux arch: x64 - binary: processing*.snap + binary: deb/processing*.deb - os: windows-latest os_prefix: windows arch: x64 @@ -52,23 +50,11 @@ jobs: arch: aarch64 binary: dmg/Processing-*.dmg steps: - - name: Install Snapcraft - if: runner.os == 'Linux' - uses: samuelmeuli/action-snapcraft@v3 - - name: Install LXD - if: runner.os == 'Linux' - uses: canonical/setup-lxd@main - - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + + - name: Setup Processing + uses: ./.github/actions/setup - name: Build with Gradle run: ./gradlew packageDistributionForCurrentOS diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ec45cad0b..e8de46389b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,20 +49,16 @@ jobs: asset_name: processing-${{ needs.version.outputs.version }}-reference.zip file: reference.zip - publish: + publish-maven: name: Publish Processing Libraries to Maven Central runs-on: ubuntu-latest needs: version steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + + - name: Setup Processing + uses: ./.github/actions/setup - name: Build with Gradle run: ./gradlew publish @@ -78,8 +74,8 @@ jobs: ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} - build: - name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Release + release-windows: + name: (windows/${{ matrix.arch }}) Create Processing Release runs-on: ${{ matrix.os }} needs: version permissions: @@ -88,57 +84,16 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-24.04-arm - os_prefix: linux - arch: aarch64 - binary: ${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_arm64 - extension: snap - - os: ubuntu-latest - os_prefix: linux - arch: x64 - binary: ${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_amd64 - extension: snap - - os: windows-latest - os_prefix: windows - arch: x64 - binary: msi/Processing-${{ needs.version.outputs.version }} - extension: msi - - os: macos-latest - os_prefix: macos - arch: x64 - binary: dmg/Processing-${{ needs.version.outputs.version }} - extension: dmg - - os: macos-latest - os_prefix: macos - arch: aarch64 - binary: dmg/Processing-${{ needs.version.outputs.version }} - extension: dmg + - arch: x64 + os: windows-latest +# - arch: aarch64 +# os: windows-11-arm steps: - - name: Install Certificates for Code Signing - if: runner.os == 'macOS' - continue-on-error: true - uses: apple-actions/import-codesign-certs@v3 - with: - p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} - p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} - - - name: Install Snapcraft - if: runner.os == 'Linux' - uses: samuelmeuli/action-snapcraft@v3 - - name: Install LXD - if: runner.os == 'Linux' - uses: canonical/setup-lxd@main - - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Java - uses: actions/setup-java@v4 - with: - java-version: '17.0.8' - distribution: 'temurin' - architecture: ${{ matrix.arch }} - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + + - name: Setup Processing + uses: ./.github/actions/setup - name: Build with Gradle run: ./gradlew packageDistributionForCurrentOS @@ -146,17 +101,8 @@ jobs: ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} - ORG_GRADLE_PROJECT_compose.desktop.verbose: true - ORG_GRADLE_PROJECT_compose.desktop.mac.sign: ${{ secrets.PROCESSING_SIGNING }} - ORG_GRADLE_PROJECT_compose.desktop.mac.signing.identity: ${{ secrets.PROCESSING_SIGNING_IDENTITY }} - ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.appleID: ${{ secrets.PROCESSING_APPLE_ID }} - ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.password: ${{ secrets.PROCESSING_APP_PASSWORD }} - ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.teamID: ${{ secrets.PROCESSING_TEAM_ID }} - ORG_GRADLE_PROJECT_snapname: ${{ vars.SNAP_NAME }} - ORG_GRADLE_PROJECT_snapconfinement: ${{ vars.SNAP_CONFINEMENT }} - + - name: Sign files with Trusted Signing - if: runner.os == 'Windows' uses: azure/trusted-signing-action@v0 with: azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -171,24 +117,230 @@ jobs: timestamp-rfc3161: http://timestamp.acs.microsoft.com timestamp-digest: SHA256 + - name: Upload portable version + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-windows-${{ matrix.arch }}-portable.zip + file: app/build/compose/binaries/main/Processing-${{ needs.version.outputs.version }}.zip + + - name: Upload installer + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-windows-${{ matrix.arch }}.msi + file: app/build/compose/binaries/main/msi/Processing-${{ needs.version.outputs.version }}.msi + + release-macos: + name: (macOS/${{ matrix.arch }}) Create Processing Release + runs-on: macos-latest + needs: version + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + - arch: aarch64 + steps: + - name: Install Certificates for Code Signing + continue-on-error: true + uses: apple-actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} + p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} + + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Processing + uses: ./.github/actions/setup + with: + arch: ${{ matrix.arch }} + + - name: Build with Gradle + run: ./gradlew packageDistributionForCurrentOS + env: + ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} + ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} + ORG_GRADLE_PROJECT_compose.desktop.verbose: true + ORG_GRADLE_PROJECT_compose.desktop.mac.sign: ${{ secrets.PROCESSING_SIGNING }} + ORG_GRADLE_PROJECT_compose.desktop.mac.signing.identity: ${{ secrets.PROCESSING_SIGNING_IDENTITY }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.appleID: ${{ secrets.PROCESSING_APPLE_ID }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.password: ${{ secrets.PROCESSING_APP_PASSWORD }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.teamID: ${{ secrets.PROCESSING_TEAM_ID }} + - name: Upload portables to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - asset_name: processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix }}-${{ matrix.arch }}-portable.zip + asset_name: processing-${{ needs.version.outputs.version }}-macos-${{ matrix.arch }}-portable.zip file: app/build/compose/binaries/main/Processing-${{ needs.version.outputs.version }}.zip - name: Upload installers to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - asset_name: processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix }}-${{ matrix.arch }}.${{ matrix.extension }} - file: app/build/compose/binaries/main/${{ matrix.binary }}.${{ matrix.extension }} + asset_name: processing-${{ needs.version.outputs.version }}-macos-${{ matrix.arch }}.dmg + file: app/build/compose/binaries/main/dmg/Processing-${{ needs.version.outputs.version }}.dmg + + release-linux: + name: (linux/${{ matrix.arch }}) Create Processing Release + runs-on: ${{ matrix.os }} + needs: version + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: aarch64 + deb: arm64 + - os: ubuntu-latest + arch: x64 + deb: amd64 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Processing + uses: ./.github/actions/setup + + - name: Build with Gradle + run: ./gradlew packageDistributionForCurrentOS + env: + ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} + ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} + ORG_GRADLE_PROJECT_compose.desktop.verbose: true + + - name: Upload portable to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-linux-${{ matrix.arch }}-portable.zip + file: app/build/compose/binaries/main/Processing-${{ needs.version.outputs.version }}.zip + + - name: Upload installer to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-linux-${{ matrix.arch }}.deb + file: app/build/compose/binaries/main/deb/processing_${{ needs.version.outputs.version }}-1_${{ matrix.deb }}.deb + + - name: Add artifact + uses: actions/upload-artifact@v4 + with: + name: processing_${{ needs.version.outputs.version }}-1_${{ matrix.deb }}.deb + retention-days: 1 + path: app/build/compose/binaries/main/deb/processing_${{ needs.version.outputs.version }}-1_${{ matrix.deb }}.deb + + release-linux-snap: + name: (linux/${{ matrix.arch }}) Create Processing Snap Release + runs-on: ${{ matrix.os }} + needs: [version, release-linux] + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: aarch64 + deb: arm64 + - os: ubuntu-latest + arch: x64 + deb: amd64 + steps: + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v3 + + - name: Install LXD + uses: canonical/setup-lxd@main + + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: processing_${{ needs.version.outputs.version }}-1_${{ matrix.deb }}.deb + path: app/build/compose/binaries/main/deb/ + + - name: Build with Gradle + run: ./gradlew packageSnap + env: + ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} + ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} + ORG_GRADLE_PROJECT_snapname: ${{ vars.SNAP_NAME }} + ORG_GRADLE_PROJECT_snapconfinement: ${{ vars.SNAP_CONFINEMENT }} + + - name: Upload snap to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-linux-${{ matrix.arch }}.snap + file: app/build/compose/binaries/main/${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_${{ matrix.deb }}.snap - name: Upload snap to Snap Store - if: runner.os == 'Linux' - run: snapcraft upload --release=beta app/build/compose/binaries/main/${{ matrix.binary }}.${{ matrix.extension }} + run: snapcraft upload --release=beta app/build/compose/binaries/main/${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_${{ matrix.deb }}.snap env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.PROCESSING_SNAPCRAFT_TOKEN }} + release-linux-flatpak: + name: (linux/${{ matrix.arch }}) Create Processing Flatpak Release + runs-on: ${{ matrix.os }} + needs: [ version, release-linux ] + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48 + options: --privileged + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: aarch64 + deb: arm64 + farch: aarch64 + - os: ubuntu-latest + arch: x64 + deb: amd64 + farch: x86_64 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: processing_${{ needs.version.outputs.version }}-1_${{ matrix.deb }}.deb + path: app/build/compose/binaries/main/deb/ - \ No newline at end of file + - name: Setup Processing + uses: ./.github/actions/setup + + - name: Build with Gradle + run: ./gradlew generateFlatpakConfiguration + env: + ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} + ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} + + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: processing.flatpak + manifest-path: app/build/compose/binaries/main/flatpak/org.processing.pde.yml + cache-key: flatpak-builder-${{ github.sha }} + arch: ${{ matrix.farch }} + + - name: Upload Flatpak to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-linux-${{ matrix.arch }}.flatpak + file: processing.flatpak \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8212b879bd..fe75a1afd0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -159,6 +159,12 @@ tasks.register("lsp-develop"){ } val version = if(project.version == "unspecified") "1.0.0" else project.version +val distributable = { tasks.named("createDistributable").get() } +val arch = when (System.getProperty("os.arch")) { + "amd64", "x86_64" -> "amd64" + "aarch64" -> "arm64" + else -> System.getProperty("os.arch") +} tasks.register("installCreateDmg") { onlyIf { OperatingSystem.current().isMacOsX } @@ -168,11 +174,10 @@ tasks.register("packageCustomDmg"){ onlyIf { OperatingSystem.current().isMacOsX } group = "compose desktop" - val distributable = tasks.named("createDistributable").get() - dependsOn(distributable, "installCreateDmg") + dependsOn(distributable(), "installCreateDmg") - val packageName = distributable.packageName.get() - val dir = distributable.destinationDir.get() + val packageName = distributable().packageName.get() + val dir = distributable().destinationDir.get() val dmg = dir.file("../dmg/$packageName-$version.dmg").asFile val app = dir.file("$packageName.app").asFile @@ -227,64 +232,123 @@ tasks.register("packageCustomMsi"){ ) } - tasks.register("generateSnapConfiguration"){ - onlyIf { OperatingSystem.current().isLinux } - - val distributable = tasks.named("createDistributable").get() - dependsOn(distributable) - val name = findProperty("snapname") as String? ?: rootProject.name - val arch = when (System.getProperty("os.arch")) { - "amd64", "x86_64" -> "amd64" - "aarch64" -> "arm64" - else -> System.getProperty("os.arch") + val confinement = (findProperty("snapconfinement") as String?).takeIf { !it.isNullOrBlank() } ?: "strict" + val dir = distributable().destinationDir.get() + val base = layout.projectDirectory.file("linux/snapcraft.yml") + + doFirst { + replaceVariablesInFile( + base, + dir.file("../snapcraft.yaml"), + mapOf( + "name" to name, + "arch" to arch, + "version" to version as String, + "confinement" to confinement, + "deb" to "deb/${rootProject.name}_${version}-1_${arch}.deb" + ), + if (confinement == "classic") listOf("PLUGS") else emptyList() + ) } - val confinement = findProperty("snapconfinement") as String? ?: "strict" - val dir = distributable.destinationDir.get() - val base = layout.projectDirectory.file("linux/snapcraft.base.yml") +} +tasks.register("generateFlatpakConfiguration"){ + val identifier = findProperty("flathubidentifier") as String? ?: "org.processing.pde" + + val dir = distributable().destinationDir.get() + val base = layout.projectDirectory.file("linux/flathub.yml") doFirst { + replaceVariablesInFile( + base, + dir.file("../flatpak/$identifier.yml"), + mapOf( + "identifier" to identifier, + "deb" to dir.file("../deb/${rootProject.name}_${version}-1_${arch}.deb").asFile.absolutePath + ), + emptyList() + ) + } +} - var content = base - .asFile - .readText() - .replace("\$name", name) - .replace("\$arch", arch) - .replace("\$version", version as String) - .replace("\$confinement", confinement) - .let { - if (confinement != "classic") return@let it - // If confinement is not strict, remove the PLUGS section - val start = it.indexOf("# PLUGS START") - val end = it.indexOf("# PLUGS END") - if (start != -1 && end != -1) { - val before = it.substring(0, start) - val after = it.substring(end + "# PLUGS END".length) - return@let before + after - } - return@let it +fun replaceVariablesInFile( + source: RegularFile, + target: RegularFile, + variables: Map, + sections: List +){ + var content = source.asFile.readText() + for ((key, value) in variables) { + content = content.replace("\$$key", value) + } + if (sections.isNotEmpty()) { + for (section in sections) { + val start = content.indexOf("# $section START") + val end = content.indexOf("# $section END") + if (start != -1 && end != -1) { + val before = content.substring(0, start) + val after = content.substring(end + "# $section END".length) + content = before + after } - dir.file("../snapcraft.yaml").asFile.writeText(content) + } } + target.asFile.parentFile.mkdirs() + target.asFile.writeText(content) } tasks.register("packageSnap"){ onlyIf { OperatingSystem.current().isLinux } - dependsOn("packageDeb", "generateSnapConfiguration") + dependsOn("generateSnapConfiguration") group = "compose desktop" - val distributable = tasks.named("createDistributable").get() - workingDir = distributable.destinationDir.dir("../").get().asFile + workingDir = distributable().destinationDir.dir("../").get().asFile commandLine("snapcraft") } + +tasks.register("buildFlatpak"){ + onlyIf { OperatingSystem.current().isLinux } + dependsOn("generateFlatpakConfiguration") + group = "compose desktop" + + val dir = distributable().destinationDir.get() + val identifier = findProperty("flathubidentifier") as String? ?: "org.processing.pde" + + workingDir = dir.file("../flatpak").asFile + commandLine( + "flatpak-builder", + "--install-deps-from=https://flathub.org/repo/flathub.flatpakrepo", + "--user", + "--force-clean", + "--repo=repo", + "output", + "$identifier.yml" + ) +} + +tasks.register("packageFlatpak"){ + onlyIf { OperatingSystem.current().isLinux } + dependsOn("buildFlatpak") + group = "compose desktop" + + val dir = distributable().destinationDir.get() + val identifier = findProperty("flathubidentifier") as String? ?: "org.processing.pde" + + workingDir = dir.file("../flatpak").asFile + commandLine( + "flatpak", + "build-bundle", + "./repo", + "$identifier.flatpak", + identifier + ) +} tasks.register("zipDistributable"){ dependsOn("createDistributable", "setExecutablePermissions") group = "compose desktop" - val distributable = tasks.named("createDistributable").get() - val dir = distributable.destinationDir.get() - val packageName = distributable.packageName.get() + val dir = distributable().destinationDir.get() + val packageName = distributable().packageName.get() from(dir){ eachFile{ permissions{ unix("755") } } } archiveBaseName.set(packageName) @@ -310,7 +374,7 @@ afterEvaluate{ ){ dependsOn("notarizeDmg") } - dependsOn("packageSnap", "zipDistributable") + dependsOn("zipDistributable") } } diff --git a/app/linux/org.processing.pde.yml b/app/linux/flathub.yml similarity index 67% rename from app/linux/org.processing.pde.yml rename to app/linux/flathub.yml index 587bc22236..c92ab17d9d 100644 --- a/app/linux/org.processing.pde.yml +++ b/app/linux/flathub.yml @@ -1,4 +1,4 @@ -id: org.processing.pde +id: $identifier runtime: org.freedesktop.Platform runtime-version: '24.08' sdk: org.freedesktop.Sdk @@ -22,17 +22,17 @@ modules: - find /app/lib/app/resources/jdk/bin -type f -exec chmod +x {} + # Install the desktop file and icon - - install -D /app/lib/processing-Processing.desktop /app/share/applications/org.processing.pde.desktop - - sed -i 's/^Icon=.*/Icon=org.processing.pde/' /app/share/applications/org.processing.pde.desktop - - sed -i 's/^Exec=.*/Exec=\/app\/bin\/Processing/' /app/share/applications/org.processing.pde.desktop + - install -D /app/lib/processing-Processing.desktop /app/share/applications/$identifier.desktop + - sed -i 's/^Icon=.*/Icon=$identifier/' /app/share/applications/$identifier.desktop + - sed -i 's/^Exec=.*/Exec=\/app\/bin\/Processing/' /app/share/applications/$identifier.desktop # Install the mimetype info - - install -D /app/lib/processing-Processing-MimeInfo.xml /app/share/mime/packages/org.processing.pde.xml + - install -D /app/lib/processing-Processing-MimeInfo.xml /app/share/mime/packages/$identifier.xml -# - install -D /app/lib/Processing.png /app/share/icons/hicolor/512x512/apps/org.processing.pde.png - - install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/org.processing.pde-text-x-processing.png +# - install -D /app/lib/Processing.png /app/share/icons/hicolor/512x512/apps/$identifier.png + - install -D /app/lib/application-x-processing.png /app/share/icons/hicolor/512x512/mimetypes/$identifier-text-x-processing.png sources: - type: file - path: ../build/compose/binaries/main/deb/processing_1.0.0-1_amd64.deb + path: $deb dest-filename: processing.deb \ No newline at end of file diff --git a/app/linux/snapcraft.base.yml b/app/linux/snapcraft.yml similarity index 95% rename from app/linux/snapcraft.base.yml rename to app/linux/snapcraft.yml index 4847f0a7c8..8206681ef0 100644 --- a/app/linux/snapcraft.base.yml +++ b/app/linux/snapcraft.yml @@ -32,7 +32,7 @@ apps: parts: processing: plugin: dump - source: deb/processing_$version-1_$arch.deb + source: $deb source-type: deb stage-packages: - openjdk-17-jre From 624fdf3a642a746a1ecb2e90cb5641771b87325e Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Wed, 27 Aug 2025 16:34:20 +0200 Subject: [PATCH 10/10] Adding File associastions on macOS and Windows through the same system as Linux --- app/build.gradle.kts | 12 ++++++--- app/macos/info.plist | 59 -------------------------------------------- 2 files changed, 8 insertions(+), 63 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fe75a1afd0..3161991c0d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -63,6 +63,14 @@ compose.desktop { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "Processing" + + + + fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-512.png"), rootProject.file("build/windows/pde.ico"), rootProject.file("build/macos/pde.icns")) + fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-512.png"), rootProject.file("build/windows/pde.ico"), rootProject.file("build/macos/pde.icns")) + fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-512.png"), rootProject.file("build/windows/pdze.ico"), rootProject.file("build/macos/pdez.icns")) + fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-512.png"), rootProject.file("build/windows/pdex.ico"), rootProject.file("build/macos/pdex.icns")) + macOS{ bundleID = "${rootProject.group}.app" iconFile = rootProject.file("build/macos/processing.icns") @@ -87,10 +95,6 @@ compose.desktop { // Fix fonts on some Linux distributions jvmArgs("-Dawt.useSystemAAFontSettings=on") - fileAssociation("application/x-processing","pde", "Processing Source Code",rootProject.file("build/shared/lib/icons/pde-512.png")) - fileAssociation("application/x-processing","pyde", "Processing Python Source Code",rootProject.file("build/shared/lib/icons/pde-512.png")) - fileAssociation("application/x-processing","pdez", "Processing Sketch Bundle",rootProject.file("build/shared/lib/icons/pde-512.png")) - fileAssociation("application/x-processing","pdex", "Processing Contribution Bundle", rootProject.file("build/shared/lib/icons/pde-512.png")) } } } diff --git a/app/macos/info.plist b/app/macos/info.plist index 974db7d45b..f4569e85b2 100644 --- a/app/macos/info.plist +++ b/app/macos/info.plist @@ -9,65 +9,6 @@ - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - pde - - LSTypeIsPackage - - CFBundleTypeIconFile - macos/pde.icns - CFBundleTypeName - Processing Source Code - CFBundleTypeRole - Editor - - - CFBundleTypeExtensions - - pyde - - LSTypeIsPackage - - CFBundleTypeIconFile - macos/pde.icns - CFBundleTypeName - Processing Python Source Code - CFBundleTypeRole - Editor - - - CFBundleTypeExtensions - - pdez - - LSTypeIsPackage - - CFBundleTypeIconFile - macos/pdez.icns - CFBundleTypeName - Processing Sketch Bundle - CFBundleTypeRole - Editor - - - CFBundleTypeExtensions - - pdex - - LSTypeIsPackage - - CFBundleTypeIconFile - macos/pdex.icns - CFBundleTypeName - Processing Contribution Bundle - CFBundleTypeRole - Viewer - - NSCameraUsageDescription The sketch you're running needs access to your video camera. NSMicrophoneUsageDescription