diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f319fac..20f11f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,8 +7,7 @@ run-name: Release current version for branch ${{ github.ref_name }} jobs: release: - uses: spring-projects/spring-integration-aws/.github/workflows/spring-release-for-branch.yml@main + uses: spring-projects/spring-integration-aws/.github/workflows/spring-artifactory-release.yml@main with: 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 4636ddb..b434e48 100644 --- a/.github/workflows/spring-artifactory-gradle-release-staging.yml +++ b/.github/workflows/spring-artifactory-gradle-release-staging.yml @@ -70,8 +70,6 @@ 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 ec18712..9a60771 100644 --- a/.github/workflows/spring-artifactory-maven-release-staging.yml +++ b/.github/workflows/spring-artifactory-maven-release-staging.yml @@ -61,8 +61,6 @@ 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 0a74cec..5b2ab01 100644 --- a/.github/workflows/spring-artifactory-release.yml +++ b/.github/workflows/spring-artifactory-release.yml @@ -11,24 +11,50 @@ on: 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') + if [ -z $RELEASE_VERSION ]; then + echo "::error::No scheduled milestone for $CURRENT_VERSION version." + exit 1 + fi + echo releaseVersion=$RELEASE_VERSION >> $GITHUB_OUTPUT + echo "::notice::RELEASE VERSION=$RELEASE_VERSION" + staging: + needs: releaseVersion uses: spring-projects/spring-integration-aws/.github/workflows/spring-stage-release.yml@main with: - releaseVersion: ${{ inputs.releaseVersion }} + releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }} buildToolArgs: ${{ inputs.buildToolArgs }} secrets: inherit verify-staged: - needs: staging + needs: [releaseVersion, staging] uses: ./.github/workflows/verify-staged-artifacts.yml with: - releaseVersion: ${{ inputs.releaseVersion }} + releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }} secrets: inherit promote-milestone: @@ -51,9 +77,8 @@ jobs: finalize: if: ${{ !(failure() || cancelled()) }} - needs: [promote-milestone, promote-ga] + needs: [releaseVersion, promote-milestone, promote-ga] uses: spring-projects/spring-integration-aws/.github/workflows/spring-finalize-release.yml@main with: - milestone: ${{ inputs.releaseVersion }} - repositoryTeam: ${{ inputs.repositoryTeam }} + milestone: ${{ needs.releaseVersion.outputs.releaseVersion }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/spring-finalize-release.yml b/.github/workflows/spring-finalize-release.yml index 955661e..9722915 100644 --- a/.github/workflows/spring-finalize-release.yml +++ b/.github/workflows/spring-finalize-release.yml @@ -7,10 +7,6 @@ on: description: 'Milestone title, e.g 3.0.0-M1, 3.1.0-RC1, 3.2.0 etc.' required: true type: string - repositoryTeam: - description: 'Comma-separate GitHub user names for repository team members to exclude from contributors' - required: false - type: string env: MILESTONE: ${{ inputs.milestone }} @@ -27,13 +23,16 @@ jobs: - name: Generate Changelog run: | + repositoryTeam=$(gh api repos/$GITHUB_REPOSITORY/collaborators --jq 'map(select(.role_name == "admin") | .login) | tostring') + repositoryTeam=$(sed 's/"//g' <<< ${repositoryTeam:1:-1}) + wget -q https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.8/github-changelog-generator.jar java -jar github-changelog-generator.jar $MILESTONE changelog.md \ --changelog.repository=$GITHUB_REPOSITORY \ --github.username=spring-builds \ --github.password=$GITHUB_TOKEN \ - --changelog.contributors.exclude.names=${{ inputs.repositoryTeam }} + --changelog.contributors.exclude.names=$repositoryTeam - name: GitHub Release run: gh release create v${{ env.MILESTONE }} -F changelog.md ${{ (contains(env.MILESTONE, '-M') || contains(env.MILESTONE, '-RC')) && '--prerelease' }} @@ -45,13 +44,13 @@ jobs: gh api -X PATCH repos/$GITHUB_REPOSITORY/milestones/$MILESTONE_ID -f state='closed' --silent fi - - name: Announce Release on Slack - uses: slackapi/slack-github-action@v1.24.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - with: - payload: | - { - "text": "${{ github.event.repository.name }}-announcing `${{ env.MILESTONE }}`" - } \ No newline at end of file +# - name: Announce Release on Slack +# uses: slackapi/slack-github-action@v1.24.0 +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }} +# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK +# with: +# payload: | +# { +# "text": "${{ github.event.repository.name }}-announcing `${{ env.MILESTONE }}`" +# } \ No newline at end of file diff --git a/.github/workflows/spring-release-for-branch.yml b/.github/workflows/spring-release-for-branch.yml deleted file mode 100644 index ba35939..0000000 --- a/.github/workflows/spring-release-for-branch.yml +++ /dev/null @@ -1,48 +0,0 @@ -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 diff --git a/.github/workflows/spring-stage-release.yml b/.github/workflows/spring-stage-release.yml index b4703a2..018f289 100644 --- a/.github/workflows/spring-stage-release.yml +++ b/.github/workflows/spring-stage-release.yml @@ -75,9 +75,13 @@ jobs: run: | if [ ${{ needs.staging-with-gradle.outputs.buildName }} ] then - echo buildName=${{ needs.staging-with-gradle.outputs.buildName }} >> $GITHUB_OUTPUT - echo buildNumber=${{ needs.staging-with-gradle.outputs.buildNumber }} >> $GITHUB_OUTPUT + buildName=${{ needs.staging-with-gradle.outputs.buildName }} + buildNumber=${{ needs.staging-with-gradle.outputs.buildNumber }} else - echo buildName=${{ needs.staging-with-maven.outputs.buildName }} >> $GITHUB_OUTPUT - echo buildNumber=${{ needs.staging-with-maven.outputs.buildNumber }} >> $GITHUB_OUTPUT - fi \ No newline at end of file + buildName=${{ needs.staging-with-maven.outputs.buildName }} + buildNumber=${{ needs.staging-with-maven.outputs.buildNumber }} + fi + echo buildName=$buildName >> $GITHUB_OUTPUT + echo buildNumber=$buildNumber >> $GITHUB_OUTPUT + echo "::notice::Artifactory Build Name=$buildName" + echo "::notice::Artifactory Build Number=$buildNumber" \ No newline at end of file