Deploy snapshots (once) if all platforms build successfully.
@@ -24,6 +24,7 @@ on:
permissions: read-all
jobs:
+
build:
runs-on: ${{ matrix.os }}
@@ -98,8 +99,43 @@ jobs:
--global-toolchains ".github/workflows/maven-toolchains.xml" \
site
- - name: Maven "deploy"
+ deploy:
+
+ runs-on: ubuntu-latest
+ needs: build
if: github.repository == 'apache/logging-log4j2' && github.ref == 'refs/heads/release-2.x'
+
+ steps:
+
+ - name: Checkout repository
+ uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 # 3.0.1
+
+ # JDK 11 is needed for the build.
+ # Search `maven-toolchains-plugin` usages for details.
+ - name: Setup JDK 11
+ uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 # 3.1.1
+ with:
+ distribution: temurin
+ java-version: 11
+ java-package: jdk
+ architecture: x64
+ cache: maven
+
+ # JDK 8 is needed for the build, and it is the primary bytecode target.
+ # Hence, JDK 8 is set up after 11, so that JAVA_HOME used by Maven during build will point to 8.
+ - name: Setup JDK 8
+ uses: actions/setup-java@9519cf1382ac8dc61ad461f7f7cb45f033220189 # 3.1.1
+ with:
+ distribution: temurin
+ java-version: 8
+ java-package: jdk
+ architecture: x64
+ cache: maven
+
+ - name: Inspect environment
+ run: env | grep '^JAVA'
+
+ - name: Maven "deploy"
timeout-minutes: 15
shell: bash
run: |
