Skip to content

Commit d459e8c

Browse files
authored
Merge pull request #6460 from duncdrum/dp-install-cleanup
Cleanup distribution and installer jobs
2 parents c6fd6cb + 20c5fe4 commit d459e8c

11 files changed

Lines changed: 276 additions & 194 deletions

File tree

.github/workflows/ci-release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: Release
33
# Triggered by an eXist-* tag (created by ci-release-prepare.yml).
44
# Four jobs run in parallel then converge on a single GitHub Release:
55
# build-linux — Maven Central deploy + zip/tar archives (Ubuntu)
6-
# build-mac — signed + notarized DMG (macOS)
7-
# build-windows — signed installer JAR + Authenticode .exe (Windows)
6+
# build-mac — signed + notarized DMG (macOS; installer excluded)
7+
# build-windows — jarsigner + Authenticode signed installer JAR + .exe (Windows)
88
# publish-github-release — collects all artifacts, creates the GitHub Release
9+
#
10+
# The installer JAR is built and deployed to Maven Central from build-linux (GPG-signed).
11+
# The Windows job re-builds and jarsigner-signs it for the GitHub Release download.
912

1013
on:
1114
push:
@@ -155,6 +158,7 @@ jobs:
155158
-Dexistdb.release.notarize.key-path=/tmp/notarytool.p8 \
156159
-Dexistdb.release.notarize.key-id="$EXISTDB_APPLE_API_KEY_ID" \
157160
-Dexistdb.release.notarize.issuer-id="$EXISTDB_APPLE_API_ISSUER_ID" \
161+
--projects '!exist-installer' \
158162
clean package
159163
160164
- name: Remove Apple API key

AGENTS.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ JAVA_HOME=$(/usr/libexec/java_home -v 21) \
2020
-Pskip-build-dist-archives
2121
```
2222

23-
On macOS this still produces an unsigned DMG (`mac-dmg-on-mac` is active by default on Mac runners). Add `-P '!mac-dmg-on-mac'` to skip it.
23+
On macOS, `-P skip-build-dist-archives` also suppresses the `.app` bundle and DMG (sets `skip.mac.dist=true` internally). Use `-P '!mac-dmg-on-mac'` only if you want the archives but not the DMG.
2424

2525
### Build a single module
2626

@@ -45,8 +45,7 @@ mvn test -pl exist-core -Dtest="org.exist.xquery.XPathQueryTest" -Ddependency-ch
4545

4646
### Distribution artifacts (zip, tar.bz2, DMG)
4747

48-
Produces release archives and, on macOS, an unsigned DMG suitable for local testing.
49-
Output lands in `exist-distribution/target/`.
48+
Produces release archives and platform-specific packages. Output lands in `exist-distribution/target/`.
5049

5150
```bash
5251
JAVA_HOME=$(/usr/libexec/java_home -v 21) \
@@ -58,7 +57,11 @@ JAVA_HOME=$(/usr/libexec/java_home -v 21) \
5857
-Drevision=7.0.0-SNAPSHOT
5958
```
6059

61-
The DMG is unsigned. For the fully signed and notarized DMG used in releases, see `exist-versioning-release.md`.
60+
**macOS**: the `mac-dmg-on-mac` profile is active by default and produces an unsigned `.app` bundle and DMG. Suppress both with `-P '!mac-dmg-on-mac'`. For the fully signed and notarized DMG used in releases, see `exist-versioning-release.md`.
61+
62+
**Linux**: the `mac-dmg-on-unix` profile is active by default on non-CI Linux machines (suppressed when `env.CI=true`) and produces an unsigned DMG. Requires `hfsplus-tools` (`apt-get install hfsprogs hfsplus` / `yum install hfsutils hfsplus-tools`); warns and skips gracefully if missing. Suppress with `-P '!mac-dmg-on-unix'`.
63+
64+
Both DMG profiles are suppressed automatically by `-P skip-build-dist-archives` via the `skip.mac.dist` property.
6265

6366
### IzPack installer JAR
6467

@@ -67,6 +70,7 @@ Produces the cross-platform installer JAR in `exist-installer/target/`.
6770
```bash
6871
JAVA_HOME=$(/usr/libexec/java_home -v 21) \
6972
mvn -T1.5C clean package \
73+
-Prelease-build \
7074
-pl exist-installer -am \
7175
-DskipTests \
7276
-Ddependency-check.skip=true \

exist-distribution/pom.xml

Lines changed: 145 additions & 99 deletions
Large diffs are not rendered by default.

exist-distribution/src/main/scripts/codesign-jansi-mac.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,18 @@ set -e
4646
# for each jar file
4747
for jar in "${1}/jansi-${2}.jar" "${1}/jline-${2}-${5}.jar"
4848
do
49+
# macOS dropped i386 support in 10.15 (Catalina). Remove the dead Mac/x86 slice
50+
# from the JAR before codesigning so it does not trigger signing warnings.
51+
zip -d "${jar}" "org/jline/nativ/Mac/x86/libjlinenative.jnilib" || true
52+
4953
# ensure a clean temp work directory for each jar
5054
if [ -d "${3}/org" ]
5155
then
5256
rm -rf "${3}/org"
5357
fi
5458

55-
# for each native arch
56-
archs=('arm64' 'x86' 'x86_64')
59+
# for each supported native arch (i386/x86 intentionally excluded — see above)
60+
archs=('arm64' 'x86_64')
5761
for arch in "${archs[@]}"
5862
do
5963
# create the temp output dirs

exist-distribution/src/main/scripts/create-dmg-mac.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,41 @@ tmp_dmg_mount=$tmp_dmg-mount
4444
final_app_dir="$(dirname "$1")/$2.app"
4545

4646
# Copy the produced .app to `volname`.app
47-
cp -r $1 $final_app_dir
47+
cp -r "$1" "$final_app_dir"
4848

4949
# Create a temporary Disk Image
50-
/usr/bin/hdiutil create -fs HFS+ -srcfolder $final_app_dir -volname $2 -ov $tmp_dmg -format UDRW
50+
/usr/bin/hdiutil create -fs HFS+ -srcfolder "$final_app_dir" -volname "$2" -ov "$tmp_dmg" -format UDRW
5151

5252
# Attach the temporary image
53-
/usr/bin/hdiutil attach $tmp_dmg.dmg -mountroot $tmp_dmg_mount
53+
/usr/bin/hdiutil attach "$tmp_dmg.dmg" -mountroot "$tmp_dmg_mount"
5454

5555
# Copy the background, the volume icon and DS_Store files
56-
mkdir -p $tmp_dmg_mount/$2/.DropDMGBackground
57-
cp $3 $tmp_dmg_mount/$2/.DropDMGBackground/
58-
cp $4 $tmp_dmg_mount/$2/.VolumeIcon.icns
59-
cp $5 $tmp_dmg_mount/$2/.DS_Store
60-
61-
# Indicate that we want a custom icon
62-
if [[ -f "/Applications/Xcode.app/Contents/Developer/Tools/SetFile" ]]; then
63-
/Applications/Xcode.app/Contents/Developer/Tools/SetFile -a -c $tmp_dmg_mount/$2
64-
else
65-
/usr/bin/SetFile -a -c $tmp_dmg_mount/$2
66-
fi
56+
mkdir -p "$tmp_dmg_mount/$2/.DropDMGBackground"
57+
cp "$3" "$tmp_dmg_mount/$2/.DropDMGBackground/"
58+
cp "$4" "$tmp_dmg_mount/$2/.VolumeIcon.icns"
59+
cp "$5" "$tmp_dmg_mount/$2/.DS_Store"
60+
61+
# Set the kHasCustomIcon (0x0400) Finder flag so Finder uses .VolumeIcon.icns.
62+
# Uses xattr to write the 32-byte com.apple.FinderInfo blob directly, replacing
63+
# the SetFile tool that was removed in Xcode 12.
64+
xattr -wx com.apple.FinderInfo \
65+
"0000000000000000040000000000000000000000000000000000000000000000" \
66+
"$tmp_dmg_mount/$2"
6767

6868
# Add a symbolic link to the Applications directory
69-
ln -s /Applications $tmp_dmg_mount/$2/Applications
69+
ln -s /Applications "$tmp_dmg_mount/$2/Applications"
7070

7171
# Detach the temporary image
72-
/usr/bin/hdiutil detach $tmp_dmg_mount/$2
72+
/usr/bin/hdiutil detach "$tmp_dmg_mount/$2"
7373

7474
# Compress it to a new image
75-
/usr/bin/hdiutil convert $tmp_dmg.dmg -format UDZO -o $6
75+
/usr/bin/hdiutil convert "$tmp_dmg.dmg" -format UDZO -o "$6"
7676

7777
# Delete the temporary image
78-
rm $tmp_dmg.dmg
78+
rm "$tmp_dmg.dmg"
7979

8080
# Delete the mount point
81-
rm -r $tmp_dmg_mount
81+
rm -r "$tmp_dmg_mount"
8282

8383
# Delete the copied `volname`.app used for the DMG
84-
rm -r $final_app_dir
84+
rm -r "$final_app_dir"

exist-distribution/src/main/scripts/create-dmg-unix.sh

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ set -x
3434

3535
if [ ! -e /sbin/mkfs.hfsplus ]
3636
then
37-
>&2 echo "ERROR: Skipping DMG creation because /sbin/mkfs.hfsplus is missing!"
38-
>&2 echo " To install it, you might run:"
39-
>&2 echo " * CentOS & co.: sudo yum install hfsutils hfsplus-tools"
40-
>&2 echo " * Debian, Ubuntu & co.: sudo apt-get install hfsprogs hfsplus"
41-
exit 1
37+
>&2 echo "WARNING: Skipping DMG creation because /sbin/mkfs.hfsplus is missing."
38+
>&2 echo " To install it, you might run:"
39+
>&2 echo " * CentOS & co.: sudo yum install hfsutils hfsplus-tools"
40+
>&2 echo " * Debian, Ubuntu & co.: sudo apt-get install hfsprogs hfsplus"
41+
exit 0
4242
fi
4343

4444
# cleanup any previous DMG before creating a new DMG
@@ -53,44 +53,55 @@ tmp_dmg_mount=$tmp_dmg-mount
5353
final_app_dir="$(dirname "$1")/$2.app"
5454

5555
# Copy the produced .app to `volname`.app
56-
cp -r $1 $final_app_dir
56+
cp -r "$1" "$final_app_dir"
5757

5858
# Calculate the size for an image and add 10MB to ensure there is enough space!
59-
base_size=$(du -sm $1 | sed 's/\([0-9]*\).*/\1/')
59+
base_size=$(du -sm "$1" | sed 's/\([0-9]*\).*/\1/')
6060
img_size=$(($base_size + 10))
6161

6262
# Create a temporary Disk Image
63-
dd if=/dev/zero of=$tmp_dmg.dmg bs=1M count=$img_size
64-
/sbin/mkfs.hfsplus -v $2 $tmp_dmg.dmg
63+
dd if=/dev/zero of="$tmp_dmg.dmg" bs=1M count=$img_size
64+
/sbin/mkfs.hfsplus -v "$2" "$tmp_dmg.dmg"
6565

6666
# Attach the temporary image
6767
username=$(whoami)
68-
mkdir -p $tmp_dmg_mount
69-
sudo mount -o loop,uid=$username $tmp_dmg.dmg $tmp_dmg_mount
68+
mkdir -p "$tmp_dmg_mount"
69+
sudo mount -o loop,uid=$username "$tmp_dmg.dmg" "$tmp_dmg_mount"
7070

7171
# Copy the app into the image
72-
cp -r $final_app_dir $tmp_dmg_mount
72+
cp -r "$final_app_dir" "$tmp_dmg_mount"
7373

7474
# Copy the background, the volume icon and DS_Store files
75-
mkdir -p $tmp_dmg_mount/$2/.DropDMGBackground
76-
cp $3 $tmp_dmg_mount/$2/.DropDMGBackground/
77-
cp $4 $tmp_dmg_mount/$2/.VolumeIcon.icns
78-
cp $5 $tmp_dmg_mount/$2/.DS_Store
75+
mkdir -p "$tmp_dmg_mount/$2/.DropDMGBackground"
76+
cp "$3" "$tmp_dmg_mount/$2/.DropDMGBackground/"
77+
cp "$4" "$tmp_dmg_mount/$2/.VolumeIcon.icns"
78+
cp "$5" "$tmp_dmg_mount/$2/.DS_Store"
79+
80+
# Set the kHasCustomIcon (0x0400) Finder flag so Finder uses .VolumeIcon.icns.
81+
# Best-effort: requires setfattr from the attr package. Cosmetic only — skip if unavailable.
82+
if command -v setfattr &>/dev/null; then
83+
setfattr -n "com.apple.FinderInfo" \
84+
-v "0x0000000000000000040000000000000000000000000000000000000000000000" \
85+
"$tmp_dmg_mount/$2"
86+
else
87+
>&2 echo "WARNING: setfattr not found; volume will not have a custom icon."
88+
>&2 echo " Install with: apt-get install attr or yum install attr"
89+
fi
7990

8091
# Add a symbolic link to the Applications directory
81-
ln -s /Applications $tmp_dmg_mount/$2/Applications
92+
ln -s /Applications "$tmp_dmg_mount/$2/Applications"
8293

8394
# Detach the temporary image
84-
sudo umount $tmp_dmg_mount
95+
sudo umount "$tmp_dmg_mount"
8596

8697
# Copy it to a new image
87-
cp $tmp_dmg.dmg $6
98+
cp "$tmp_dmg.dmg" "$6"
8899

89100
# Delete the temporary image
90-
rm $tmp_dmg.dmg
101+
rm "$tmp_dmg.dmg"
91102

92103
# Delete the mount point
93-
rm -r $tmp_dmg_mount
104+
rm -r "$tmp_dmg_mount"
94105

95106
# Delete the copied `volname`.app used for the DMG
96-
rm -r $final_app_dir
107+
rm -r "$final_app_dir"

exist-installer/pom.xml

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
<izpack.installation.info.appversion>${project.version}</izpack.installation.info.appversion>
5454
<izpack.installation.info.author.name>${project.organization.name}</izpack.installation.info.author.name>
5555
<izpack.installation.info.author.email>${contact.email}</izpack.installation.info.author.email>
56+
57+
<!-- This module has no Java sources. Suppress the real source/javadoc plugins
58+
activated by the release-build profile; placeholder JARs are produced
59+
instead to satisfy Maven Central requirements. -->
60+
<maven.source.skip>true</maven.source.skip>
61+
<maven.javadoc.skip>true</maven.javadoc.skip>
5662
</properties>
5763

5864
<dependencies>
@@ -117,26 +123,43 @@
117123
<configuration>
118124
<installFile>${izpack.resources.target}/install.xml</installFile>
119125
<baseDir>${project.basedir}/../exist-distribution/target/exist-distribution-dir</baseDir>
120-
<includeProperties>apache.httpcomponents.core.version,apache.httpcomponents.version,apache.xmlrpc.version,appassembler.version,aspectj.version,git.commit.id,git.commit.id.abbrev,git.closest.tag.name,git.closest.tag.commit.count,git.commit.time,git.commit.id.describe,contact.email,exquery.distribution.version,icu.version,jetty.version,izpack.installation.info.appversion,izpack.installation.info.author.email,izpack.installation.info.author.name,izpack.installation.info.url,izpack.resources.src,izpack.resources.target,izpack.version,jansi.version,jaxb.api.version,jaxb.impl.version,log4j.version,lucene.version,milton.version,project.build.sourceEncoding,project.copyright.name,saxon.version,xmlresolver.version,maven.compiler.release</includeProperties>
126+
<!-- DP: this is effecitvely a whitelist of safe properties to pass to the installer. 5 izpack..., mave.compiler, saxon and xmlresolver are in use. -->
127+
<includeProperties>apache.httpcomponents.core.version,apache.httpcomponents.version,apache.xmlrpc.version,appassembler.version,aspectj.version,git.commit.id,git.commit.id.abbrev,git.closest.tag.name,git.closest.tag.commit.count,git.commit.time,git.commit.id.describe,contact.email,exquery.distribution.version,icu.version,jetty.version,izpack.installation.info.appversion,izpack.installation.info.author.email,izpack.installation.info.author.name,izpack.installation.info.url,izpack.resources.src,izpack.resources.target,izpack.version,jansi.version,jaxb.api.version,jaxb.impl.version,log4j.version,lucene.version,project.build.sourceEncoding,project.copyright.name,saxon.version,xmlresolver.version,maven.compiler.release</includeProperties>
121128
<autoIncludeUrl>true</autoIncludeUrl>
122129
<autoIncludeDevelopers>true</autoIncludeDevelopers>
123130
</configuration>
124131
</plugin>
125132

133+
<!-- Produce placeholder -sources.jar and -javadoc.jar for Maven Central.
134+
Central requires these for all non-pom artifacts; a README is
135+
sufficient when there are no Java sources to document. -->
126136
<plugin>
127137
<groupId>org.apache.maven.plugins</groupId>
128-
<artifactId>maven-install-plugin</artifactId>
129-
<configuration>
130-
<skip>true</skip>
131-
</configuration>
132-
</plugin>
133-
134-
<plugin>
135-
<groupId>org.apache.maven.plugins</groupId>
136-
<artifactId>maven-deploy-plugin</artifactId>
137-
<configuration>
138-
<skip>true</skip>
139-
</configuration>
138+
<artifactId>maven-jar-plugin</artifactId>
139+
<executions>
140+
<execution>
141+
<id>placeholder-sources</id>
142+
<phase>package</phase>
143+
<goals>
144+
<goal>jar</goal>
145+
</goals>
146+
<configuration>
147+
<classifier>sources</classifier>
148+
<classesDirectory>${project.basedir}/src/main/resources</classesDirectory>
149+
</configuration>
150+
</execution>
151+
<execution>
152+
<id>placeholder-javadoc</id>
153+
<phase>package</phase>
154+
<goals>
155+
<goal>jar</goal>
156+
</goals>
157+
<configuration>
158+
<classifier>javadoc</classifier>
159+
<classesDirectory>${project.basedir}/src/main/resources</classesDirectory>
160+
</configuration>
161+
</execution>
162+
</executions>
140163
</plugin>
141164
</plugins>
142165
</build>
@@ -179,34 +202,25 @@
179202
<id>exist-release</id>
180203
<build>
181204
<plugins>
182-
<!-- This is needed in a profile to workaround https://github.com/jutzig/github-release-plugin/issues/50 -->
183205
<plugin>
184-
<groupId>de.jutzig</groupId>
185-
<artifactId>github-release-plugin</artifactId>
206+
<groupId>org.codehaus.mojo</groupId>
207+
<artifactId>exec-maven-plugin</artifactId>
186208
<executions>
187209
<execution>
188210
<id>github-upload</id>
189211
<phase>deploy</phase>
190212
<goals>
191-
<goal>release</goal>
213+
<goal>exec</goal>
192214
</goals>
193-
<inherited>true</inherited>
194215
<configuration>
195-
<description>
196-
Release Notes: https://exist-db.org/exist/apps/wiki/blogs/eXist/exist${project.version}
197-
198-
Maven Central: https://search.maven.org/search?q=g:org.exist-db
199-
</description>
200-
<releaseName>eXist-db ${project.version}</releaseName>
201-
<tag>eXist-${project.version}</tag>
202-
<fileSets>
203-
<fileSet>
204-
<directory>${project.build.directory}</directory>
205-
<includes>
206-
<include>${project.artifactId}-${project.version}.jar</include>
207-
</includes>
208-
</fileSet>
209-
</fileSets>
216+
<executable>bash</executable>
217+
<arguments>
218+
<argument>-c</argument>
219+
<!-- Create the GitHub release if it does not yet exist (e.g. local
220+
release with CI unavailable), otherwise upload into the existing
221+
one (e.g. CI already created it from the tag push). -->
222+
<argument>file="${project.build.directory}/${project.artifactId}-${project.version}.jar"; gh release create "eXist-${project.version}" --title "eXist-db ${project.version}" --generate-notes "$file" || gh release upload "eXist-${project.version}" "$file" --clobber</argument>
223+
</arguments>
210224
</configuration>
211225
</execution>
212226
</executions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This artifact contains no Java sources or Javadoc.
2+
The eXist-db IzPack installer is a self-contained cross-platform installer JAR.
3+
Project sources: https://github.com/eXist-db/exist

exist-parent/pom.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,11 +1199,7 @@
11991199
<artifactId>maven-gpg-plugin</artifactId>
12001200
<version>3.2.8</version>
12011201
</plugin>
1202-
<plugin>
1203-
<groupId>de.jutzig</groupId>
1204-
<artifactId>github-release-plugin</artifactId>
1205-
<version>1.6.0</version>
1206-
</plugin>
1202+
12071203
<plugin>
12081204
<groupId>org.eluder.coveralls</groupId>
12091205
<artifactId>coveralls-maven-plugin</artifactId>

exist-service/bin/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unzip commons-daemon-1.6.0-bin-windows.zip
99

1010
## macOS Binary
1111
The macOS Binary is compiled as a Universal Binary for x86_64 and arm64 from the native source code for unix provided by the Apache Commons Daemon project.
12-
It is compiled for a minimum version of 10.13 of macOS so as to provide some backwards compatibility.
12+
It is compiled for a minimum version of 11.0 of macOS, matching the minimum required by Java 21.
1313

1414
For example:
1515

@@ -18,8 +18,8 @@ wget https://dlcdn.apache.org/commons/daemon/source/commons-daemon-1.6.0-native-
1818
tar zxvf commons-daemon-1.6.0-native-src.tar.gz
1919

2020
cd commons-daemon-1.6.0-native-src/unix
21-
export CFLAGS="-mmacosx-version-min=10.13 -arch x86_64 -arch arm64"
22-
export LDFLAGS="-mmacosx-version-min=10.13 -arch x86_64 -arch arm64"
21+
export CFLAGS="-mmacosx-version-min=11.0 -arch x86_64 -arch arm64"
22+
export LDFLAGS="-mmacosx-version-min=11.0 -arch x86_64 -arch arm64"
2323
sh support/buildconf.sh
2424
./configure
2525
make

0 commit comments

Comments
 (0)