diff --git a/.github/changelog-application.yml b/.github/changelog-application.yml deleted file mode 100644 index 7fe894b3..00000000 --- a/.github/changelog-application.yml +++ /dev/null @@ -1,8 +0,0 @@ -changelog: - repository: ${GITHUB_REPOSITORY} -# contributors: -# exclude: -# names: ${REPO_TEAM} -github: - username: spring-builds - password: ${GITHUB_TOKEN} \ No newline at end of file diff --git a/.github/workflows/changelog-for-milestone.yml b/.github/workflows/changelog-for-milestone.yml deleted file mode 100644 index 483df0f7..00000000 --- a/.github/workflows/changelog-for-milestone.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Generate Changelog for Provided Milestone - -on: - workflow_dispatch: - inputs: - milestone: - 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 - workflow_call: - inputs: - milestone: - 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 - -jobs: - generate-changelog: - runs-on: ubuntu-latest - steps: - - - name: Checkout Common Repo - uses: actions/checkout@v4 - with: - repository: spring-projects/spring-integration-aws - show-progress: false - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 17 - - - name: Generate Changelog - run: | - 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 --spring.config.location=.github/changelog-application.yml ${{ inputs.milestone }} changelog.md - env: - GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} - REPO_TEAM: "[ ${{ inputs.repositoryTeam }} ]" - - - name: Print Changelog - run: echo "::notice ::$(cat changelog.md)" \ No newline at end of file diff --git a/.github/workflows/ci-close-milestone.yml b/.github/workflows/ci-close-milestone.yml deleted file mode 100644 index d50b333c..00000000 --- a/.github/workflows/ci-close-milestone.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Close Milestone - -on: - release: - types: [published] - -jobs: - close-milestone: - uses: spring-projects/spring-integration-aws/.github/workflows/close-milestone-on-release.yml@main - with: - releaseTag: ${{ github.ref_name }} - secrets: inherit diff --git a/.github/workflows/close-milestone-on-release.yml b/.github/workflows/close-milestone-on-release.yml deleted file mode 100644 index 70bede49..00000000 --- a/.github/workflows/close-milestone-on-release.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Close Milestone and Notify Slack - -on: - workflow_dispatch: - inputs: - releaseTag: - description: 'The tag of the release for Milestone to close. Usually starts with `v`' - required: true - type: string - workflow_call: - inputs: - releaseTag: - description: 'The tag of the release for Milestone to close. Usually starts with `v`' - required: true - type: string - -jobs: - close-milestone: - - runs-on: ubuntu-latest - - steps: - - - name: Close Milestone - id: milestone-id - run: | - TAG=${{ inputs.releaseTag }} - export MILESTONE_NAME=${TAG#v} - MILESTONE_ID=$(gh api repos/$OWNER/$REPO/milestones --jq '.[] | select(.title == env.MILESTONE_NAME) | .number') - if [ $MILESTONE_ID ]; then - gh api -X PATCH repos/$OWNER/$REPO/milestones/$MILESTONE_ID -f state='closed' --silent - fi - echo version=$MILESTONE_NAME >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - -# - 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 `${{ steps.milestone-id.outputs.version }}`" -# } diff --git a/.github/workflows/finalize-release.yml b/.github/workflows/finalize-release.yml new file mode 100644 index 00000000..e6fc0846 --- /dev/null +++ b/.github/workflows/finalize-release.yml @@ -0,0 +1,63 @@ +name: Create GH release and Notify Slack + +on: + workflow_dispatch: + inputs: + milestone: + 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 + workflow_call: + inputs: + milestone: + 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 }} + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + +jobs: + finalize-releae: + runs-on: ubuntu-latest + steps: + + - name: Generate Changelog + run: | + 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=${{ secrets.GH_ACTIONS_REPO_TOKEN }} \ + --changelog.contributors.exclude.names=${{ inputs.repositoryTeam }} + + - name: GitHub Release + run: gh release create v$MILESTONE -F changelog.md + + - name: Close Milestone + run: | + MILESTONE_ID=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq '.[] | select(.title == env.$MILESTONE) | .number') + if [ $MILESTONE_ID ]; then + 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