Skip to content

Commit ab6ab0a

Browse files
Onboarding async query core and grammar files to maven snapshots (#4598)
* Onboarding async query core and grammar files to maven snapshots Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Update envvar SNAPSHOT_REPO_URL Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 279eb67 commit ab6ab0a

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
- '[0-9]+.[0-9]+'
99
- '[0-9]+.x'
1010

11-
env:
12-
SNAPSHOT_REPO_URL: https://ci.opensearch.org/ci/dbc/snapshots/maven/
13-
1411
jobs:
1512
build-and-publish-snapshots:
1613
strategy:

.github/workflows/publish-async-query-core.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
push:
66
branches:
77
- main
8-
- 1.*
9-
- 2.*
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.x'
1010
paths:
1111
- 'async-query-core/**'
1212
- '.github/workflows/publish-async-query-core.yml'
@@ -18,7 +18,6 @@ concurrency:
1818
cancel-in-progress: false
1919

2020
env:
21-
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/
2221
COMMIT_MAP_FILENAME: commit-history-async-query-core.json
2322

2423
jobs:
@@ -47,8 +46,19 @@ jobs:
4746
export-env: true
4847
env:
4948
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
50-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
51-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
49+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
50+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
51+
52+
- name: Export SNAPSHOT_REPO_URL
53+
run: |
54+
snapshot_repo_url=${{ env.MAVEN_SNAPSHOTS_S3_REPO }}
55+
echo "SNAPSHOT_REPO_URL=$snapshot_repo_url" >> $GITHUB_ENV
56+
57+
- name: Configure AWS credentials
58+
uses: aws-actions/configure-aws-credentials@v5
59+
with:
60+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
61+
aws-region: us-east-1
5262

5363
- name: Set commit ID
5464
id: set_commit
@@ -83,4 +93,4 @@ jobs:
8393
source ./.github/maven-publish-utils.sh
8494
8595
# Call the main function for async-query-core
86-
publish_async_query_core "${{ steps.extract_version.outputs.VERSION }}" "${{ steps.set_commit.outputs.commit_id }}"
96+
publish_async_query_core "${{ steps.extract_version.outputs.VERSION }}" "${{ steps.set_commit.outputs.commit_id }}"

.github/workflows/publish-grammar-files.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
push:
66
branches:
77
- main
8-
- 1.*
9-
- 2.*
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.x'
1010
paths:
1111
- 'language-grammar/src/main/antlr4/**'
1212
- 'language-grammar/build.gradle'
@@ -19,7 +19,6 @@ concurrency:
1919
cancel-in-progress: false
2020

2121
env:
22-
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/
2322
COMMIT_MAP_FILENAME: commit-history-language-grammar.json
2423

2524
jobs:
@@ -51,8 +50,19 @@ jobs:
5150
export-env: true
5251
env:
5352
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
54-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
55-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
53+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
54+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
55+
56+
- name: Export SNAPSHOT_REPO_URL
57+
run: |
58+
snapshot_repo_url=${{ env.MAVEN_SNAPSHOTS_S3_REPO }}
59+
echo "SNAPSHOT_REPO_URL=$snapshot_repo_url" >> $GITHUB_ENV
60+
61+
- name: Configure AWS credentials
62+
uses: aws-actions/configure-aws-credentials@v5
63+
with:
64+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
65+
aws-region: us-east-1
5666

5767
- name: Set version
5868
id: set_version

0 commit comments

Comments
 (0)