|
| 1 | +name: "001: CI" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: # Manual trigger |
| 5 | + |
| 6 | +env: |
| 7 | + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v5 |
| 15 | + - uses: jzheaux/spring-io-actions/run-gradle@main |
| 16 | + with: |
| 17 | + java-version: 17 |
| 18 | + distribution: temurin |
| 19 | + gradle-args: 'build publishAllPublicationsToLocalRepository --continue' |
| 20 | + - name: Upload build artifacts |
| 21 | + uses: actions/upload-artifact@v4 |
| 22 | + with: |
| 23 | + name: build-output |
| 24 | + path: | |
| 25 | + build/publications/repos |
| 26 | + test: |
| 27 | + name: Test Against Snapshots |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v5 |
| 31 | + - uses: jzheaux/spring-io-actions/run-gradle@main |
| 32 | + with: |
| 33 | + java-version: 17 |
| 34 | + distribution: temurin |
| 35 | + gradle-args: "test --refresh-dependencies -PforceMavenRepositories=snapshot -PisOverrideVersionCatalog -PtestToolchain=17 -PspringFrameworkVersion=7.+ -PspringDataVersion=2025.0.+ --stacktrace" |
| 36 | + deploy: |
| 37 | + name: Plan Deployment |
| 38 | + runs-on: ubuntu-latest |
| 39 | + needs: [ build, test ] |
| 40 | + outputs: |
| 41 | + branch-name: ${{ steps.branch-name.outputs.branch }} |
| 42 | + version: ${{ steps.compute-version.outputs.version }} |
| 43 | + repository: ${{ steps.compute-artifact-repository.outputs.repository }} |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v5 |
| 46 | + - id: compute-version |
| 47 | + name: Compute Version |
| 48 | + uses: jzheaux/spring-io-actions/compute-version@main |
| 49 | + - id: branch-name |
| 50 | + name: Extract Branch Name |
| 51 | + env: |
| 52 | + BRANCH: ${{ github.ref_name }} |
| 53 | + VERSION: ${{ steps.compute-version.outputs.version }} |
| 54 | + run: | |
| 55 | + branch=$BRANCH |
| 56 | + if [[ "$branch" = "main" ]] ; then |
| 57 | + branch="${VERSION%.*}.x" |
| 58 | + fi |
| 59 | + echo "branch=$branch" >> $GITHUB_OUTPUT |
| 60 | + - id: compute-artifact-repository |
| 61 | + name: Compute Artifact Repository |
| 62 | + uses: jzheaux/spring-io-actions/compute-artifact-repository@main |
| 63 | + with: |
| 64 | + version: ${{ steps.compute-version.outputs.version }} |
| 65 | + - name: Download build artifacts |
| 66 | + uses: actions/download-artifact@v4 |
| 67 | + with: |
| 68 | + name: build-output |
| 69 | + path: local-repository |
| 70 | + - if: ${{ needs.plan-deploy.outputs.repository != 'central' }} |
| 71 | + uses: spring-io/artifactory-deploy-action@8226ab8d9f94ac2dbef2c2584526d172dc030b3e |
| 72 | + with: |
| 73 | + uri: 'https://repo.spring.io' |
| 74 | + repository: ${{ steps.compute-artifact-repository.outputs.repository }} |
| 75 | + username: ${{ secrets.ARTIFACTORY_USERNAME }} |
| 76 | + password: ${{ secrets.ARTIFACTORY_PASSWORD }} |
| 77 | + build-name: ${{ github.event.repository.name }}-${{ needs.plan-deploy.outputs.branch }} |
| 78 | + build-number: ${{ github.run_id }} |
| 79 | + build-uri: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 80 | + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 81 | + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 82 | + vcs-revision: ${{ github.sha }} |
| 83 | + folder: local-repository |
| 84 | + - if: ${{ steps.compute-artifact-repository.outputs.repository == 'central' }} |
| 85 | + uses: spring-io/central-publish-action@7f15aea591fe04ea7500dcdd753536f7e59ee601 |
| 86 | + with: |
| 87 | + token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }} |
| 88 | + token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} |
| 89 | + dir: local-repository |
| 90 | + publish: |
| 91 | + name: Publish Release |
| 92 | + needs: deploy |
| 93 | + uses: ./.github/workflows/publish-release.yml |
0 commit comments