Publish SNAPSHOT artifacts to Maven snapshot repository. #201
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish SNAPSHOT artifacts to Maven snapshot repository. | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 5 * * Mon-Fri' | |
| jobs: | |
| build-and-publish-snapshots: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: temurin | |
| java-version: 11 | |
| - name: Checkout Data Prepper | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0 | |
| with: | |
| add-job-summary: on-failure | |
| - name: Load secret | |
| uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2 | |
| with: | |
| # Export loaded secrets as environment variables | |
| export-env: true | |
| env: | |
| OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
| MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo | |
| MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5 | |
| with: | |
| role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }} | |
| aws-region: us-east-1 | |
| - name: Publish snapshots to Maven | |
| run: | | |
| ./gradlew --no-daemon publishAllPublicationsToSnapshotsRepository |