Skip to content

Commit 2f9f8a5

Browse files
RAMPART-454 Align GitHub Actions CI with axis2-java-core
Adopt the same three-job layout that axis2-java-core uses (build / site / deploy) and bring the runner/action versions in line: - Build matrix: Java 17, 21, 25 (was 17, 19), matching the JDK set that the 2.0.0 release is supported on. Each matrix entry runs -Dmaven.compiler.release=${{ matrix.java }} so the class file target actually tracks the JDK under test, not just the baseline. - runs-on: ubuntu-24.04 (was 22.04). - Actions: checkout@v6, cache@v5, setup-java@v5. - Java distribution: temurin (was zulu); centralised via DEFAULT_JAVA_DISTRIBUTION env var. - Add BASE_JAVA_VERSION=17 env var for the non-matrix jobs. New Site job: runs mvn package site-deploy on JDK 17 so that site regressions (e.g. the javadoc / apidocs aggregator classpath) are caught in CI instead of on release day. New Deploy job: gated on push-to-master for the apache/axis-axis2-java- rampart repository only, needs both build and site to be green, and pushes SNAPSHOTs to apache.snapshots.https using the NEXUS_USER / NEXUS_PW secrets (same mechanism as axis2-java-core). Every job ends by deleting -SNAPSHOT entries from the local Maven cache so they aren't inadvertently reused between runs when the cache key matches but the dependency tree has moved underneath.
1 parent d24a319 commit 2f9f8a5

1 file changed

Lines changed: 65 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,89 @@ on:
2222

2323
env:
2424
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
25-
25+
BASE_JAVA_VERSION: 17
26+
DEFAULT_JAVA_DISTRIBUTION: 'temurin'
2627
jobs:
2728
build:
2829
strategy:
2930
fail-fast: false
3031
matrix:
31-
java: [ 17, 19 ]
32+
java: [ 17, 21, 25 ]
3233
name: "Java ${{ matrix.java }}"
33-
runs-on: ubuntu-22.04
34+
runs-on: ubuntu-24.04
3435
steps:
3536
- name: Checkout
36-
uses: actions/checkout@v4
37+
uses: actions/checkout@v6
3738
- name: Cache Maven Repository
38-
uses: actions/cache@v4
39+
uses: actions/cache@v5
3940
with:
4041
path: ~/.m2/repository
4142
key: maven-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
4243
restore-keys: |
4344
maven-java-${{ matrix.java }}-
4445
maven-
4546
- name: Set up Java
46-
uses: actions/setup-java@v4
47+
uses: actions/setup-java@v5
4748
with:
48-
distribution: 'zulu'
4949
java-version: ${{ matrix.java }}
50+
distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
51+
- name: Build
52+
run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.compiler.release=${{ matrix.java }} verify
53+
- name: Remove Snapshots
54+
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
55+
site:
56+
name: Site
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v6
61+
- name: Cache Maven Repository
62+
uses: actions/cache@v5
63+
with:
64+
path: ~/.m2/repository
65+
key: maven-site-${{ hashFiles('**/pom.xml') }}
66+
restore-keys: |
67+
maven-site-
68+
maven-
69+
- name: Set up Java
70+
uses: actions/setup-java@v5
71+
with:
72+
java-version: ${{ env.BASE_JAVA_VERSION }}
73+
distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
5074
- name: Build
51-
run: mvn -B -e -Papache-release -Dgpg.skip=true verify
75+
run: mvn -B -e -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} package site-deploy
76+
- name: Remove Snapshots
77+
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
78+
deploy:
79+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'apache/axis-axis2-java-rampart'
80+
name: Deploy
81+
runs-on: ubuntu-24.04
82+
needs:
83+
- build
84+
- site
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v6
88+
- name: Cache Maven Repository
89+
uses: actions/cache@v5
90+
with:
91+
path: ~/.m2/repository
92+
key: maven-deploy-${{ hashFiles('**/pom.xml') }}
93+
restore-keys: |
94+
maven-deploy-
95+
maven-
96+
- name: Set up Java
97+
uses: actions/setup-java@v5
98+
with:
99+
java-version: ${{ env.BASE_JAVA_VERSION }}
100+
distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
101+
server-id: apache.snapshots.https
102+
server-username: NEXUS_USER
103+
server-password: NEXUS_PW
104+
- name: Deploy
105+
run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} deploy
106+
env:
107+
NEXUS_USER: ${{ secrets.NEXUS_USER }}
108+
NEXUS_PW: ${{ secrets.NEXUS_PW }}
52109
- name: Remove Snapshots
53110
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf

0 commit comments

Comments
 (0)