Changeset 17373 in josm
- Timestamp:
- 2020-11-28T17:39:56+01:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/ant.yml
r17287 r17373 15 15 16 16 jobs: 17 createrelease: 18 name: Create Release 19 runs-on: ubuntu-latest 20 env: 21 LANG: en_US.UTF-8 22 outputs: 23 upload_url: ${{ steps.create_release.outputs.upload_url }} 24 josm_revision: ${{ steps.create_revision.outputs.josm_revision }} 25 josm_prerelease: ${{ steps.create_revision.outputs.josm_prerelease }} 26 steps: 27 - name: Checkout 28 uses: actions/checkout@v2 29 with: 30 fetch-depth: 32 31 - name: Set revision env variable 32 id: create_revision 33 # grab josm revision from last git-svn-id 34 run: | 35 josm_revision="$(git log -1 --grep 'git-svn-id: https://josm.openstreetmap.de/svn/trunk@' --pretty=format:%B | tail -1 | sed -n 's%git-svn-id: https://josm.openstreetmap.de/svn/trunk@\([0-9]*\) [-0-9a-f]*%\1%p')" 36 if [[ "$josm_revision" == "$(curl --silent https://josm.openstreetmap.de/tested)" ]]; then 37 sed -i '/Is-Local-Build/d' resources/REVISION 38 echo "josm_prerelease=false" >> $GITHUB_ENV 39 echo "::set-output name=josm_prerelease::false" 40 echo "josm_release=$josm_revision-tested" >> $GITHUB_ENV 41 else 42 echo "josm_prerelease=true" >> $GITHUB_ENV 43 echo "::set-output name=josm_prerelease::true" 44 echo "josm_release=$josm_revision" >> $GITHUB_ENV 45 fi 46 echo "josm_revision=$josm_revision" >> $GITHUB_ENV 47 echo "::set-output name=josm_revision::$josm_revision" 48 - name: Create release 49 id: create_release 50 uses: actions/create-release@v1 51 env: 52 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 53 with: 54 tag_name: ${{ env.josm_release }} 55 release_name: JOSM.app release ${{ env.josm_release }} 56 body: | 57 JOSM.app release ${{ env.josm_release }} 58 draft: false 59 prerelease: ${{ env.josm_prerelease }} 17 60 build: 61 needs: createrelease 18 62 runs-on: ${{ matrix.os }} 19 63 env: … … 31 75 - java: 11 32 76 os: macos-latest 33 - java: 16-ea34 os: macos-latest35 77 - headless: "false" 36 78 os: macos-latest … … 42 84 uses: actions/checkout@v2 43 85 with: 44 fetch-depth: 12886 fetch-depth: 32 45 87 - name: Cache 46 88 uses: actions/cache@v2.0.0 … … 49 91 ~/.ivy2/cache/ 50 92 ~/work/josm/josm/tools/ 93 build-tools-cache/ 51 94 key: ${{ runner.os }}-ivy2-${{ hashFiles('ivy.xml') }} 52 95 - name: Setup java … … 55 98 java-version: ${{ matrix.java }} 56 99 - name: Install ant ${{ env.ANT_HOME }} and junit ${{ env.junit_platform_version }} 57 # Todo: cache ant and junit, saves 12 seconds.58 100 run: | 59 curl -s https://downloads.apache.org/ant/binaries/${{ env.ANT_HOME }}-bin.tar.gz | tar -xz 60 curl -o ${{ env.ANT_HOME }}/lib/junit-platform-console-standalone-${{ env.junit_platform_version }}.jar "https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/${{ env.junit_platform_version }}/junit-platform-console-standalone-${{ env.junit_platform_version }}.jar" 101 mkdir -p build-tools-cache/ 102 cd build-tools-cache/ 103 if [ ! -f ${{ env.ANT_HOME }}-bin.tar.gz ]; then 104 curl -o ${{ env.ANT_HOME }}-bin.tar.gz https://downloads.apache.org/ant/binaries/${{ env.ANT_HOME }}-bin.tar.gz 105 fi 106 if [ ! -f junit-platform-console-standalone-${{ env.junit_platform_version }}.jar ]; then 107 curl -o junit-platform-console-standalone-${{ env.junit_platform_version }}.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/${{ env.junit_platform_version }}/junit-platform-console-standalone-${{ env.junit_platform_version }}.jar 108 fi 109 cd .. 110 tar zxf build-tools-cache/${{ env.ANT_HOME }}-bin.tar.gz 111 cp build-tools-cache/junit-platform-console-standalone-${{ env.junit_platform_version }}.jar ${{ env.ANT_HOME }}/lib/junit-platform-console-standalone-${{ env.junit_platform_version }}.jar 61 112 - name: Print ant version, expecting ${{ env.ANT_HOME }} 62 113 run: ${{ env.ANT_HOME }}/bin/ant -version 63 - name: Set revision env variable 114 - name: Optimise images 115 if: ${{ runner.os == 'macos' && always() }} 64 116 run: | 65 ant create-revision 66 josm_revision=`awk '/Revision/{print $2}' resources/REVISION` 67 if [[ "$josm_revision" == `curl --silent https://josm.openstreetmap.de/tested` ]]; then 68 sed -i .bak '/Is-Local-Build/d' resources/REVISION 69 echo "josm_prerelease=false" >> $GITHUB_ENV 117 brew cask install imageoptim 118 defaults write net.pornel.ImageOptim SvgoEnabled 1 119 defaults write net.pornel.ImageOptim PngCrush2Enabled 1 120 defaults write net.pornel.ImageOptim PngOutEnabled 1 121 /Applications/ImageOptim.app/Contents/MacOS/ImageOptim resources/images 122 - name: Build with Ant 123 # Disables errorprone for Java 16 124 # See https://github.com/google/error-prone/issues/1872 125 run: | 126 if [[ "x${{ matrix.java }}x" =~ x1[6-9](-ea)?x ]]; then 127 ${{ env.ANT_HOME }}/bin/ant -DnoErrorProne dist 70 128 else 71 echo "josm_prerelease=true" >> $GITHUB_ENV129 ${{ env.ANT_HOME }}/bin/ant dist 72 130 fi 73 echo "josm_revision=$josm_revision" >> $GITHUB_ENV 74 - name: Build with Ant, headless ${{ matrix.headless }} 131 - name: Upload jar 132 if: ${{ always() && matrix.headless }} 133 id: upload-jar 134 uses: actions/upload-release-asset@v1 135 env: 136 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 137 with: 138 upload_url: ${{ needs.createrelease.outputs.upload_url }} # This pulls from the CREATE RELEASE job above, referencing its ID to get its outputs object, which include a `upload_url`. 139 asset_path: dist/josm-custom.jar 140 asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}.jar 141 asset_content_type: application/java-archive 142 - name: Test with Ant, headless ${{ matrix.headless }} 143 if: ${{ needs.createrelease.outputs.josm_prerelease }} 75 144 run: | 76 145 ANT="${{ env.ANT_HOME }}/bin/ant -DnoJavaFX=true test-unit-hardfail" … … 87 156 uses: actions/upload-artifact@v2 88 157 with: 89 name: Ant reports for JOSM ${{ env.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }} with headless=${{ matrix.headless }}158 name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }} with headless=${{ matrix.headless }} 90 159 path: test/report/*.txt 91 - name: Optimise images92 if: ${{ runner.os == 'macos' && always() }}93 run: |94 brew cask install imageoptim95 defaults write net.pornel.ImageOptim SvgoEnabled 196 defaults write net.pornel.ImageOptim PngCrush2Enabled 197 defaults write net.pornel.ImageOptim PngOutEnabled 198 /Applications/ImageOptim.app/Contents/MacOS/ImageOptim resources/images99 160 - name: Build and package for macOS 100 161 if: ${{ runner.os == 'macos' && always() }} … … 104 165 APPLE_ID_PW: ${{ secrets.APPLE_ID_PW }} 105 166 run: | 106 $ANT_HOME/bin/ant -DnoErrorProne dist 107 ./native/macosx/macos-jpackage.sh ${{ env.josm_revision }} 108 - name: Create macOS release 109 if: ${{ runner.os == 'macos' && always() }} 110 id: create_release 111 uses: actions/create-release@v1 112 env: 113 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 114 with: 115 tag_name: ${{ env.josm_revision }} 116 release_name: JOSM.app release ${{ env.josm_revision }} 117 body: | 118 JOSM.app release ${{ env.josm_revision }} 119 draft: false 120 prerelease: ${{ env.josm_prerelease }} 167 ./native/macosx/macos-jpackage.sh ${{ needs.createrelease.outputs.josm_revision }} 121 168 - name: Upload app 122 169 if: ${{ runner.os == 'macos' && always() }} … … 126 173 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 127 174 with: 128 upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASEstepabove, referencing its ID to get its outputs object, which include a `upload_url`.See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps175 upload_url: ${{ needs.createrelease.outputs.upload_url }} # This pulls from the CREATE RELEASE job above, referencing its ID to get its outputs object, which include a `upload_url`. 129 176 asset_path: app/JOSM.zip 130 177 asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}.zip 131 178 asset_content_type: application/zip 132 - name: Upload jar133 if: ${{ runner.os == 'macos' && always() }}134 id: upload-jar135 uses: actions/upload-release-asset@v1136 env:137 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}138 with:139 upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps140 asset_path: dist/josm-custom.jar141 asset_name: josm-latest.jar142 asset_content_type: application/java-archive -
trunk/native/macosx/macos-jpackage.sh
r17244 r17373 18 18 19 19 mkdir app 20 jpackage -n "JOSM" --input dist --main-jar josm-custom.jar \21 --main-class org.openstreetmap.josm.gui.MainApplication \22 --icon ./native/macosx/JOSM.icns --type app-image --dest app \23 --java-options "-Xmx8192m" --app-version $1 \24 --copyright "JOSM, and all its integral parts, are released under the GNU General Public License v2 or later" \25 --vendor "https://josm.openstreetmap.de" \26 --file-associations native/macosx/bz2.properties \27 --file-associations native/macosx/geojson.properties \28 --file-associations native/macosx/gpx.properties \29 --file-associations native/macosx/gz.properties \30 --file-associations native/macosx/jos.properties \31 --file-associations native/macosx/joz.properties \32 --file-associations native/macosx/osm.properties \33 --file-associations native/macosx/zip.properties \34 --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.dom35 36 echo "Building done."37 20 38 21 if [[ $IMPORT_AND_UNLOCK_KEYCHAIN == 1 ]]; then … … 53 36 54 37 KEYCHAIN=build.keychain 38 KEYCHAINPATH=~/Library/Keychains/$KEYCHAIN-db 55 39 KEYCHAIN_PW=`head /dev/urandom | base64 | head -c 20` 56 40 CERTIFICATE_P12=certificate.p12 … … 67 51 fi 68 52 69 echo "Signing App Bundle…" 53 echo "Building and signin app" 54 jpackage -n "JOSM" --input dist --main-jar josm-custom.jar \ 55 --main-class org.openstreetmap.josm.gui.MainApplication \ 56 --icon ./native/macosx/JOSM.icns --type app-image --dest app \ 57 --java-options "-Xmx8192m" \ 58 --java-options "-Dapple.awt.application.appearance=system" \ 59 --app-version $1 \ 60 --copyright "JOSM, and all its integral parts, are released under the GNU General Public License v2 or later" \ 61 --vendor "https://josm.openstreetmap.de" \ 62 --mac-sign \ 63 --mac-package-identifier de.openstreetmap.josm \ 64 --mac-package-signing-prefix de.openstreetmap.josm \ 65 --mac-signing-keychain $KEYCHAINPATH \ 66 --file-associations native/macosx/bz2.properties \ 67 --file-associations native/macosx/geojson.properties \ 68 --file-associations native/macosx/gpx.properties \ 69 --file-associations native/macosx/gz.properties \ 70 --file-associations native/macosx/jos.properties \ 71 --file-associations native/macosx/joz.properties \ 72 --file-associations native/macosx/osm.properties \ 73 --file-associations native/macosx/zip.properties \ 74 --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 70 75 71 codesign -vvv --timestamp --options runtime --deep --force --sign "$SIGNING_KEY_NAME" \ 72 app/JOSM.app/Contents/MacOS/JOSM \ 73 app/JOSM.app/Contents/runtime/Contents/Home/lib/*.jar \ 74 app/JOSM.app/Contents/runtime/Contents/Home/lib/*.dylib \ 75 app/JOSM.app/Contents/runtime/Contents/MacOS/libjli.dylib 76 77 codesign -vvv --timestamp --entitlements native/macosx/josm.entitlements --options runtime --force --sign "$SIGNING_KEY_NAME" app/JOSM.app 78 79 codesign -vvv app/JOSM.app 76 echo "Building done." 80 77 81 78 echo "Preparing for notarization"
Note:
See TracChangeset
for help on using the changeset viewer.