Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions macos-installer/Distribution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>IDEasy</title>
<license file="LICENSE.rtf"/>
<conclusion file="CONCLUSION.rtf"/>
<options customize="never" require-scripts="false" rootVolumeOnly="true"/>
<choices-outline>
<line choice="default">
<line choice="com.devonfw.ideasy"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.devonfw.ideasy" visible="false">
<pkg-ref id="com.devonfw.ideasy"/>
</choice>
<pkg-ref id="com.devonfw.ideasy" version="${next_version}" onConclusion="none">IDEasyComponent.pkg</pkg-ref>
</installer-gui-script>
21 changes: 21 additions & 0 deletions macos-installer/Resources/CONCLUSION.rtf
Original file line number Diff line number Diff line change
@@ -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 <project-name>\
\

\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}}.}
32 changes: 32 additions & 0 deletions macos-installer/scripts/postinstall
Original file line number Diff line number Diff line change
@@ -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
Loading