continuous-integration-workflow.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. check-tangles:
  64. name: Check for Package Tangles
  65. runs-on: ubuntu-latest
  66. if: ${{ github.repository_owner == 'spring-projects' }}
  67. steps:
  68. - uses: actions/checkout@v4
  69. - name: Set up gradle
  70. uses: spring-io/spring-gradle-build-action@v2
  71. with:
  72. java-version: 17
  73. distribution: temurin
  74. - name: Check for package tangles
  75. env:
  76. STRUCTURE101_LICENSEID: ${{ secrets.STRUCTURE101_LICENSEID }}
  77. run: |
  78. ./gradlew assemble && ./gradlew s101 -Ps101.licenseId="$STRUCTURE101_LICENSEID" --stacktrace
  79. deploy-artifacts:
  80. name: Deploy Artifacts
  81. needs: [ build, test, check-samples, check-tangles ]
  82. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-artifacts.yml@v1
  83. with:
  84. should-deploy-artifacts: ${{ needs.build.outputs.should-deploy-artifacts }}
  85. secrets: inherit
  86. deploy-docs:
  87. name: Deploy Docs
  88. needs: [ build, test, check-samples, check-tangles ]
  89. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-docs.yml@v1
  90. with:
  91. should-deploy-docs: ${{ needs.build.outputs.should-deploy-artifacts }}
  92. secrets: inherit
  93. deploy-schema:
  94. name: Deploy Schema
  95. needs: [ build, test, check-samples, check-tangles ]
  96. uses: spring-io/spring-security-release-tools/.github/workflows/deploy-schema.yml@v1
  97. with:
  98. should-deploy-schema: ${{ needs.build.outputs.should-deploy-artifacts }}
  99. secrets: inherit
  100. perform-release:
  101. name: Perform Release
  102. needs: [ deploy-artifacts, deploy-docs, deploy-schema ]
  103. uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@v1
  104. with:
  105. should-perform-release: ${{ needs.deploy-artifacts.outputs.artifacts-deployed }}
  106. project-version: ${{ needs.deploy-artifacts.outputs.project-version }}
  107. milestone-repo-url: https://repo.spring.io/artifactory/milestone
  108. release-repo-url: https://repo1.maven.org/maven2
  109. artifact-path: org/springframework/security/spring-security-core
  110. slack-announcing-id: spring-security-announcing
  111. secrets: inherit
  112. send-notification:
  113. name: Send Notification
  114. needs: [ perform-release ]
  115. if: ${{ !success() }}
  116. runs-on: ubuntu-latest
  117. steps:
  118. - name: Send Notification
  119. uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
  120. with:
  121. webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}