From f0e0dadc1b0771664435b90834b1ebbb275b4a15 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Mon, 9 Jan 2023 16:41:43 -0800 Subject: [PATCH 1/3] Add workflow to publish snapshots Signed-off-by: Sayali Gaikawad --- .github/workflows/publish-snapshots.yml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/publish-snapshots.yml diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml new file mode 100644 index 00000000..97ee227c --- /dev/null +++ b/.github/workflows/publish-snapshots.yml @@ -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 publishAllPublicationsToSnapshotsRepository \ No newline at end of file From ae13d9b03f52cf7280ba8570e2631cdedca389f7 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Mon, 9 Jan 2023 16:43:36 -0800 Subject: [PATCH 2/3] Format Signed-off-by: Sayali Gaikawad --- .github/workflows/publish-snapshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml index 97ee227c..1bfbbeb8 100644 --- a/.github/workflows/publish-snapshots.yml +++ b/.github/workflows/publish-snapshots.yml @@ -26,4 +26,4 @@ jobs: 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 publishAllPublicationsToSnapshotsRepository \ No newline at end of file + ./gradlew publishAllPublicationsToSnapshotsRepository From de82ac38f79de46c53b8aa5a02123aa8343cdf3a Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Mon, 9 Jan 2023 17:32:52 -0800 Subject: [PATCH 3/3] Fix gradle task name Signed-off-by: Sayali Gaikawad --- .github/workflows/publish-snapshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml index 1bfbbeb8..40b5fabd 100644 --- a/.github/workflows/publish-snapshots.yml +++ b/.github/workflows/publish-snapshots.yml @@ -26,4 +26,4 @@ jobs: 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 publishAllPublicationsToSnapshotsRepository + ./gradlew publishMavenJavaPublicationToSnapshotsRepository