diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c2d0f3..f319fac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,17 +2,13 @@ name: Release on: workflow_dispatch: - inputs: - releaseVersion: - description: 'Release version like 3.0.0-M1, 3.1.0-RC1, 3.2.0 etc.' - required: true - type: string + +run-name: Release current version for branch ${{ github.ref_name }} jobs: release: - uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-release.yml@main + uses: spring-projects/spring-integration-aws/.github/workflows/spring-release-for-branch.yml@main with: - releaseVersion: ${{ inputs.releaseVersion }} buildToolArgs: dist repositoryTeam: artembilan,garyrussell secrets: inherit \ No newline at end of file diff --git a/.github/workflows/spring-artifactory-gradle-release-staging.yml b/.github/workflows/spring-artifactory-gradle-release-staging.yml index b434e48..4636ddb 100644 --- a/.github/workflows/spring-artifactory-gradle-release-staging.yml +++ b/.github/workflows/spring-artifactory-gradle-release-staging.yml @@ -70,6 +70,8 @@ jobs: echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV echo buildName=$buildName >> $GITHUB_OUTPUT echo buildNumber=$JFROG_CLI_BUILD_NUMBER >> $GITHUB_OUTPUT + echo "::notice ::Artifactory Build Name=$JFROG_CLI_BUILD_NAME" + echo "::notice ::Artifactory Build Number=$JFROG_CLI_BUILD_NUMBER" - name: Set Release Version run: sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties diff --git a/.github/workflows/spring-artifactory-maven-release-staging.yml b/.github/workflows/spring-artifactory-maven-release-staging.yml index cf0eb67..ec18712 100644 --- a/.github/workflows/spring-artifactory-maven-release-staging.yml +++ b/.github/workflows/spring-artifactory-maven-release-staging.yml @@ -31,6 +31,7 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + show-progress: false - name: Set up JDK uses: actions/setup-java@v3 @@ -60,6 +61,8 @@ jobs: echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV echo buildName=$buildName >> $GITHUB_OUTPUT echo buildNumber=$JFROG_CLI_BUILD_NUMBER >> $GITHUB_OUTPUT + echo "::notice ::Artifactory Build Name=$JFROG_CLI_BUILD_NAME" + echo "::notice ::Artifactory Build Number=$JFROG_CLI_BUILD_NUMBER" - name: Set Release Version run: | diff --git a/.github/workflows/spring-artifactory-release.yml b/.github/workflows/spring-artifactory-release.yml index d56052f..0a74cec 100644 --- a/.github/workflows/spring-artifactory-release.yml +++ b/.github/workflows/spring-artifactory-release.yml @@ -16,8 +16,6 @@ on: required: false type: string -run-name: Release version ${{ inputs.releaseVersion }} - jobs: staging: uses: spring-projects/spring-integration-aws/.github/workflows/spring-stage-release.yml@main diff --git a/.github/workflows/spring-release-for-branch.yml b/.github/workflows/spring-release-for-branch.yml new file mode 100644 index 0000000..ba35939 --- /dev/null +++ b/.github/workflows/spring-release-for-branch.yml @@ -0,0 +1,48 @@ +name: Perform Release with Artifactory + +on: + workflow_call: + inputs: + buildToolArgs: + description: 'Additional Maven or Gradle command arguments: tasks, goals, plugins etc. The `install` for Maven is included. The `build` and `artifactoryPublish` for Gradle are included.' + required: false + type: string + repositoryTeam: + description: 'Comma-separate GitHub user names for repository team members to exclude from contributors' + required: false + type: string + +jobs: + releaseVersion: + runs-on: ubuntu-latest + outputs: + releaseVersion: ${{ steps.release-version.outputs.releaseVersion }} + + steps: + + - uses: actions/checkout@v4 + with: + show-progress: false + + - name: Find Current Version to Release + id: release-version + run: | + if test -f pom.xml + then + CURRENT_VERSION=$(./mvnw help:evaluate -Dexpression="project.version" -q -DforceStdout) + else + CURRENT_VERSION=$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') + fi + export CANDIDATE_VERSION=${CURRENT_VERSION/-SNAPSHOT} + RELEASE_VERSION=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq 'map(select(.title | startswith(env.CANDIDATE_VERSION))) | .[0] | .title') + echo releaseVersion=$RELEASE_VERSION >> $GITHUB_OUTPUT + echo "::notice ::RELEASE VERSION=$RELEASE_VERSION" + + perform-release: + needs: releaseVersion + uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-release.yml@main + with: + releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }} + buildToolArgs: ${{ inputs.buildToolArgs }} + repositoryTeam: ${{ inputs.repositoryTeam }} + secrets: inherit