Skip to content

Commit 6fdcea2

Browse files
committed
ci: configure Maven mirror via gh-automation composite actions
Switches from the gh-automation reusable workflow (`ci-gradle.yml`) to its finer-grained composite-action form, so we can inject `s4u/maven-settings-action` between `setup` and `build`. The action writes a `~/.m2/settings.xml` whose wildcard mirror points at Moderne's Artifactory cache; the MavenSettingsAutoLoadingExtension introduced earlier in this PR loads it into the test ExecutionContext, avoiding Maven Central's HTTP 404 + Retry-After throttling under parallel test load. The composite actions land in openrewrite/gh-automation#94.
1 parent a34f26f commit 6fdcea2

1 file changed

Lines changed: 37 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,40 @@ concurrency:
2020

2121
jobs:
2222
build:
23-
uses: openrewrite/gh-automation/.github/workflows/ci-gradle.yml@main
24-
with:
25-
java_version: |
26-
25
27-
21
28-
secrets:
29-
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
30-
sonatype_username: ${{ secrets.SONATYPE_USERNAME }}
31-
sonatype_token: ${{ secrets.SONATYPE_TOKEN}}
32-
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
33-
ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }}
34-
OPS_GITHUB_ACTIONS_WEBHOOK: ${{ secrets.OPS_GITHUB_ACTIONS_WEBHOOK }}
35-
node_auth_token: ${{ secrets.NPM_TOKEN }}
36-
pypi_token: ${{ secrets.PYPI_OPENREWRITE_PUBLISH }}
37-
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
23+
runs-on: ubuntu-latest
24+
if: github.event_name != 'schedule' || github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc'
25+
steps:
26+
- uses: openrewrite/gh-automation/.github/actions/setup@main
27+
with:
28+
java_version: |
29+
25
30+
21
31+
develocity_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
32+
33+
# Route Maven resolution through Moderne's Artifactory cache to avoid
34+
# Maven Central rate-limiting (HTTP 404 + Retry-After) under parallel
35+
# test load. Picked up by MavenSettingsAutoLoadingExtension at test time.
36+
- uses: s4u/maven-settings-action@v3.1.0
37+
with:
38+
mirrors: '[{"id": "moderne-cache", "name": "Moderne Artifactory Cache", "mirrorOf": "*", "url": "https://artifactory.moderne.ninja/artifactory/moderne-cache-3/"}]'
39+
40+
- uses: openrewrite/gh-automation/.github/actions/build@main
41+
42+
- if: failure() && github.event_name == 'schedule' && (github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc')
43+
uses: openrewrite/gh-automation/.github/actions/slack-failure@main
44+
with:
45+
webhook: ${{ secrets.OPS_GITHUB_ACTIONS_WEBHOOK }}
46+
47+
- if: >
48+
github.event_name != 'pull_request' &&
49+
github.ref == 'refs/heads/main' &&
50+
(github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc')
51+
uses: openrewrite/gh-automation/.github/actions/publish-snapshots@main
52+
with:
53+
sonatype_username: ${{ secrets.SONATYPE_USERNAME }}
54+
sonatype_token: ${{ secrets.SONATYPE_TOKEN }}
55+
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
56+
ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }}
57+
node_auth_token: ${{ secrets.NPM_TOKEN }}
58+
pypi_token: ${{ secrets.PYPI_OPENREWRITE_PUBLISH }}
59+
nuget_api_key: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)