From 9f0e9a2e2cb4417bda83bd93fd55e3c0b67eb700 Mon Sep 17 00:00:00 2001 From: Valery Kharseko Date: Tue, 7 May 2024 19:01:43 +0300 Subject: [PATCH] Build add MacOs m1 arm64 support on jdk 1.8 (#67) --- .github/workflows/build.yml | 34 +++++++++---------- .github/workflows/deploy.yml | 10 +++--- .github/workflows/release.yml | 28 +++++++-------- .../openig/handler/router/MetricsFilter.java | 2 +- openig-ui/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a79bf4872..3009a552b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,17 +14,17 @@ jobs: os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Java ${{ matrix.Java }} (${{ matrix.os }}) - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: 'temurin' + distribution: 'zulu' - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-repository-${{ hashFiles('**/pom.xml') }} @@ -34,7 +34,7 @@ jobs: MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10 run: mvn --batch-mode --errors --update-snapshots package --file pom.xml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.java }} retention-days: 5 @@ -49,18 +49,18 @@ jobs: ports: - 5000:5000 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Get latest release version shell: bash run: | - git fetch -t; export git_version_last="$(git describe --abbrev=0 --tags)" ; echo "last release: $git_version_last" + export git_version_last="$(curl -i -o - --silent https://api.github.com/repos/OpenIdentityPlatform/OpenIG/releases/latest | grep -m1 "\"name\"" | cut -d\" -f4)" ; echo "last release: $git_version_last" echo "release_version=$git_version_last" >> $GITHUB_ENV - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | localhost:5000/${{ github.repository }} @@ -68,13 +68,13 @@ jobs: type=raw,value=latest type=raw,value=${{ env.release_version }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: driver-opts: network=host - name: Build image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 continue-on-error: true with: context: ./openig-docker @@ -98,18 +98,18 @@ jobs: ports: - 5000:5000 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Get latest release version shell: bash run: | - git fetch -t; export git_version_last="$(git describe --abbrev=0 --tags)" ; echo "last release: $git_version_last" + export git_version_last="$(curl -i -o - --silent https://api.github.com/repos/OpenIdentityPlatform/OpenIG/releases/latest | grep -m1 "\"name\"" | cut -d\" -f4)" ; echo "last release: $git_version_last" echo "release_version=$git_version_last" >> $GITHUB_ENV - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | localhost:5000/${{ github.repository }} @@ -117,13 +117,13 @@ jobs: type=raw,value=alpine type=raw,value=${{ env.release_version }}-alpine - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: driver-opts: network=host - name: Build image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 continue-on-error: true with: context: ./openig-docker diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4a1c3b85d..13b06fe93 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,12 +15,12 @@ jobs: env: GITHUB_CONTEXT: ${{ toJSON(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Set up Java for publishing to Maven Central Repository OSS - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '8' distribution: 'temurin' @@ -28,7 +28,7 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-repository-${{ hashFiles('**/pom.xml') }} @@ -55,12 +55,12 @@ jobs: if: ${{ github.event.workflow_run.event=='push' && env.MAVEN_USERNAME!='' && env.MAVEN_PASSWORD!=''}} run: mvn --batch-mode --errors --update-snapshots -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy --file pom.xml - name: Upload artifacts OpenIG Server Only Component - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: OpenIG Server path: openig-war/target/*.war - name: Upload artifacts OpenIG Dockerfile - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: OpenIG Dockerfile path: openig-docker/target/Dockerfile* \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16c8b6ac9..e32f04a6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,12 +19,12 @@ jobs: env: GITHUB_CONTEXT: ${{ toJSON(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Set up Java for publishing to Maven Central Repository OSS - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '8' distribution: 'temurin' @@ -32,7 +32,7 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-repository-${{ hashFiles('**/pom.xml') }} @@ -59,7 +59,7 @@ jobs: if: ${{ env.MAVEN_USERNAME!='' && env.MAVEN_PASSWORD!='' }} run: mvn --batch-mode -Darguments="-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}" -DsignTag=true -DtagNameFormat="${{ github.event.inputs.releaseVersion }}" -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} release:prepare release:perform --file pom.xml - name: Release on GitHub - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: ${{ github.event.inputs.releaseVersion }} tag_name: ${{ github.event.inputs.releaseVersion }} @@ -75,14 +75,14 @@ jobs: needs: - release-maven steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.releaseVersion }} fetch-depth: 1 submodules: recursive - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ github.repository }} @@ -91,9 +91,9 @@ jobs: type=raw,value=latest type=raw,value=${{ github.event.inputs.releaseVersion }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v2 with: @@ -106,7 +106,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 continue-on-error: true with: context: ./openig-docker @@ -122,14 +122,14 @@ jobs: needs: - release-maven steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.releaseVersion }} fetch-depth: 1 submodules: recursive - name: Docker meta (alpine) id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ github.repository }} @@ -138,9 +138,9 @@ jobs: type=raw,value=alpine type=raw,value=${{ github.event.inputs.releaseVersion }}-alpine - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v2 with: @@ -154,7 +154,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push image continue-on-error: true - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ./openig-docker file: ./openig-docker/Dockerfile-alpine diff --git a/openig-core/src/main/java/org/forgerock/openig/handler/router/MetricsFilter.java b/openig-core/src/main/java/org/forgerock/openig/handler/router/MetricsFilter.java index 466db5eb3..e0cb0bd32 100644 --- a/openig-core/src/main/java/org/forgerock/openig/handler/router/MetricsFilter.java +++ b/openig-core/src/main/java/org/forgerock/openig/handler/router/MetricsFilter.java @@ -61,7 +61,7 @@ public Promise filter(final Context context, public void handleResult(final Response result) { // Elapsed time is computed in microseconds long elapsed = TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - start); - metrics.getAccumulatedResponseTime().inc(elapsed); + metrics.getAccumulatedResponseTime().inc(elapsed==0?1:elapsed); metrics.getResponseTime().update(elapsed); metrics.getThroughput().mark(); diff --git a/openig-ui/pom.xml b/openig-ui/pom.xml index d06fb87b2..cf368310a 100644 --- a/openig-ui/pom.xml +++ b/openig-ui/pom.xml @@ -68,7 +68,7 @@ initialize - v10.16.3 + v20.12.2 6.12.0 diff --git a/pom.xml b/pom.xml index 88d34badd..c37e44b33 100644 --- a/pom.xml +++ b/pom.xml @@ -1079,7 +1079,7 @@ org.openidentityplatform.openam openam - 14.8.3 + 14.8.5-SNAPSHOT pom import