source: josm/trunk/native/windows/win-jpackage.sh@ 18153

Last change on this file since 18153 was 18153, checked in by Don-vip, 5 years ago

see #17083 - use signtool.exe extension, hopefully it will work...

  • Property svn:executable set to *
File size: 3.1 KB
Line 
1#!/bin/bash
2
3## Expected environment, passed from GitHub secrets:
4# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
5# SIGN_CERT PKCS12 certificate keystore used for code signing, base64 encoded
6# SIGN_STOREPASS Password for that keystore
7# SIGN_TSA URL of Time Stamping Authority to use
8
9set -Eeo pipefail
10
11# Don't show one time passwords
12set +x
13
14if [ -z "${1-}" ]
15then
16 echo "Usage: $0 josm_revision"
17 exit 1
18fi
19
20echo "Building JOSM Windows Installer package"
21
22mkdir app
23
24if [ -z "$SIGN_CERT" ] || [ -z "$SIGN_STOREPASS" ] || [ -z "$SIGN_TSA" ]
25then
26 echo "SIGN_CERT, SIGN_STOREPASS and SIGN_TSA are not set in the environment."
27 echo "A JOSM.msi will be created but not signed."
28 SIGNAPP=false
29else
30 SIGNAPP=true
31fi
32
33set -u
34
35JPACKAGEOPTIONS=""
36
37echo "Building MSI"
38jpackage $JPACKAGEOPTIONS -n "JOSM" --input dist --main-jar josm-custom.jar \
39 --main-class org.openstreetmap.josm.gui.MainApplication \
40 --icon ./native/windows/logo.ico --type msi --dest app \
41 --java-options "--add-exports=java.base/sun.security.action=ALL-UNNAMED" \
42 --java-options "--add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED" \
43 --java-options "--add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED" \
44 --java-options "--add-opens=java.base/java.lang=ALL-UNNAMED" \
45 --java-options "--add-opens=java.base/java.nio=ALL-UNNAMED" \
46 --java-options "--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED" \
47 --java-options "--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED" \
48 --java-options "--add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED" \
49 --java-options "--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED" \
50 --java-options "--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" \
51 --app-version "1.5.$1" \
52 --copyright "JOSM, and all its integral parts, are released under the GNU General Public License v2 or later" \
53 --vendor "JOSM" \
54 --file-associations native/file-associations/bz2.properties \
55 --file-associations native/file-associations/geojson.properties \
56 --file-associations native/file-associations/gpx.properties \
57 --file-associations native/file-associations/gz.properties \
58 --file-associations native/file-associations/jos.properties \
59 --file-associations native/file-associations/joz.properties \
60 --file-associations native/file-associations/osm.properties \
61 --file-associations native/file-associations/zip.properties \
62 --add-modules java.base,java.datatransfer,java.desktop,java.logging,java.management,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.sql,java.transaction.xa,java.xml,jdk.crypto.ec,jdk.jfr,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom
63
64mv app/JOSM-1.5.$1.msi app/JOSM.msi
65
66echo "Building done."
67
68if $SIGNAPP; then
69 CERTIFICATE_P12=certificate.p12
70 echo "$SIGN_CERT" | base64 --decode > $CERTIFICATE_P12
71 signtool.exe sign //f $CERTIFICATE_P12 //d "Java OpenStreetMap Editor" //du "https://josm.openstreetmap.de" //p "$SIGN_STOREPASS" //v //fd SHA256 //tr "$SIGN_TSA" //td SHA256 "app/JOSM.msi"
72 rm $CERTIFICATE_P12
73fi
Note: See TracBrowser for help on using the repository browser.