release.yml 2.1 KB

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