88 - 1.*
99 - 2.*
1010
11+ env :
12+ SNAPSHOT_REPO_URL : https://aws.oss.sonatype.org/content/repositories/snapshots/
13+
1114jobs :
1215 build-and-publish-snapshots :
1316 strategy :
@@ -30,33 +33,11 @@ jobs:
3033 role-to-assume : ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
3134 aws-region : us-east-1
3235
33- # Create the initial direct-query directory structure
34- - name : Create direct-query directory structure in repository
36+ - name : get credentials
3537 run : |
3638 # Get credentials for publishing
37- export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
38- export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
39- echo "::add-mask::$SONATYPE_USERNAME"
40- echo "::add-mask::$SONATYPE_PASSWORD"
41-
42- # Create a placeholder file
43- TEMP_DIR=$(mktemp -d)
44- echo "Directory placeholder - $(date)" > "${TEMP_DIR}/.placeholder"
45-
46- # Upload the placeholder file to create the directory structure
47- echo "Creating initial directory structure..."
48- curl -X PUT -u "${SONATYPE_USERNAME}:${SONATYPE_PASSWORD}" \
49- --upload-file "${TEMP_DIR}/.placeholder" \
50- "https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/direct-query/.placeholder"
51-
52- # Clean up
53- rm -rf "${TEMP_DIR}"
54- echo "Directory structure created"
39+ .github/get-sonatype-credentials.sh
5540
5641 - name : publish snapshots to maven
5742 run : |
58- export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
59- export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
60- echo "::add-mask::$SONATYPE_USERNAME"
61- echo "::add-mask::$SONATYPE_PASSWORD"
62- ./gradlew publishPluginZipPublicationToSnapshotsRepository
43+ ./gradlew publishPluginZipPublicationToSnapshotsRepository
0 commit comments