diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml
index 93897940b..485688d20 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 75932d7fe..a80fef2d8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -84,6 +84,39 @@ 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/ */}"
+ 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 Maven Central.
# The version number for the next build will be incremented automatically.
diff --git a/macos-installer/Distribution.xml b/macos-installer/Distribution.xml
new file mode 100644
index 000000000..308c528c4
--- /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 000000000..8ec4924a6
--- /dev/null
+++ b/macos-installer/Resources/CONCLUSION.rtf
@@ -0,0 +1,21 @@
+{\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 \
+\
+
+\f0\b Or see all available commands by typing:\
+
+\f1\b0 ide help\
+\
+
+\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
new file mode 100755
index 000000000..d2d7015ca
--- /dev/null
+++ b/macos-installer/scripts/postinstall
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+
+INSTALL_DIR="/Library/IDEasy"
+
+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
+
+sudo -u "$CONSOLE_USER" -H \
+ "$INSTALL_DIR/bin/ideasy" -ftb --no-colors install \
+ > "$LOG_DIR/install-$ts.log" 2>&1
+
+echo "$INSTALL_DIR/bin" > /etc/paths.d/ideasy
+
+echo "Install finished"
+
+exit 0