release.yml 1.9 KB

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