release.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - v2.3.*
  6. - v2.4.*
  7. - v3.0.*
  8. env:
  9. # https://github.com/actions/checkout/issues/440#issuecomment-854240996
  10. AWS_EC2_METADATA_DISABLED: true
  11. permissions:
  12. contents: read
  13. jobs:
  14. build:
  15. name: "Release"
  16. strategy:
  17. matrix:
  18. version: [ 17.0.1-tem ]
  19. runs-on: ubuntu-22.04
  20. steps:
  21. - uses: actions/checkout@v2
  22. - name: Cache local Maven repository
  23. uses: actions/cache@v2
  24. with:
  25. path: ~/.m2/repository
  26. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  27. restore-keys: ${{ runner.os }}-maven-
  28. - name: Download ${{ matrix.version }}
  29. uses: sdkman/sdkman-action@master
  30. id: sdkman
  31. with:
  32. candidate: java
  33. version: ${{ matrix.version }}
  34. - name: Set up ${{ matrix.version }}
  35. uses: actions/setup-java@v1
  36. with:
  37. java-version: 8
  38. jdkFile: ${{ steps.sdkman.outputs.file }}
  39. server-id: ossrh-awspring
  40. server-username: OSSRH_USERNAME
  41. server-password: OSSRH_PASSWORD
  42. gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
  43. gpg-passphrase: MAVEN_GPG_PASSPHRASE
  44. - name: Run tests
  45. run: ./mvnw -V verify javadoc:aggregate -Pspring,docs
  46. - name: Deploy to Sonatype
  47. run: ./mvnw -V -Prelease,spring deploy -DskipTests
  48. env:
  49. OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
  50. OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
  51. MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
  52. - name: Upload to S3
  53. env:
  54. AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY }}
  55. AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_KEY }}
  56. run: |
  57. aws s3 sync --acl public-read docs/target/generated-docs/ s3://awspring-docs/spring-cloud-aws/docs/
  58. aws s3 sync --acl public-read target/site/ s3://awspring-docs/spring-cloud-aws/docs/
  59. aws cloudfront create-invalidation --distribution-id EA7LER7CI960A --paths "/*"