|
| 1 | +name: Sync to Maven Central |
| 2 | +description: Syncs a release to Maven Central and waits for it to be available for use |
| 3 | +inputs: |
| 4 | + jfrog-cli-config-token: |
| 5 | + description: 'Config token for the JFrog CLI' |
| 6 | + required: true |
| 7 | + spring-boot-version: |
| 8 | + description: 'The version of Spring Boot that is being synced to Central' |
| 9 | + required: true |
| 10 | + ossrh-s01-token-username: |
| 11 | + description: 'Username for authentication with s01.oss.sonatype.org' |
| 12 | + required: true |
| 13 | + ossrh-s01-token-password: |
| 14 | + description: 'Password for authentication with s01.oss.sonatype.org' |
| 15 | + required: true |
| 16 | + ossrh-s01-staging-profile: |
| 17 | + description: 'Staging profile to use when syncing to Central' |
| 18 | + required: true |
| 19 | +runs: |
| 20 | + using: composite |
| 21 | + steps: |
| 22 | + - name: Set Up JFrog CLI |
| 23 | + uses: jfrog/setup-jfrog-cli@d82fe26823e1f25529250895d5673f65b02af085 # v4.0.1 |
| 24 | + env: |
| 25 | + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} |
| 26 | + - name: Download Release Artifacts |
| 27 | + shell: bash |
| 28 | + run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-boot-{0}', inputs.spring-boot-version) }};buildNumber=${{ github.run_number }}' |
| 29 | + - name: Sync |
| 30 | + uses: spring-io/nexus-sync-action@42477a2230a2f694f9eaa4643fa9e76b99b7ab84 # v0.0.1 |
| 31 | + with: |
| 32 | + username: ${{ inputs.ossrh-s01-token-username }} |
| 33 | + password: ${{ inputs.ossrh-s01-token-password }} |
| 34 | + staging-profile-name: ${{ secrets.ossrh-s01-staging-profile }} |
| 35 | + create: true |
| 36 | + upload: true |
| 37 | + close: true |
| 38 | + release: true |
| 39 | + generate-checksums: true |
| 40 | + - name: Await |
| 41 | + shell: bash |
| 42 | + run: | |
| 43 | + url=${{ format('https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot/{0}/spring-boot-{0}.jar', inputs.spring-boot-version) }} |
| 44 | + echo "Waiting for $url" |
| 45 | + until curl --fail --head --silent $url > /dev/null |
| 46 | + do |
| 47 | + echo "." |
| 48 | + sleep 60 |
| 49 | + done |
| 50 | + echo "$url is available" |
0 commit comments