Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/spring-artifactory-gradle-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ runs:
with:
java-version: 24

- name: Compute Version
id: compute-version
uses: spring-io/spring-release-actions/compute-version@0.0.3

- name: Set Release Version
if: inputs.releaseVersion
shell: bash
Expand Down Expand Up @@ -85,7 +89,7 @@ runs:
branchVersion=${{ github.ref_name }}

if [ $branchVersion = 'main' ]; then
snapshotVersion=$(cat gradle.properties | sed -n '/^version=/ { s/^version=//;p }')
snapshotVersion=${{ steps.compute-version.outputs.version }}
Copy link
Copy Markdown
Contributor

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.

branchVersion=${snapshotVersion%.*}.x
fi

Expand Down
19 changes: 8 additions & 11 deletions .github/actions/spring-scheduled-milestone-for-branch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 actions/setup-java is required in case if Maven.
Because this action calls Maven: mvn help:evaluate


- 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')

Expand All @@ -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
Expand Up @@ -76,13 +76,17 @@ jobs:
java-version: 24
cache: maven

- name: Compute Version
id: compute-version
uses: spring-io/spring-release-actions/compute-version@0.0.3

- name: Evaluate Build Name
id: build-name
run: |
branchVersion=${{ github.ref_name }}

if [ $branchVersion = 'main' ]; then
snapshotVersion=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout)
snapshotVersion=${{ steps.compute-version.outputs.version }}
branchVersion=${snapshotVersion%.*}.x
fi

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/spring-artifactory-maven-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. One more time.
I think I'll take your change as is: looks like this Evaluate Build Name step deserves its one GH Action.
It is really used in in similar way in many places: for Gradle, Maven, in release and SNAPSHOT builds.

But that is different story.
Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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

Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/spring-finalize-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ jobs:
distribution: temurin
java-version: 24

- name: Compute Next Snapshot
id: next-snapshot
uses: spring-io/spring-release-actions/compute-next-snapshot@0.0.3
with:
version: ${{ inputs.milestone }}

- name: Tag Release and Next Development Version
id: tag-release
run: |
Expand All @@ -52,19 +58,7 @@ jobs:
git commit -a -m "[CI/CD] Release version ${{ inputs.milestone }}"
git tag "v${{ inputs.milestone }}"

NEXT_VERSION="${{ inputs.milestone }}"

if [[ "$NEXT_VERSION" == *"-"* ]]
then
NEXT_VERSION=${NEXT_VERSION/-*}
else
MAJOR_MINOR=$(echo "$NEXT_VERSION" | cut -d '.' -f1-2)
PATCH=$(echo "$NEXT_VERSION" | cut -d '.' -f3)
PATCH=$((PATCH+1))
NEXT_VERSION=$MAJOR_MINOR.$PATCH
fi

NEXT_VERSION=${NEXT_VERSION}-SNAPSHOT
NEXT_VERSION="${{ steps.next-snapshot.outputs.version }}"

if test -f pom.xml
then
Expand Down