Skip to content

Commit

Permalink
Merge branch 'JOSM:master' into ticket_21881
Browse files Browse the repository at this point in the history
  • Loading branch information
gabortim authored Apr 20, 2024
2 parents 41c3e42 + 6677750 commit bf33e49
Show file tree
Hide file tree
Showing 316 changed files with 6,805 additions and 4,839 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ant-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ jobs:
fail-fast: false
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [8, 11, 17, 21, 22-ea]
java: [8, 11, 17, 21, 22]
os: [ubuntu-latest, macos-latest, windows-latest]
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
~/work/josm/josm/tools/
key: ${{ runner.os }}-ivy2-${{ hashFiles('build.xml', 'ivy.xml', 'tools/ivy.xml') }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}

- name: Install Ant
uses: JOSM/JOSMPluginAction/actions/setup-ant@v1
uses: JOSM/JOSMPluginAction/actions/setup-ant@v2

- name: Test with Ant
run: |
Expand All @@ -56,12 +56,13 @@ jobs:

- name: Upload Ant reports
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }}
path: |
test/report/*.txt
test/report/TEST*.xml
hs_err*
publish-test-results:
name: "Publish Unit Tests Results"
Expand All @@ -72,13 +73,13 @@ jobs:

steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Report with action-junit-report
if: ${{ always() }}
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
with:
report_paths: 'artifacts/**/*.xml'
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
82 changes: 62 additions & 20 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Java CI Build
env:
junit_platform_version: '1.9.3'
JAVAFX_VERSION: '17.0.7'
on:
push:
Expand All @@ -24,7 +23,7 @@ jobs:
josm_release_tag: ${{ steps.create_revision.outputs.josm_release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

Expand Down Expand Up @@ -59,6 +58,7 @@ jobs:
JOSM release ${{ env.josm_release_tag }}
draft: false
prerelease: ${{ env.josm_prerelease }}
if: github.ref == 'refs/heads/master'

build:
needs: createrelease
Expand All @@ -69,31 +69,39 @@ jobs:
fail-fast: false
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [8, 11, 17, 21, 22-ea]
os: [ubuntu-latest, macos-latest, windows-latest]
java: [8, 11, 17, 21, 22]
os: [ubuntu-latest, macos-14, windows-latest]
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
~/work/josm/josm/tools/
key: ${{ runner.os }}-ivy2-${{ hashFiles('build.xml', 'ivy.xml', 'tools/ivy.xml') }}

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}

- name: Setup x64 Java (Mac) ${{ matrix.java }}
if: ${{ runner.os == 'macos' && runner.arch == 'ARM64' && always() }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
architecture: x64

- name: Install Ant
uses: JOSM/JOSMPluginAction/actions/setup-ant@v1
uses: JOSM/JOSMPluginAction/actions/setup-ant@v2

- name: Optimise images
if: ${{ runner.os == 'macos' && always() }}
Expand All @@ -113,18 +121,20 @@ jobs:
SIGN_TSA: ${{ secrets.SIGN_TSA }}
# Calls ant with -Dreleasebuild=true if we're a 'tested' build
run: |
export SIGN_KEYSTORE=certificate.p12
echo "$SIGN_CERT" | base64 --decode > $SIGN_KEYSTORE
if [ ! -z "${SIGN_CERT}" ]; then
export SIGN_KEYSTORE=certificate.p12
echo "$SIGN_CERT" | base64 --decode > $SIGN_KEYSTORE
fi
if [ "${{ needs.createrelease.outputs.josm_prerelease }}" == "true" ]; then
ANT="ant"
else
ANT="ant -Dreleasebuild=true"
fi
$ANT dist
rm $SIGN_KEYSTORE
if [ ! -z "${SIGN_KEYSTORE}" ]; then rm $SIGN_KEYSTORE; fi
- name: Upload jar
if: ${{ always() }}
if: ${{ always() && needs.createrelease.outputs.upload_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1
Expand All @@ -143,12 +153,22 @@ jobs:
APPLE_ID_PW: ${{ secrets.APPLE_ID_PW }}
APPLE_ID_TEAM: ${{ secrets.APPLE_ID_TEAM }}
run: |
if [ ! -f tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}-jmods.zip ]; then
curl -o tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}-jmods.zip https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-${JAVAFX_VERSION}_osx-x64_bin-jmods.zip
function setup_openjfx() {
if [ ! -f tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}_${2}-jmods.zip ]; then
curl -o tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}_${2}-jmods.zip https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-${JAVAFX_VERSION}_osx-${1}_bin-jmods.zip
fi
unzip tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}_${2}-jmods.zip
mv javafx-jmods-${JAVAFX_VERSION}/*.jmod $JAVA_HOME/jmods/
}
if [ ${{ runner.arch }} == "ARM64" ]; then
JAVA_HOME="${JAVA_HOME_${{ matrix.java }}_ARM64}" PATH="${JAVA_HOME_${{ matrix.java }}_ARM64}/bin:${PATH}" setup_openjfx aarch64 ARM64
JAVA_HOME="${JAVA_HOME_${{ matrix.java }}_X64}" PATH="${JAVA_HOME_${{ matrix.java }}_X64}/bin:${PATH}" setup_openjfx x64 X64
JAVA_HOME="${JAVA_HOME_${{ matrix.java }}_ARM64}" ./native/macosx/macos-jpackage.sh ${{ needs.createrelease.outputs.josm_revision }} "${JAVA_HOME_${{ matrix.java }}_X64}"
else
setup_openjfx x64 X64
./native/macosx/macos-jpackage.sh ${{ needs.createrelease.outputs.josm_revision }}
fi
unzip tools/openjfx-${JAVAFX_VERSION}_${{ runner.os }}-jmods.zip
mv javafx-jmods-${JAVAFX_VERSION}/*.jmod $JAVA_HOME/jmods/
./native/macosx/macos-jpackage.sh ${{ needs.createrelease.outputs.josm_revision }}
- name: Setup Windows PATH
if: ${{ runner.os == 'windows' && matrix.java != '8' && matrix.java != '11' && always() }}
Expand All @@ -172,7 +192,7 @@ jobs:
./native/windows/win-jpackage.sh ${{ needs.createrelease.outputs.josm_revision }}
- name: Upload macOS app
if: ${{ runner.os == 'macos' && matrix.java != '8' && matrix.java != '11' && always() }}
if: ${{ runner.os == 'macos' && matrix.java != '8' && matrix.java != '11' && always() && needs.createrelease.outputs.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -182,8 +202,30 @@ jobs:
asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}.zip
asset_content_type: application/zip

- name: Upload macOS app (x64)
if: ${{ runner.os == 'macos' && matrix.java != '8' && matrix.java != '11' && always() && runner.arch == 'ARM64' && needs.createrelease.outputs.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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`.
asset_path: app/JOSM_${{ matrix.java }}_x86_64.zip
asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}-x64.zip
asset_content_type: application/zip

- name: Upload macOS app (aarch64)
if: ${{ runner.os == 'macos' && matrix.java != '8' && matrix.java != '11' && always() && runner.arch == 'ARM64' && needs.createrelease.outputs.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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`.
asset_path: app/JOSM_${{ matrix.java }}_arm64.zip
asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}-aarch64.zip
asset_content_type: application/zip

- name: Upload Windows Installer executable
if: ${{ runner.os == 'windows' && matrix.java != '8' && matrix.java != '11' && always() }}
if: ${{ runner.os == 'windows' && matrix.java != '8' && matrix.java != '11' && always() && needs.createrelease.outputs.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -194,7 +236,7 @@ jobs:
asset_content_type: application/vnd.microsoft.portable-executable

- name: Upload Windows Installer package
if: ${{ runner.os == 'windows' && matrix.java != '8' && matrix.java != '11' && always() }}
if: ${{ runner.os == 'windows' && matrix.java != '8' && matrix.java != '11' && always() && needs.createrelease.outputs.upload_url }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/checkstyle-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
Expand All @@ -31,7 +31,7 @@ jobs:
ant checkstyle
- name: Upload report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: checkstyle-josm.xml

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pmd-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
Expand All @@ -31,7 +31,7 @@ jobs:
ant pmd
- name: Upload report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: pmd-josm.xml

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/spotbugs-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 256

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.ivy2/cache/
Expand All @@ -31,7 +31,7 @@ jobs:
ant spotbugs
- name: Upload report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: spotbugs-josm.xml

Expand Down
Loading

0 comments on commit bf33e49

Please sign in to comment.