release.yml 2.0 KB

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