Skip to content

Commit 9f4ca26

Browse files
authored
Adds a nightly build to produce Maven SNAPSHOT artifacts (#5805)
Adds a nightly build to produce Maven SNAPSHOT artifacts to the Maven Central snapshots repo. Signed-off-by: David Venable <dlv@amazon.com>
1 parent be0ee98 commit 9f4ca26

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish SNAPSHOT artifacts to Maven snapshot repository.
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 5 * * Mon-Fri'
7+
8+
jobs:
9+
build-and-publish-snapshots:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
id-token: write
14+
contents: write
15+
16+
steps:
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 11
22+
23+
- name: Checkout Data Prepper
24+
uses: actions/checkout@v4
25+
26+
- name: Load secret
27+
uses: 1password/load-secrets-action@v2
28+
with:
29+
# Export loaded secrets as environment variables
30+
export-env: true
31+
env:
32+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
33+
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
34+
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
35+
36+
- name: Publish snapshots to Maven
37+
run: |
38+
./gradlew --no-daemon publishAllPublicationsToSnapshotsRepository

buildSrc/src/main/groovy/data-prepper.publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ afterEvaluate {
1717
}
1818
maven {
1919
name = 'snapshots'
20-
url = 'https://aws.oss.sonatype.org/content/repositories/snapshots'
20+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
2121
credentials {
2222
username "$System.env.SONATYPE_USERNAME"
2323
password "$System.env.SONATYPE_PASSWORD"

0 commit comments

Comments
 (0)