continuous-integration-workflow.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. name: CI
  2. on:
  3. push:
  4. branches-ignore:
  5. - "dependabot/**"
  6. schedule:
  7. - cron: '0 10 * * *' # Once per day at 10am UTC
  8. workflow_dispatch: # Manual trigger
  9. env:
  10. DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
  11. permissions:
  12. contents: read
  13. jobs:
  14. build:
  15. name: Build
  16. uses: spring-io/spring-security-release-tools/.github/workflows/build.yml@v1
  17. strategy:
  18. matrix:
  19. os: [ ubuntu-latest, windows-latest ]
  20. jdk: [ 17 ]
  21. with:
  22. runs-on: ${{ matrix.os }}
  23. java-version: ${{ matrix.jdk }}
  24. distribution: temurin
  25. secrets: inherit
  26. test:
  27. name: Test Against Snapshots
  28. uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@v1
  29. strategy:
  30. matrix:
  31. include:
  32. - java-version: 21-ea
  33. toolchain: 21
  34. - java-version: 17
  35. toolchain: 17
  36. with:
  37. java-version: ${{ matrix.java-version }}
  38. test-args: --refresh-dependencies -PforceMavenRepositories=snapshot -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion=6.2.+ -PreactorVersion=2023.0.+ -PspringDataVersion=2024.0.+ --stacktrace
  39. secrets: inherit
  40. check-samples:
  41. name: Check Samples
  42. runs-on: ubuntu-latest
  43. if: ${{ github.repository_owner == 'spring-projects' }}
  44. steps:
  45. - uses: actions/checkout@v4
  46. - name: Set up gradle
  47. uses: spring-io/spring-gradle-build-action@v2
  48. with:
  49. java-version: 17
  50. distribution: temurin
  51. - name: Check samples project
  52. env:
  53. LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
  54. SAMPLES_DIR: ../spring-security-samples
  55. run: |
  56. # Extract version from gradle.properties
  57. version=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}')
  58. # Extract samplesBranch from gradle.properties
  59. samples_branch=$(cat gradle.properties | grep "samplesBranch=" | awk -F'=' '{print $2}')
  60. ./gradlew publishMavenJavaPublicationToLocalRepository
  61. ./gradlew cloneRepository -PrepositoryName="spring-projects/spring-security-samples" -Pref="$samples_branch" -PcloneOutputDirectory="$SAMPLES_DIR"
  62. ./gradlew --refresh-dependencies --project-dir "$SAMPLES_DIR" --init-script spring-security-ci.gradle -PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" -PspringSecurityVersion="$version" test integrationTest
  63. deploy-artifacts:
  64. name: Deploy Artifacts
  65. needs: [ build, test, check-samples ]
  66. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-artifacts.yml@v1
  67. with:
  68. should-deploy-artifacts: ${{ needs.build.outputs.should-deploy-artifacts }}
  69. secrets: inherit
  70. deploy-docs:
  71. name: Deploy Docs
  72. needs: [ build, test, check-samples ]
  73. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-docs.yml@v1
  74. with:
  75. should-deploy-docs: ${{ needs.build.outputs.should-deploy-artifacts }}
  76. secrets: inherit
  77. deploy-schema:
  78. name: Deploy Schema
  79. needs: [ build, test, check-samples ]
  80. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-schema.yml@v1
  81. with:
  82. should-deploy-schema: ${{ needs.build.outputs.should-deploy-artifacts }}
  83. secrets: inherit
  84. perform-release:
  85. name: Perform Release
  86. needs: [ deploy-artifacts, deploy-docs, deploy-schema ]
  87. uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@v1
  88. with:
  89. should-perform-release: ${{ needs.deploy-artifacts.outputs.artifacts-deployed }}
  90. project-version: ${{ needs.deploy-artifacts.outputs.project-version }}
  91. milestone-repo-url: https://repo.spring.io/artifactory/milestone
  92. release-repo-url: https://repo1.maven.org/maven2
  93. artifact-path: org/springframework/security/spring-security-core
  94. slack-announcing-id: spring-security-announcing
  95. secrets: inherit
  96. send-notification:
  97. name: Send Notification
  98. needs: [ perform-release ]
  99. if: ${{ !success() }}
  100. runs-on: ubuntu-latest
  101. steps:
  102. - name: Send Notification
  103. uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
  104. with:
  105. webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}