From f3759418b453dc7220c010e1a40305badadacb02 Mon Sep 17 00:00:00 2001 From: Lukas Faber Date: Tue, 30 Jun 2026 20:51:51 +0200 Subject: [PATCH 1/4] #433: initial commit --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75932d7fe0..17f96111ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,6 +84,33 @@ jobs: with: name: msi path: windows-installer/signed/ideasy.msi + - name: Build MacOS PKG + if: runner.os == 'macOS' + shell: bash + run: | + maven_config="$(cat .mvn/maven.config)" + current_version="${maven_config/#*-Drevision=}" + current_version="${current_version/ */}" + mkdir -p mac-installer/pkg-root/usr/local/share/ideasy/bin + cp -r cli/target/package/* mac-installer/pkg-root/usr/local/share/ideasy/ + rm -rf mac-installer/pkg-root/usr/local/share/ideasy/system/windows + rm -rf mac-installer/pkg-root/usr/local/share/ideasy/system/linux + cp cli/target/ideasy mac-installer/pkg-root/usr/local/share/ideasy/bin/ideasy + chmod +x mac-installer/pkg-root/usr/local/share/ideasy/bin/ideasy + pkgbuild \ + --root mac-installer/pkg-root \ + --identifier com.devonfw.ideasy \ + --version "$VERSION" \ + --install-location / \ + --scripts mac-installer/pkg-scripts \ + mac-installer/ideasy-${VERSION}.pkg + + - name: Upload PKG + if: runner.os == 'macOS' + uses: actions/upload-artifact@v4 + with: + name: pkg-${{ matrix.os }} + path: mac-installer/ideasy-*.pkg # Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to Maven Central. # The version number for the next build will be incremented automatically. From b3fff55de31190d6379d4b62fbc1b6572b8788dc Mon Sep 17 00:00:00 2001 From: Lukas Faber Date: Tue, 30 Jun 2026 21:59:11 +0200 Subject: [PATCH 2/4] #433: added license.rtf, conclusion.rtf --- .github/workflows/release.yml | 32 ++++++++++++++---------- macos-installer/Distribution.xml | 17 +++++++++++++ macos-installer/Resources/CONCLUSION.rtf | 20 +++++++++++++++ macos-installer/scripts/postinstall | 17 +++++++++++++ 4 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 macos-installer/Distribution.xml create mode 100644 macos-installer/Resources/CONCLUSION.rtf create mode 100755 macos-installer/scripts/postinstall diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17f96111ef..9e753140ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,19 +91,25 @@ jobs: maven_config="$(cat .mvn/maven.config)" current_version="${maven_config/#*-Drevision=}" current_version="${current_version/ */}" - mkdir -p mac-installer/pkg-root/usr/local/share/ideasy/bin - cp -r cli/target/package/* mac-installer/pkg-root/usr/local/share/ideasy/ - rm -rf mac-installer/pkg-root/usr/local/share/ideasy/system/windows - rm -rf mac-installer/pkg-root/usr/local/share/ideasy/system/linux - cp cli/target/ideasy mac-installer/pkg-root/usr/local/share/ideasy/bin/ideasy - chmod +x mac-installer/pkg-root/usr/local/share/ideasy/bin/ideasy - pkgbuild \ - --root mac-installer/pkg-root \ - --identifier com.devonfw.ideasy \ - --version "$VERSION" \ - --install-location / \ - --scripts mac-installer/pkg-scripts \ - mac-installer/ideasy-${VERSION}.pkg + next_version="${current_version/-SNAPSHOT/}" + cd documentation + mvn -B -ntp clean install + cd .. + mkdir -p macos-installer/pkg-root/Library/IDEasy/bin + mkdir -p macos-installer/Resources + cp documentation/target/generated-docs/LICENSE.rtf macos-installer/Resources/LICENSE.rtf + cp -r cli/target/package/* macos-installer/pkg-root/Library/IDEasy/ + rm -rf macos-installer/pkg-root/Library/IDEasy/system/windows + rm -rf macos-installer/pkg-root/Library/IDEasy/system/linux + cp cli/target/ideasy macos-installer/pkg-root/Library/IDEasy/bin/ + chmod +x macos-installer/pkg-root/Library/IDEasy/bin/ideasy + chmod +x macos-installer/scripts/postinstall + cd macos-installer + pkgbuild --root pkg-root --identifier com.devonfw.ideasy \ + --version $next_version --install-location "/" \ + --scripts scripts IDEasyComponent.pkg + productbuild --distribution Distribution.xml --resources Resources \ + --package-path . IDEasy-$next_version.pkg - name: Upload PKG if: runner.os == 'macOS' diff --git a/macos-installer/Distribution.xml b/macos-installer/Distribution.xml new file mode 100644 index 0000000000..308c528c4c --- /dev/null +++ b/macos-installer/Distribution.xml @@ -0,0 +1,17 @@ + + + IDEasy + + + + + + + + + + + + + IDEasyComponent.pkg + diff --git a/macos-installer/Resources/CONCLUSION.rtf b/macos-installer/Resources/CONCLUSION.rtf new file mode 100644 index 0000000000..f22b6e8c97 --- /dev/null +++ b/macos-installer/Resources/CONCLUSION.rtf @@ -0,0 +1,20 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2867 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Arial-BoldMT;\f1\fnil\fcharset0 AndaleMono;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\paperw7920\paperh11520\margl172\margr172\margb172\margt172\vieww11520\viewh8400\viewkind0 +\deftab720 +\pard\pardeftab720\ri0\sa80\partightenfactor0 + +\f0\b\fs24 \cf0 Thank you for using IDEasy.\ +\ +You can create your first project now by typing:\ + +\f1\b0 ide create \ +\ +\pard\pardeftab720\ri0\sa80\partightenfactor0 + +\f0\b \cf0 Or see all available commands by typing:\ +\pard\pardeftab720\ri0\sa80\partightenfactor0 + +\f1\b0 \cf0 ide help} \ No newline at end of file diff --git a/macos-installer/scripts/postinstall b/macos-installer/scripts/postinstall new file mode 100755 index 0000000000..106b21b196 --- /dev/null +++ b/macos-installer/scripts/postinstall @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +INSTALL_DIR="/Library/IDEasy" +LOG_DIR="$HOME/.ide/logs" +mkdir -p "$LOG_DIR" +ts=$(date +"%Y-%m-%d-%H-%M-%S") + +ln -sf "$INSTALL_DIR/bin/ideasy" /usr/local/bin/ideasy + +"$INSTALL_DIR/bin/ideasy" -ftb --no-colors install \ + > "$LOG_DIR/install-$ts.log" 2>&1 + +# Add INSTALL_DIR/bin to PATH for both bash and zsh (login shells) +echo "$INSTALL_DIR/bin" > /etc/paths.d/ideasy + +exit 0 From 7fb9e5dd0be4f742a627a7b2f3a39f6255b569c0 Mon Sep 17 00:00:00 2001 From: Lukas Faber Date: Tue, 30 Jun 2026 23:20:17 +0200 Subject: [PATCH 3/4] #433: updated conclusion.rtf, fixed postinstall script. --- macos-installer/Resources/CONCLUSION.rtf | 9 +++++---- macos-installer/scripts/postinstall | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/macos-installer/Resources/CONCLUSION.rtf b/macos-installer/Resources/CONCLUSION.rtf index f22b6e8c97..8ec4924a60 100644 --- a/macos-installer/Resources/CONCLUSION.rtf +++ b/macos-installer/Resources/CONCLUSION.rtf @@ -12,9 +12,10 @@ You can create your first project now by typing:\ \f1\b0 ide create \ \ -\pard\pardeftab720\ri0\sa80\partightenfactor0 -\f0\b \cf0 Or see all available commands by typing:\ -\pard\pardeftab720\ri0\sa80\partightenfactor0 +\f0\b Or see all available commands by typing:\ + +\f1\b0 ide help\ +\ -\f1\b0 \cf0 ide help} \ No newline at end of file +\f0\b If you need more information, take a look at our {\field{\*\fldinst{HYPERLINK "https://github.com/devonfw/IDEasy/blob/main/documentation/setup.adoc"}}{\fldrslt documentation}}.} \ No newline at end of file diff --git a/macos-installer/scripts/postinstall b/macos-installer/scripts/postinstall index 106b21b196..d2d7015ca9 100755 --- a/macos-installer/scripts/postinstall +++ b/macos-installer/scripts/postinstall @@ -2,16 +2,31 @@ set -e INSTALL_DIR="/Library/IDEasy" -LOG_DIR="$HOME/.ide/logs" -mkdir -p "$LOG_DIR" + +echo "Begin install" + +# Determine the logged-in user. When the PKG installer executes a script, it references the ROOT, not a user, therefore we have to find out who runs the script. +CONSOLE_USER=$(stat -f%Su /dev/console) +# dscl -read reads the given user information reliably +USER_HOME=$(dscl . -read "/Users/${CONSOLE_USER}" NFSHomeDirectory 2>/dev/null | awk '{print $2}') + +if [ -z "$USER_HOME" ] || [ "$CONSOLE_USER" = "root" ]; then + echo "ERROR: could not determine target user, aborting IDEasy install." >&2 + exit 1 +fi + +LOG_DIR="${USER_HOME}/.ide/logs" +sudo -u "$CONSOLE_USER" mkdir -p "$LOG_DIR" ts=$(date +"%Y-%m-%d-%H-%M-%S") ln -sf "$INSTALL_DIR/bin/ideasy" /usr/local/bin/ideasy -"$INSTALL_DIR/bin/ideasy" -ftb --no-colors install \ +sudo -u "$CONSOLE_USER" -H \ + "$INSTALL_DIR/bin/ideasy" -ftb --no-colors install \ > "$LOG_DIR/install-$ts.log" 2>&1 -# Add INSTALL_DIR/bin to PATH for both bash and zsh (login shells) echo "$INSTALL_DIR/bin" > /etc/paths.d/ideasy +echo "Install finished" + exit 0 From ab8d621aebd75c869cd5c79895a44bd598aee8bc Mon Sep 17 00:00:00 2001 From: Lukas Faber Date: Tue, 30 Jun 2026 23:45:11 +0200 Subject: [PATCH 4/4] #433: added PKG build logic to nightly-build.yml --- .github/workflows/nightly-build.yml | 34 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 6 ++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 93897940bd..485688d208 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -83,6 +83,40 @@ jobs: name: msi path: windows-installer/signed/ideasy.msi + - name: Build MacOS PKG + if: runner.os == 'macOS' + shell: bash + run: | + maven_config="$(cat .mvn/maven.config)" + current_version="${maven_config/#*-Drevision=}" + current_version="${current_version/ */}" + next_version="${current_version/-SNAPSHOT/}" + cd documentation + mvn -B -ntp clean install + cd .. + mkdir -p macos-installer/pkg-root/Library/IDEasy/bin + mkdir -p macos-installer/Resources + cp documentation/target/generated-docs/LICENSE.rtf macos-installer/Resources/LICENSE.rtf + cp -r cli/target/package/* macos-installer/pkg-root/Library/IDEasy/ + rm -rf macos-installer/pkg-root/Library/IDEasy/system/windows + rm -rf macos-installer/pkg-root/Library/IDEasy/system/linux + cp cli/target/ideasy macos-installer/pkg-root/Library/IDEasy/bin/ + chmod +x macos-installer/pkg-root/Library/IDEasy/bin/ideasy + chmod +x macos-installer/scripts/postinstall + cd macos-installer + pkgbuild --root pkg-root --identifier com.devonfw.ideasy \ + --version $next_version --install-location "/" \ + --scripts scripts IDEasyComponent.pkg + productbuild --distribution Distribution.xml --resources Resources \ + --package-path . IDEasy-$next_version.pkg + # pkgbuild is responsible for building the installation bundle. By using productbuild, we can custimze the installation process, including things like showing a license. + - name: Upload PKG + if: runner.os == 'macOS' + uses: actions/upload-artifact@v4 + with: + name: pkg + path: macos-installer/IDEasy-*.pkg + # Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to OSSRH Nexus deploy: name: Build Project and Deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e753140ae..a80fef2d88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,13 +110,13 @@ jobs: --scripts scripts IDEasyComponent.pkg productbuild --distribution Distribution.xml --resources Resources \ --package-path . IDEasy-$next_version.pkg - + # pkgbuild is responsible for building the installation bundle. By using productbuild, we can custimze the installation process, including things like showing a license. - name: Upload PKG if: runner.os == 'macOS' uses: actions/upload-artifact@v4 with: - name: pkg-${{ matrix.os }} - path: mac-installer/ideasy-*.pkg + name: pkg + path: macos-installer/IDEasy-*.pkg # Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to Maven Central. # The version number for the next build will be incremented automatically.