-
Notifications
You must be signed in to change notification settings - Fork 6
Use compute-version and compute-next-snapshot #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
298acb4
ba3d43b
88bdd67
e25e9e4
de031f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ outputs: | |
| value: ${{ steps.find-milestone.outputs.milestone }} | ||
| currentVersion: | ||
| description: 'The version for Milestone to find' | ||
| value: ${{ steps.find-milestone.outputs.currentVersion }} | ||
| value: ${{ steps.compute-version.outputs.version }} | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
@@ -20,19 +20,16 @@ runs: | |
| distribution: temurin | ||
| java-version: 25 | ||
|
|
||
| - name: Compute Version | ||
| id: compute-version | ||
| uses: spring-io/spring-release-actions/compute-version@0.0.3 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not related to your contribution, but I think it is important to say in the docs for this action that |
||
|
|
||
| - name: Find Scheduled Milestone for Current Version in Branch | ||
| id: find-milestone | ||
| shell: bash | ||
| run: | | ||
| if test -f pom.xml | ||
| then | ||
| CURRENT_VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) | ||
| else | ||
| CURRENT_VERSION=$(cat gradle.properties | sed -n '/^version=/ { s/^version=//;p }') | ||
| fi | ||
|
|
||
| echo currentVersion=$CURRENT_VERSION >> $GITHUB_OUTPUT | ||
|
|
||
| CURRENT_VERSION=${{ steps.compute-version.outputs.version }} | ||
|
|
||
| export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT} | ||
| MILESTONE=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.due_on != null and (.title | startswith(env.CANDIDATE_VERSION)))) | .[0] | .title') | ||
|
|
||
|
|
@@ -41,4 +38,4 @@ runs: | |
| echo "::warning title=No scheduled milestone::No scheduled milestone for $CURRENT_VERSION version" | ||
| else | ||
| echo milestone=$MILESTONE >> $GITHUB_OUTPUT | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,10 @@ jobs: | |
| java-version: 24 | ||
| cache: maven | ||
|
|
||
| - name: Compute Version | ||
| id: compute-version | ||
| uses: spring-io/spring-release-actions/compute-version@0.0.3 | ||
|
|
||
| - name: Build and Deploy | ||
| run: ./mvnw -B -ntp -DaltDeploymentRepository=local::file:deployment-repository ${{ inputs.mavenArgs }} deploy | ||
|
|
||
|
|
@@ -70,7 +74,7 @@ jobs: | |
| branchVersion=${{ github.ref_name }} | ||
|
|
||
| if [ $branchVersion = 'main' ]; then | ||
| snapshotVersion=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) | ||
| snapshotVersion=${{ steps.compute-version.outputs.version }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well. One more time. But that is different story.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was thinking the same thing. I've added spring-io/spring-release-actions#99 to take a look |
||
| branchVersion=${snapshotVersion%.*}.x | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pay attention how this is optional only if our branch is
main.I don't think extra step in this composite action would bring any value instead of this single line bash script.