70 Commits

Author SHA1 Message Date
bb6b93a556 Switch back to old artifact naming scheme, that's not where the problem is 2024-10-25 16:02:11 -04:00
72de4bc4df Tray and make artifacts which are correctly named and versioned 2024-10-20 15:45:02 -04:00
f6026af5ba maximize fetch depth in CI 2024-08-29 17:09:52 -04:00
cb450487f8 Attempt to build with Java 22 in CI 2024-08-29 16:44:38 -04:00
c65aea0ed9 don't try to pull own tags 2024-08-09 10:00:58 -04:00
ec03127603 ignore failure on pull tags 2024-07-21 23:42:23 -04:00
fa6ebc8b94 pull tags 2024-07-21 23:20:55 -04:00
08cec51dce disable fetch-tags 2024-07-21 23:14:48 -04:00
6b493c8832 Don't pull tags in build.sh, if you're running locally you have them, let the CI file do it 2024-07-21 01:31:02 -04:00
60a9fb156e run with a trailing qualifier on the tag 2024-07-21 00:27:56 -04:00
14b66d8f25 try listing all tags across all branches 2024-07-21 00:16:07 -04:00
3e993e72c6 try fetch-tags=true 2024-07-21 00:12:41 -04:00
78339ad6eb try --always 2024-07-21 00:09:10 -04:00
0cf574156a break on broken tags 2024-07-21 00:06:55 -04:00
6a63970a7f fix tag read part of script 2024-07-20 23:44:59 -04:00
b74e3ec5a5 Make sure tags are pulled before running build.sh 2024-07-20 23:36:36 -04:00
5d0b85e869 Fix CI file 2024-07-20 23:34:28 -04:00
ceb1278110 buildscript should use github tag 2024-07-20 23:04:37 -04:00
d8fdcbd2b4 add releaser to CI 2024-07-20 23:01:33 -04:00
6a7974fec6 add releaser to CI 2024-07-20 23:01:27 -04:00
3c5cf560ba Update base I2P version 2024-02-13 16:15:56 -05:00
753c0f279a upload a dev build of a dmg in CI 2024-02-13 14:57:11 -05:00
49183d487f disable cert pre-copy for final distribution 2024-02-13 14:49:15 -05:00
986c0e8e11 re-add jnilib 2024-02-13 14:43:13 -05:00
8663456262 list outputs of builds 2024-02-13 14:26:15 -05:00
931ae1a407 only pass signing arg if arg is present 2024-02-13 14:20:24 -05:00
07a858d667 only pass signing arg if arg is present 2024-02-13 14:14:22 -05:00
a573f1c291 delete I2P_SRC not I2P_SRC_BACE 2024-02-13 13:57:06 -05:00
1f24437d4a Clone deps into working directory so nothing complains about permissions 2024-02-13 13:41:24 -05:00
64e0051912 start working on a github CI file using the Windows bundle CI file as base 2024-02-13 13:16:22 -05:00
7ab45024c6 Don't use the pre-built I2P.app to build the bundle anymore, don't use I2P_SIGNER and I2P_CODE_SIGNER anymore because we're not signing the native libs 2024-01-10 12:47:02 -05:00
4a80096c99 delete cert. 2024-01-10 12:46:14 -05:00
5015eac337 Don't use the pre-built I2P.app to build the bundle anymore, don't use I2P_SIGNER and I2P_CODE_SIGNER anymore because we're not signing the native libs 2024-01-10 12:45:30 -05:00
cf47ac8b61 Don't bother to build jbigi for this package anymore. 2024-01-10 12:33:17 -05:00
767ff8e031 Don't bother to build jbigi for this package anymore. 2024-01-10 12:31:04 -05:00
5c0e9ebbad Use local checkout as base for i2p.i2p 2023-12-28 10:17:09 -05:00
9fa10602b4 Use local checkout as base for i2p.i2p 2023-12-28 10:15:57 -05:00
0dcfb896d4 Update config example, clone i2p.i2p if it doesn't exist 2023-12-28 10:10:01 -05:00
idk
53d2341e2b bump default build tags 2023-03-19 11:51:23 +00:00
idk
10e009cb71 re-enable manual dylib signing 2023-03-05 03:18:58 +00:00
idk
14ef6ff370 sign packages at app image generation phase not dmg image generation phase 2023-03-03 06:15:50 +00:00
idk
045b50275b checkin before checkout 2023-02-21 15:10:37 +00:00
idk
abfe4047d1 check out extant branch if it already exists 2023-02-21 15:03:44 +00:00
idk
97bc0e450f always reset the source before pulling new tags, before checking out the tag to build, and before creating the tarball brach 2023-02-21 14:57:06 +00:00
idk
b4b02c7a58 always attempt to checkin modified routerversion.java 2023-02-16 20:37:09 +00:00
idk
f6639e991f automatically set I2P_RELEASE_VERSION 2023-02-16 20:11:10 +00:00
idk
dee1e6eacc automatically set I2P_RELEASE_VERSION 2023-02-16 18:51:38 +00:00
idk
e2e372a3fb make it so that you don't have to check out master of i2p.i2p manually between builds. /sleep 10s/sleep 10/(no unit on Mac without brew). Change I2P_VERSION so it can accept any branch, tag, or checkin 2023-02-16 16:58:43 +00:00
idk
7d42cb37e0 specify mac entitlements file to jpackage 2023-02-02 16:56:42 +00:00
idk
46500b8599 only let jpackage sign the runtime libs 2023-02-02 16:53:41 +00:00
idk
1e3f90696b don't use --deep codesign to sign entitlements for app 2023-02-02 16:35:31 +00:00
idk
53c3888881 ignore git switch errors, just means we're on master 2023-02-01 23:40:13 +00:00
idk
01c8bf7865 ignore git switch errors, just means we're on master 2023-02-01 23:33:39 +00:00
idk
e9d21803e1 automatically set signing keys to first available cert sha256 fingerprint if they aren't set when the script runs, warn user if this happens 2023-02-01 23:30:38 +00:00
idk
d7513114be fix every single shellcheck error 2023-02-01 23:23:14 +00:00
idk
df31d1e67a automatically set signing keys to first available cert sha256 fingerprint if they aren't set when the script runs, warn user if this happens 2023-02-01 23:08:16 +00:00
idk
15dfb338b5 switch before pulling tags 2023-02-01 22:56:22 +00:00
idk
e59d081f70 make sure the EXTRA is set in both the binary and the tarball 2023-02-01 22:53:00 +00:00
idk
73ee1ad489 make sure the EXTRA is set in both the binary and the tarball 2023-02-01 22:50:34 +00:00
idk
ffbeae3689 check out the right tag when ensuring the libraries are built 2023-02-01 22:36:09 +00:00
idk
d15b9cf563 add defaults to build.sh 2023-02-01 22:30:36 +00:00
idk
acd74bbddd add options to BUILD.md 2023-02-01 22:24:52 +00:00
idk
855b139c46 move NOTARIZE to it's own document 2023-02-01 22:02:40 +00:00
idk
b23e6e6a46 if build or checkout are incomplete do them in the build script 2023-02-01 21:58:27 +00:00
idk
f1aca4c67a quote I2P_SIGNER_USERPHRASE 2023-02-01 21:48:02 +00:00
idk
3efeb8e7ac use I2P_SIGNER for dylibs and I2P_CODE_SIGNER for jnilibs? 2023-01-31 15:16:59 +00:00
idk
4448b8a88e add EXTRA to routerversion and automatically generate tarball 2023-01-24 03:58:20 +00:00
idk
5e2ac64ed7 fix doc in config.sh 2023-01-17 00:58:57 +00:00
idk
481cb0f89d simplify checks for whether essential config vars are set, code-sign the bundle in the jpackage command, link important stackoverflow thread in readme 2023-01-16 18:59:46 +00:00
idk
ddf3ec3715 fix I2P_CODE_SIGNER in config.sh 2023-01-15 04:17:31 +00:00
13 changed files with 320 additions and 185 deletions

47
.github/workflows/ant.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Java CI
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: build with script
run: ./build.sh
- name: Upload I2P-${{ github.sha }}.dmg
uses: actions/upload-artifact@v4
with:
name: I2P-${{ github.sha }}.dmg
path: I2P-*.dmg
build-22:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 22
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
- name: build with script
run: ./build.sh
- name: Upload I2P-${{ github.sha }}.dmg
uses: actions/upload-artifact@v4
with:
name: I2P-${{ github.sha }}-22.dmg
path: I2P-*.dmg

79
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: Release
#on: [push]
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'i2p-mac-*.*.*' # Release 1.2.3
- 'i2p-mac-*.*.*-*' # Release 1.2.3
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
docs/RELEASE.md
sparse-checkout-cone-mode: false
- name: sleep 15 minutes
run: |
echo "sleeping 15 minutes to wait for artifacts"
sleep 1m
echo "sleeping 14 minutes to wait for artifacts"
sleep 1m
echo "sleeping 13 minutes to wait for artifacts"
sleep 1m
echo "sleeping 12 minutes to wait for artifacts"
sleep 1m
echo "sleeping 11 minutes to wait for artifacts"
sleep 1m
echo "sleeping 10 minutes to wait for artifacts"
sleep 1m
echo "sleeping 9 minutes to wait for artifacts"
sleep 1m
echo "sleeping 8 minutes to wait for artifacts"
sleep 1m
echo "sleeping 7 minutes to wait for artifacts"
sleep 1m
echo "sleeping 6 minutes to wait for artifacts"
sleep 1m
echo "sleeping 5 minutes to wait for artifacts"
sleep 1m
echo "sleeping 4 minutes to wait for artifacts"
sleep 1m
echo "sleeping 3 minutes to wait for artifacts"
sleep 1m
echo "sleeping 2 minutes to wait for artifacts"
sleep 1m
echo "sleeping 1 minutes to wait for artifacts"
sleep 1m
- name: Download artifacts
id: download-artifact
uses: dawidd6/action-download-artifact@v3
with:
skip_unpack: true
workflow: ant.yml
if_no_artifact_found: fail
# remove .zip file extension
- run: for f in *.zip; do unzip "$f"; rm "$f"; done
- run: echo "" | tee -a docs/RELEASE.md
- run: echo "## Checksums" | tee -a docs/RELEASE.md
- run: echo "" | tee -a docs/RELEASE.md
- run: echo '```' | tee -a docs/RELEASE.md
- run: sha256sum * | tee -a docs/RELEASE.md
- run: echo '```' | tee -a docs/RELEASE.md
- run: echo "" | tee -a docs/RELEASE.md
- run: echo '```' | tee -a docs/RELEASE.md
- run: file * | tee -a docs/RELEASE.md
- run: echo '```' | tee -a docs/RELEASE.md
- run: echo "" | tee -a docs/RELEASE.md
- name: Upload artifacts
uses: ncipollo/release-action@v1
with:
artifacts: "*"
bodyFile: "docs/RELEASE.md"

View File

@ -4,6 +4,19 @@ Building an I2P Easy-Install Bundle for Mac
This documents building the I2P Easy-Install for Mac end-to-end, including the
set up, configuration, and maintenance of a build environment.
Signed Builds
-------------
In order to carry out a signed build which can be submitted to Apple for
notarization and re-distribution, set the following environment variables:
```
export I2P_SIGNER=(The sha256 fingerprint of the developer signing cert)
export I2P_CODE_SIGNER=(The sha256 fingerprint of the developer signing cert)
export I2P_SIGNER_USERPHRASE=(The sha256 fingerprint of the developer signing cert)
```
Setting up a Java SDK manager
-----------------------------
@ -81,10 +94,10 @@ Ensure you have a copy of `i2p.i2p` checked out adjacent to the
building the jpackage, run the following command:
```sh
git clone https://i2pgit.org/i2p-hackers/i2p.i2p
git clone https://i2pgit.org/i2p-hackers/i2p.i2p "i2p.i2p-jpackage-mac"
```
Change to the `i2p.i2p` directory and check out the release branch you want to
Change to the `i2p.i2p-jpackage-mac` directory and check out the release branch you want to
build a package for, e.g. `i2p-1.9.0`
```sh

29
NOTARIZE.md Normal file
View File

@ -0,0 +1,29 @@
# Notarization
1. You need an "app-specific password" which you can create at https://appleid.apple.com
2. Execute
```
xcrun notarytool store-credentials "$AC_PASSWORD"
--apple-id "$AC_USERNAME"
--team-id "$WWDRTeamID"
--password "$secret_2FA_password"
```
- In this example command:
- `AC_PASSWORD` is the name of the credentials config.
- `AC_USERNAME` is the username of the Apple Account.
- `WWDRTeamID` is the developer/team ID available from the Apple Account.
- `secret_2FA_Password` is the app-specific password you set up in the first step.
3. Periodically execute the following to check the progress of the notarisation:
```
xcrun altool --eval-info <the long UUID string> -u <your Apple id>
````
4. If that returns success, staple the notarization to the dmg:
```
xcrun stapler staple <name of the .dmg>
```
- [This StackOverflow thread contains invaluable information about how to successfully notarize jpackage-based software](https://stackoverflow.com/questions/60953329/code-signing-notarization-using-jpackage-utility-isnt-working-on-macos)
## Things I know about Apple Signing Keys
- It is always OK to refer to the key by it's sha256 fingerprint, that works in every command

View File

@ -9,11 +9,7 @@ JPackage scripts for packaging I2P on a Mac.
### Building
1. Clone `i2p.i2p` as a sibling to this module
1. Build it with `ant clean preppkg-osx-only`
1. Set the `I2P_SIGNER` environment variable to a string identifying the signer.
1. Set the `I2P_BUILD_NUMBER` environment variable to some integer >= 1
1. Run `build.sh`
1. See [BUILD.md](BUILD.md)
### How does it work
@ -24,28 +20,3 @@ In order to build an AppBundle that can work from anywhere, it is necessary to u
1. Copies the contents of `../i2p.i2p/pkg-temp` inside the AppBundle, except for the `jars` directory
1. Signs the AppBundle
1. Invokes JPackage again to build the final .dmg
### Notarization
1. You need an "app-specific password" which you can create at https://appleid.apple.com
2. Execute
```
xcrun notarytool store-credentials "$AC_PASSWORD"
--apple-id "$AC_USERNAME"
--team-id "$WWDRTeamID"
--password "$secret_2FA_password"
```
- In this example command:
- `AC_PASSWORD` is the name of the credentials config.
- `AC_USERNAME` is the username of the Apple Account.
- `WWDRTeamID` is the developer/team ID available from the Apple Account.
- `secret_2FA_Password` is the app-specific password you set up in the first step.
3. Periodically execute the following to check the progress of the notarisation:
```
xcrun altool --eval-info <the long UUID string> -u <your Apple id>
````
4. If that returns success, staple the notarization to the dmg:
```
xcrun stapler staple <name of the .dmg>
```

178
build.sh
View File

@ -1,8 +1,28 @@
#!/bin/bash
set -e
git describe --tags `git rev-list --tags --max-count=1` || exit 1
export GITHUB_TAG=$(git describe --tags `git rev-list --tags --max-count=1` | sed 's|i2p||g' | tr -d a-z-)
if [ -z "$I2P_VERSION" ]; then
I2P_VERSION="i2p-$GITHUB_TAG"
fi
if echo "$I2P_VERSION" | grep -q '.\..\..'; then
if [ -z "$I2P_RELEASE_VERSION" ]; then
I2P_RELEASE_VERSION="$I2P_VERSION"
fi
else
if [ -z "$I2P_RELEASE_VERSION" ]; then
I2P_RELEASE_VERSION=$GITHUB_TAG
fi
fi
if [ -z "$I2P_BUILD_NUMBER" ]; then
I2P_BUILD_NUMBER=1
fi
if [ -f config.sh ]; then
. config.sh
. "config.sh"
fi
# old javas output version to stderr and don't support --version
@ -19,24 +39,17 @@ if [ "$JAVA" -lt "16" ]; then
exit 1
fi
if [ -z "${I2P_SIGNER}" ]; then
echo "I2P_SIGNER variable not set, can't sign. Script will terminate after unsigned app-image generation"
fi
if [ -z ${I2P_VERSION} ]; then
echo "I2P_VERSION not set, aborting"
exit 1
fi
if [ -z ${I2P_BUILD_NUMBER} ]; then
echo "please set the I2P_BUILD_NUMBER variable to some integer >= 1"
exit 1
fi
if [ -z ${JAVA_HOME} ]; then
if [ -z "${JAVA_HOME}" ]; then
JAVA_HOME=$(/usr/libexec/java_home)
fi
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
I2P_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | head -n 1 | cut -d '"' -f 2)
echo "Warning: using automatically configured signer ID, make sure this is the one you want: $I2P_SIGNER_USERPHRASE"
echo "continuing in 10 seconds"
sleep 10
fi
echo "JAVA_HOME is $JAVA_HOME"
echo "cleaning"
@ -44,16 +57,43 @@ echo "cleaning"
ARCH=$(uname -m)
HERE=$PWD
I2P_JARS=$HERE/../i2p.i2p/pkg-temp/lib
I2P_PKG=$HERE/../i2p.i2p/pkg-temp
I2P_SRC=$HERE/i2p.i2p-jpackage-mac/
I2P_SRC_BASE=$HERE/i2p.i2p/
rm -rf "$I2P_SRC"
if [ ! -d "$I2P_SRC_BASE" ]; then
git clone https://i2pgit.org/i2p-hackers/i2p.i2p "$I2P_SRC_BASE"
fi
cd "$I2P_SRC_BASE" && git pull --tags && cd "$HERE"
git clone -b "$I2P_VERSION" "$I2P_SRC_BASE" "$I2P_SRC"
I2P_JARS=$HERE/i2p.i2p-jpackage-mac/pkg-temp/lib
I2P_PKG=$HERE/i2p.i2p-jpackage-mac/pkg-temp
cd "$I2P_SRC"
OLDEXTRA=$(grep 'String EXTRA' "$I2P_SRC/router/java/src/net/i2p/router/RouterVersion.java")
if [ -z "$EXTRA" ]; then
export EXTRACODE="mac"
export EXTRA=" public final static String EXTRA = \"-$EXTRACODE\";"
fi
sed -i.bak "s|$OLDEXTRA|$EXTRA|g" "$I2P_SRC/router/java/src/net/i2p/router/RouterVersion.java"
git commit -am "$I2P_RELEASE_VERSION-$EXTRACODE"
git checkout -b "$I2P_RELEASE_VERSION-$EXTRACODE" || git checkout "$I2P_RELEASE_VERSION-$EXTRACODE"
git archive --format=tar.gz --output="$HERE/i2p.i2p.jpackage-mac.tar.gz" "$I2P_RELEASE_VERSION-$EXTRACODE"
if [ ! -d "$I2P_PKG" ]; then
ant clean preppkg-osx-only
fi
cd "$HERE"
mkdir build
echo "compiling custom launcher and update processor"
cp $I2P_JARS/*.jar build
cc -v -Wl,-lobjc -mmacosx-version-min=10.9 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -Ic -o build/libMacLauncher.jnilib -shared c/net_i2p_router_MacLauncher.c
cp "$I2P_JARS"/*.jar build
cd java
javac -d ../build -classpath ../build/i2p.jar:../build/router.jar net/i2p/router/MacLauncher.java net/i2p/update/*.java
cd ..
cd "$HERE"
echo "copying mac-update.sh"
cp bash/mac-update.sh build
@ -63,40 +103,16 @@ cd build
jar -cf launcher.jar net mac-update.sh
cd ..
echo "compiling native lib"
cc -v -Wl,-lobjc -mmacosx-version-min=10.9 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -Ic -o build/libMacLauncher.jnilib -shared c/net_i2p_router_MacLauncher.c
if [ -z $I2P_SIGNER ]; then
echo "I2P_SIGNER is unset, not proceeding to sign jbigi libs"
cp $I2P_JARS/jbigi.jar build
else
echo "signing jbigi libs"
mkdir jbigi
cp $I2P_JARS/jbigi.jar jbigi
cd jbigi
unzip jbigi.jar
for lib in *.jnilib; do
codesign --force -s $I2P_SIGNER -v $lib
jar uf jbigi.jar $lib
done
cp jbigi.jar ../build
cd ..
fi
I2P_VERSION=$(java -cp build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1)
echo "preparing to invoke jpackage for I2P version $I2P_VERSION build $I2P_BUILD_NUMBER"
echo "preparing to invoke jpackage for I2P version $I2P_RELEASE_VERSION build $I2P_BUILD_NUMBER"
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P.icns
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P-volume.icns
cp $I2P_PKG/LICENSE.txt build
cp "$I2P_PKG/LICENSE.txt" build
cat resources/License-JRE-snippet.txt >> build/LICENSE.txt
cp resources/I2P-background.tiff build
cp resources/Info.plist.template build/Info.plist
sed -i.bak "s/I2P_VERSION/$I2P_VERSION/g" build/Info.plist
sed -i.bak "s/I2P_VERSION/$I2P_RELEASE_VERSION/g" build/Info.plist
sed -i.bak "s/I2P_BUILD_NUMBER/$I2P_BUILD_NUMBER/g" build/Info.plist
cp resources/I2P-dmg-setup.scpt.template build/I2P-dmg-setup.scpt
@ -104,6 +120,10 @@ sed -i.bak "s@__HERE__@${HERE}@g" build/I2P-dmg-setup.scpt
rm build/*.bak
if [ -z $I2P_SIGNER_USERPHRASE ]; then
SIGNING_ARG="--mac-signing-key-user-name $I2P_SIGNER_USERPHRASE"
fi
jpackage --name I2P \
--java-options "-Xmx512m" \
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
@ -112,53 +132,37 @@ jpackage --name I2P \
--type app-image \
--verbose \
--resource-dir build \
$SIGNING_ARG \
--mac-entitlements resources/entitlements.xml \
--input build --main-jar launcher.jar --main-class net.i2p.router.MacLauncher
echo "adding pkg-temp to resources"
cp -R $I2P_PKG/* I2P.app/Contents/Resources
cp -R "$I2P_PKG"/* I2P.app/Contents/Resources
for i in i2prouter lib locale man wrapper.config eepget runplain.sh postinstall.sh osid; do
rm -rf I2P.app/Contents/Resources/$i
done
cp $HERE/resources/GPLv2+CE.txt I2P.app/Contents/Resources/licenses/LICENSE-JRE.txt
cp $I2P_PKG/licenses/* I2P.app/Contents/Resources/licenses/
cp $HERE/build/libMacLauncher.jnilib I2P.app/Contents/Resources
if [ $ARCH == "arm64" ]; then
cp $HERE/resources/router.config.arm64 I2P.app/Contents/Resources/router.config
cp "$HERE"/resources/GPLv2+CE.txt I2P.app/Contents/Resources/licenses/LICENSE-JRE.txt
cp "$I2P_PKG"/licenses/* I2P.app/Contents/Resources/licenses/
cp "$HERE"/build/libMacLauncher.jnilib I2P.app/Contents/Resources
if [ "$ARCH" == "arm64" ]; then
cp "$HERE/resources/router.config.arm64" I2P.app/Contents/Resources/router.config
else
cp $HERE/resources/router.config I2P.app/Contents/Resources
cp "$HERE/resources/router.config" I2P.app/Contents/Resources
fi
cp $HERE/resources/*.crt I2P.app/Contents/Resources/certificates/router
# consider there might be some reason to re-enable this if an external maintainer arrives
#cp "$HERE"/resources/*.crt I2P.app/Contents/Resources/certificates/router
if [ -z $I2P_SIGNER ]; then
echo "I2P_SIGNER is unset, not proceeding to signing phase"
exit 0
fi
echo "signing the runtime libraries"
if [ $I2P_CODE_SIGNER = signer@mail.i2p ]; then
echo "I2P_CODE_SIGNER is unset, not signing dylibs or jnilibs, app will fail notarization"
else
find I2P.app -name *.dylib -exec codesign --force -s $I2P_CODE_SIGNER -v '{}' \;
find I2P.app -name *.jnilib -exec codesign --force -s $I2P_CODE_SIGNER -v '{}' \;
fi
if [ $I2P_SIGNER = signer@mail.i2p ]; then
echo "I2P_SIGNER is unset, not proceeding to signing phase"
exit 0
fi
echo "signing the bundle"
codesign --force -d --deep -f \
--options=runtime \
--entitlements resources/entitlements.xml \
-s $I2P_SIGNER \
--verbose=4 \
I2P.app
jpackage --name I2P --app-image I2P.app --app-version $I2P_VERSION \
--verbose --temp tmp \
--license-file build/LICENSE.txt \
--resource-dir build
jpackage --name I2P \
--java-options "-Xmx512m" \
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
--java-options "--add-opens java.base/sun.nio.fs=ALL-UNNAMED" \
--java-options "--add-opens java.base/java.nio=ALL-UNNAMED" \
--type dmg \
--verbose \
--resource-dir build \
$SIGNING_ARG \
--mac-entitlements resources/entitlements.xml \
--input build --main-jar launcher.jar --main-class net.i2p.router.MacLauncher
ls -lah I2P*.dmg
ls -lahd I2P*

View File

@ -15,6 +15,6 @@ rm -rfv \
prngseed.rnd \
router.config \
wrapper.log \
*.jar \
*.exe \
*.dmg
./*.jar \
./*.exe \
./*.dmg

39
config.example.sh Normal file
View File

@ -0,0 +1,39 @@
#! /usr/bin/env sh
# Uncomment/Edit this line to include the signer in the config file
# I2P_SIGNER=JIHGFEDCBA
# Uncomment/Edit this line to include the code signer in the config file
# I2P_CODE_SIGNER=ABCDEFGHIJ
# Uncomment/Edit this line to include the phrase identifying the signer to jpackage in the config file
# I2P_SIGNER_USERPHRASE=3rd Party Mac Developer Application: John Smith (ABCDEFGHIJ)
# Uncomment/Edit this line to include the version number in the config file
I2P_VERSION=i2p-2.7.0
# Uncomment/Edit this line to change the version number that you pass to jpackage
I2P_RELEASE_VERSION=2.7.0
# Uncomment/Edit this line to include the build number in the config file
# I2P_BUILD_NUMBER=1
if [ -z "$I2P_SIGNER" ]; then
# This is the team ID of the Apple account associated with the app. It is used to sign the DMG.
# it is a unique ID which is a short, random-looking string.
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_SIGNER not set, signing will not work"
fi
if [ -z "$I2P_CODE_SIGNER" ]; then
# This is the code signing ID of the team associated with the Apple Account. it is used to sign the libraries.
# it is a unique ID which is a short, random-looking string.
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_CODE_SIGNER not set, signing will not work"
fi
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
# This is an the phrase identifying the third party developer(I2P) in the following form:
# 3rd Party Mac Developer Application: John Smith (ABCDEFGHIJ)
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_SIGNER_USERPHRASE not set, signing will not work"
fi

View File

@ -1,26 +0,0 @@
#! /usr/bin/env sh
if [ -z $I2P_SIGNER ]; then
# This is the team ID of the Apple account associated with the app. It is used to sign the DMG.
# it is a unique ID which is a short, random-looking string.
I2P_SIGNER=signer@mail.i2p
fi
if [ -z $I2P_CODE_SIGNER ]; then
# This is the code signing ID of the team associated with the Apple Account. it is used to sign the libraries.
# it is a unique ID which is a short, random-looking string.
I2P_SIGNER=signer@mail.i2p
fi
if [ -z $I2P_VERSION ]; then
I2P_VERSION=2.0.0
fi
if [ -z $I2P_BUILD_NUMBER ]; then
I2P_BUILD_NUMBER=1
fi
# Uncomment/Edit this line to include the signer in the config file
# I2P_SIGNER=signer@mail.i2p
# Uncomment/Edit this line to include the code signer in the config file
# I2P_CODE_SIGNER=signer@mail.i2p
# Uncomment/Edit this line to include the version number in the config file
# I2P_VERSION=2.0.0
# Uncomment/Edit this line to include the build number in the config file
# I2P_BUILD_NUMBER=1

7
docs/RELEASE.md Normal file
View File

@ -0,0 +1,7 @@
Unsigned Output of I2P Easy-Install for Mac
===========================================
This is an unsigned `.dmg` package of the Java I2P router.
It consists of an I2P router embedded in a customized launcher.
It has been an "Official" I2P package in the past, however it has been partially broken for many years due to issues with notarization on Mac OSX.
This is functioning package, which should be ready for signing and notarization by any party who is able.

4
docs/SELF_SIGN.md Normal file
View File

@ -0,0 +1,4 @@
How to produce a Self-Signed Development Build of This Package
==============================================================
TODO: Explain this process, take screenshots.

View File

@ -1,19 +1,19 @@
#! /usr/bin/env sh
I2P_DATE=`date +%Y-%m-%d`
I2P_DATE=$(date +%Y-%m-%d)
if [ -z ${I2P_OS} ]; then
if [ -z "${I2P_OS}" ]; then
I2P_OS=mac
fi
if [ -z ${I2P_BRANCH} ]; then
if [ -z "${I2P_BRANCH}" ]; then
I2P_BRANCH=beta
fi
if [ -z ${I2P_DOWNLOAD} ]; then
if [ -z "${I2P_DOWNLOAD}" ]; then
echo "\$I2P_DOWNLOAD is not set, an HTTP download will not be added to releases.json"
sleep 5s
fi
if [ -z ${I2P_VERSION} ]; then
if [ -z "${I2P_VERSION}" ]; then
echo "\$I2P_VERSION not set, aborting"
exit 1
fi

View File

@ -1,32 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFkzCCA3ugAwIBAgIIefINnsa4ZtswDQYJKoZIhvcNAQENBQAwUzEeMBwGA1UE
BxMVSTJQIEFub255bW91cyBOZXR3b3JrMQwwCgYDVQQKEwNJMlAxDDAKBgNVBAsT
A0kyUDEVMBMGA1UEAwwMemFiQG1haWwuaTJwMB4XDTE5MDQwMzEzMTIzNVoXDTI5
MDQwMzEzMTIzNVowUzEeMBwGA1UEBxMVSTJQIEFub255bW91cyBOZXR3b3JrMQww
CgYDVQQKEwNJMlAxDDAKBgNVBAsTA0kyUDEVMBMGA1UEAwwMemFiQG1haWwuaTJw
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvkm0/e9w6iZT25A7AapZ
t6c2SdHZZrkVHOQXpgCfO5WzCbHyCKykXh1adxBU7YW1FQW1c/QrW7CPPN1qXmjB
S9bKv/VGoTkv/JA21eD4m887Ygtdmmm+EKgvRxa0spj7pqYj1Nuz2OYyYS4AxhJf
aNQG0Y4WMq+8+GK0eXF+DixsjZFDwFmKrsa7/Me9wO0W/eEhMoNSM9OVaZzFTrb5
Qes+2mAlRnd6vmHvA44aJM2aqxFpNHCIK3Pa6guj7mp4FCBq884HSHg4K2mA7esS
Ym47U1A6K6+Twwg8RtHpqUZ/HANk2rhlKyqynOvQSQvzuY6jujAL73++uJMRYF5h
nhVlzfmR3ijctl4WT1u49PkfhX+e0vqgloWKIO/Cg3x4OD8OJeZZI6kA42Q3vN4g
I3ZnxwbW8X4iPzF1LyTWMx6ABmEB4DBjlIk09TUYxt4grcUlYarOxfQkATyp+tMf
NjwvfWzU0766RVaIjvwA4zFSmzorRPSLEHwOc8SUz/ndTbZr88gt8ig5soEtsy+6
wGfKuxkvMrlcRRlJ0EVeRISeEZTV3cO7jo1Me7GgGk09aw0O701tzmnVJhqU0yi9
zxJeEoPWEazTPukk4qx/3p2pnQFp2z3tIphPuu/vMN+SZzOP0bvPtiepgDdJcRIf
WmZIHQ+mnyafplg8i+CLg6ECAwEAAaNrMGkwHQYDVR0OBBYEFHu2zaewzgpognLi
D8TJmXo5j47DMB8GA1UdIwQYMBaAFHu2zaewzgpognLiD8TJmXo5j47DMA4GA1Ud
DwEB/wQEAwIBpjAXBgNVHREEEDAOgQx6YWJAbWFpbC5pMnAwDQYJKoZIhvcNAQEN
BQADggIBABhISvTz6MJ/xqKklVxWrpWsbmtfCKewBQZBEVZLLwr2FEnC+CQl1wRT
yF5CwyOoz3MB+B2cmY8T45ffC9nVRf9AZzY9TyDFcJYkMFRGil1PrU1qjWK+MRh7
2R5KWrBZf709BmybcDZ8x6B2L94NivBjg7T+4B6bnkBkrZ6PQIsi2zbuM62uOF1v
xVLjwh3X7g4l6WmVubZFEOZ8QdPphhbCOrSufH6LFcKNVf5G52IaBSIvvOqPGzCl
2bYSCQ0q0QDkkVCJzfyupeX9ZBgNfKhx20r0oGcAMO55LEucqwDWNrcS5uvJpx+t
V+kNJUdgzZvNJfl5/2Y0FSqpZc0OOVq2b5vI7ZZmVOzo20NNjAg6Bme1Grwhbr4Z
ZuOmqHxxXpfVdIRVZ7iAVsBKTIMlo25MAYD+1BsN0uDq5K3kczqV8odMiAfVRkkX
E5xZgMsmjR9vn/nEpSMF5wT2IY0/w05hp9tnI1m8sPuu7wM9wPC/XXhxwa/8XFh4
lX29+kpi6W/WdnBFQfXX8f5bKDq2+q5MoSpz9s0WoIPWLDkQGPb9vs/Hw3vs8IJt
OdC6Uc1DawpGQhwiy0g+jmTjG8KSXCFeQv1u8q/yGIC2BAeor5y9HxsZq+6jvKtz
WNXTB3h5OC1YUiUOSvnvACeLSQSYc9qYM8yXM3TCJtX/tpEXrwNO
-----END CERTIFICATE-----