Skip to content

Commit 878db9d

Browse files
committed
Apply CI changes from v5
1 parent ab7ceec commit 878db9d

4 files changed

Lines changed: 62 additions & 48 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ updates:
77
schedule:
88
interval: weekly
99
day: monday
10+
time: "06:00"
11+
timezone: Europe/London
1012
target-branch: main
1113
assignees:
1214
- ascopes
@@ -19,6 +21,8 @@ updates:
1921
schedule:
2022
interval: weekly
2123
day: monday
24+
time: "06:00"
25+
timezone: Europe/London
2226
target-branch: main
2327
assignees:
2428
- ascopes

.github/workflows/build.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,36 @@ jobs:
2020
matrix:
2121
os-name: [ubuntu-latest]
2222
java-version:
23-
- 11 # LTS
2423
- 17 # LTS
2524
- 21 # LTS
25+
- GA # General access
26+
include:
27+
- os-name: windows-latest
28+
java-version: GA
29+
- os-name: macos-latest
30+
java-version: GA
31+
2632
steps:
2733
- name: Checkout repository
2834
uses: actions/checkout@v4
2935
with:
3036
fetch-depth: 2
3137

32-
- name: Initialize JDK
38+
- name: Initialize Zulu JDK
39+
if: matrix.java-version != 'GA'
3340
uses: actions/setup-java@v4
3441
with:
3542
check-latest: true
3643
distribution: zulu
3744
java-version: ${{ matrix.java-version }}
3845

46+
- name: Initialize Oracle JDK
47+
if: matrix.java-version == 'GA'
48+
uses: oracle-actions/setup-java@v1
49+
with:
50+
website: jdk.java.net
51+
release: ${{ matrix.java-version }}
52+
3953
- name: Maven cache
4054
uses: actions/cache@v4
4155
env:
@@ -44,7 +58,7 @@ jobs:
4458
path:
4559
~/.m2
4660
key: build-${{ env.cache-name }}
47-
61+
4862
- name: Compile and run tests
4963
shell: bash
5064
run: ./mvnw -B -U clean verify
@@ -66,3 +80,22 @@ jobs:
6680
**/failsafe-reports/**
6781
**/build*.log
6882
retention-days: 30
83+
84+
notify-coverage:
85+
name: Notify of coverage
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 30
88+
needs:
89+
- build
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v4
93+
94+
- name: Publish code coverage
95+
uses: codecov/codecov-action@v5
96+
continue-on-error: true
97+
if: always()
98+
with:
99+
token: ${{ secrets.CODECOV_TOKEN }}
100+
fail_ci_if_error: true
101+
run_command: send-notifications

.github/workflows/deploy.yml

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy a branch
1+
name: Release New Version
22

33
on:
44
workflow_dispatch:
@@ -8,14 +8,19 @@ on:
88
default: false
99
type: boolean
1010

11+
skip-tests:
12+
description: "Skip unit and integration tests"
13+
default: false
14+
type: boolean
15+
1116
version:
1217
description: "Override deployment version"
1318
default: ""
1419
type: string
1520

1621
jobs:
17-
maven-central:
18-
name: Deploy to Maven Central
22+
release:
23+
name: Release
1924
environment:
2025
name: maven-central
2126
url: https://repo1.maven.org/maven2/io/github/ascopes/jct/java-compiler-testing/
@@ -35,26 +40,21 @@ jobs:
3540
uses: actions/setup-java@v4
3641
with:
3742
distribution: zulu
38-
# Must use >= JDK 17 for Javadocs to generate correctly
39-
java-version: 23
40-
server-id: ossrh
41-
server-username: OSSRH_USERNAME
42-
server-password: OSSRH_TOKEN
43+
java-version: 24
44+
server-id: central
45+
server-username: CENTRAL_USERNAME
46+
server-password: CENTRAL_TOKEN
4347
gpg-passphrase: GPG_PASSPHRASE
4448
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
4549

46-
- name: Deploy to staging
47-
shell: bash
50+
- name: Configure Git
4851
run: |-
4952
git config user.name '${{ github.actor }}'
5053
git config user.email '${{ github.actor }}@users.noreply.github.com'
5154
52-
group_id="$(./mvnw help:evaluate -q -DforceStdout -Dexpression="project.groupId")"
53-
echo "group_id=${group_id}" >> "${GITHUB_ENV}"
54-
55-
artifact_id="$(./mvnw help:evaluate -q -DforceStdout -Dexpression="project.artifactId")"
56-
echo "artifact_id=${artifact_id}" >> "${GITHUB_ENV}"
57-
55+
- name: Create Maven Central Release
56+
shell: bash
57+
run: |-
5858
if [[ '${{ inputs.version }}' == "" ]]; then
5959
release_version="$(./mvnw -B help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//g')"
6060
else
@@ -65,50 +65,26 @@ jobs:
6565
./mvnw -B -e \
6666
-Preleases \
6767
-DdryRun='${{ inputs.dry-run }}' \
68+
-Dinvoker.skip='${{ inputs.skip-tests }}' \
6869
-Dpassword='${{ secrets.GITHUB_TOKEN }}' \
6970
-DreleaseVersion="${release_version}" \
7071
-DsignTag=false \
72+
-DskipTests='${{ inputs.skip-tests }}' \
7173
-Dtag="v${release_version}" \
7274
clean verify release:prepare release:perform
73-
74-
echo "Created staging release for ${group_id}/${artifact_id}/${release_version}"
7575
env:
76-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
77-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
76+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
77+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
7878
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7979

80-
- name: Promote Maven Central Staging Release
81-
if: ${{ ! inputs.dry-run }}
82-
shell: bash
83-
run: |-
84-
echo "Will now promote ${group_id}/${artifact_id}/${release_version} to Maven Central"
85-
86-
./scripts/close-nexus-repository.sh \
87-
-u "${OSSRH_USERNAME}" \
88-
-p "${OSSRH_TOKEN}" \
89-
-g "${group_id}" \
90-
-a "${artifact_id}" \
91-
-v "${release_version}" \
92-
-s "https://s01.oss.sonatype.org/"
93-
94-
echo "Promoted staging ${group_id}/${artifact_id}/${release_version} to Maven Central successfully"
95-
env:
96-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
97-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
98-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
99-
100-
- name: Abort and rollback staging release
80+
- name: Revert Maven Central Release
10181
if: ${{ failure() }}
10282
run: |-
10383
./mvnw -B -e \
10484
-Dpassword='${{ secrets.GITHUB_TOKEN }}' \
10585
-DreleaseVersion="${release_version}" \
10686
-Dtag="v${release_version}" \
10787
release:rollback
108-
env:
109-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
110-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
111-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
11288
11389
- name: Create GitHub Release
11490
if: ${{ ! inputs.dry-run }}

.github/workflows/security.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- v5
67

78
jobs:
89
submit-dependency-snapshot:

0 commit comments

Comments
 (0)