File tree Expand file tree Collapse file tree
spring-artifactory-gradle-build
spring-scheduled-milestone-for-branch Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454 with :
5555 java-version : 24
5656
57+ - name : Compute Version
58+ id : compute-version
59+ uses : spring-io/spring-release-actions/compute-version@0.0.3
60+
5761 - name : Set Release Version
5862 if : inputs.releaseVersion
5963 shell : bash
8589 branchVersion=${{ github.ref_name }}
8690
8791 if [ $branchVersion = 'main' ]; then
88- snapshotVersion=$(cat gradle.properties | sed -n '/^ version=/ { s/^ version=//;p }')
92+ snapshotVersion=${{ steps.compute- version.outputs. version }}
8993 branchVersion=${snapshotVersion%.*}.x
9094 fi
9195
Original file line number Diff line number Diff line change 99 value : ${{ steps.find-milestone.outputs.milestone }}
1010 currentVersion :
1111 description : ' The version for Milestone to find'
12- value : ${{ steps.find-milestone .outputs.currentVersion }}
12+ value : ${{ steps.compute-version .outputs.version }}
1313
1414runs :
1515 using : composite
@@ -20,19 +20,16 @@ runs:
2020 distribution : temurin
2121 java-version : 25
2222
23+ - name : Compute Version
24+ id : compute-version
25+ uses : spring-io/spring-release-actions/compute-version@0.0.3
26+
2327 - name : Find Scheduled Milestone for Current Version in Branch
2428 id : find-milestone
2529 shell : bash
2630 run : |
27- if test -f pom.xml
28- then
29- CURRENT_VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout)
30- else
31- CURRENT_VERSION=$(cat gradle.properties | sed -n '/^version=/ { s/^version=//;p }')
32- fi
33-
34- echo currentVersion=$CURRENT_VERSION >> $GITHUB_OUTPUT
35-
31+ CURRENT_VERSION=${{ steps.compute-version.outputs.version }}
32+
3633 export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT}
3734 MILESTONE=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.due_on != null and (.title | startswith(env.CANDIDATE_VERSION)))) | .[0] | .title')
3835
4138 echo "::warning title=No scheduled milestone::No scheduled milestone for $CURRENT_VERSION version"
4239 else
4340 echo milestone=$MILESTONE >> $GITHUB_OUTPUT
44- fi
41+ fi
Original file line number Diff line number Diff line change @@ -76,13 +76,17 @@ jobs:
7676 java-version : 24
7777 cache : maven
7878
79+ - name : Compute Version
80+ id : compute-version
81+ uses : spring-io/spring-release-actions/compute-version@0.0.3
82+
7983 - name : Evaluate Build Name
8084 id : build-name
8185 run : |
8286 branchVersion=${{ github.ref_name }}
8387
8488 if [ $branchVersion = 'main' ]; then
85- snapshotVersion=$(mvn help:evaluate -Dexpression="project. version" -q -DforceStdout)
89+ snapshotVersion=${{ steps.compute-version.outputs. version }}
8690 branchVersion=${snapshotVersion%.*}.x
8791 fi
8892
Original file line number Diff line number Diff line change 5959 java-version : 24
6060 cache : maven
6161
62+ - name : Compute Version
63+ id : compute-version
64+ uses : spring-io/spring-release-actions/compute-version@0.0.3
65+
6266 - name : Build and Deploy
6367 run : ./mvnw -B -ntp -DaltDeploymentRepository=local::file:deployment-repository ${{ inputs.mavenArgs }} deploy
6468
7074 branchVersion=${{ github.ref_name }}
7175
7276 if [ $branchVersion = 'main' ]; then
73- snapshotVersion=$(mvn help:evaluate -Dexpression="project. version" -q -DforceStdout)
77+ snapshotVersion=${{ steps.compute-version.outputs. version }}
7478 branchVersion=${snapshotVersion%.*}.x
7579 fi
7680
Original file line number Diff line number Diff line change 3434 distribution : temurin
3535 java-version : 24
3636
37+ - name : Compute Next Snapshot
38+ id : next-snapshot
39+ uses : spring-io/spring-release-actions/compute-next-snapshot@0.0.3
40+ with :
41+ version : ${{ inputs.milestone }}
42+
3743 - name : Tag Release and Next Development Version
3844 id : tag-release
3945 run : |
5258 git commit -a -m "[CI/CD] Release version ${{ inputs.milestone }}"
5359 git tag "v${{ inputs.milestone }}"
5460
55- NEXT_VERSION="${{ inputs.milestone }}"
56-
57- if [[ "$NEXT_VERSION" == *"-"* ]]
58- then
59- NEXT_VERSION=${NEXT_VERSION/-*}
60- else
61- MAJOR_MINOR=$(echo "$NEXT_VERSION" | cut -d '.' -f1-2)
62- PATCH=$(echo "$NEXT_VERSION" | cut -d '.' -f3)
63- PATCH=$((PATCH+1))
64- NEXT_VERSION=$MAJOR_MINOR.$PATCH
65- fi
66-
67- NEXT_VERSION=${NEXT_VERSION}-SNAPSHOT
61+ NEXT_VERSION="${{ steps.next-snapshot.outputs.version }}"
6862
6963 if test -f pom.xml
7064 then
You can’t perform that action at this time.
0 commit comments