Skip to content

Commit

Permalink
Add workflow to publish snapshots (opensearch-project#312)
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya authored and kokibas committed Mar 17, 2023
1 parent fb55f8a commit 9211db5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish snapshots to maven

on:
schedule:
- cron: 0 */12 * * *

jobs:
build-and-publish-snapshots:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1
- name: publish snapshots to maven
run: |
echo "SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)" >> $GITHUB_ENV
echo "SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)" >> $GITHUB_ENV
./gradlew publishMavenJavaPublicationToSnapshotsRepository

0 comments on commit 9211db5

Please sign in to comment.