diff --git a/.github/workflows/ci-close-milestone.yml b/.github/workflows/ci-close-milestone.yml new file mode 100644 index 0000000..ecb9f54 --- /dev/null +++ b/.github/workflows/ci-close-milestone.yml @@ -0,0 +1,12 @@ +name: Close Milestone and Notify Slack + +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 new file mode 100644 index 0000000..6a16ce4 --- /dev/null +++ b/.github/workflows/close-milestone-on-release.yml @@ -0,0 +1,40 @@ +name: Close Milestone and Notify Slack + +on: + workflow_call: + inputs: + releaseTag: + description: 'The tag of the release for Milestone to close. Usually starts with `v`' + required: true + type: string + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + - id: get-milestone-from-tag + run: echo milestoneName=${${{ inputs.releaseTag }}#v} >> $GITHUB_OUTPUT + + - uses: octokit/request-action@v2.x + id: list_milestones + with: + route: GET /repos/${{ github.repository }}/milestones + env: + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + + - id: get-milestone-id + run: echo milestoneId=${{steps.list_milestones.outputs.data}} | jq '.[] | select(.title == "${{steps.get-milestone-from-tag.outputs.milestoneName}}") | .number' >> $GITHUB_OUTPUT + + - name: Close Milestone + if: ${{steps.get-milestone-id.outputs.milestoneId}} + uses: octokit/request-action@v2.x + with: + route: PATCH /repos/${{ github.repository }}/milestones/${{steps.get-milestone-id.outputs.milestoneId}} + state: "closed" + env: + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + + diff --git a/.github/workflows/spring-artifactory-gradle-release-staging.yml b/.github/workflows/spring-artifactory-gradle-release-staging.yml index c948042..6d2e5a0 100644 --- a/.github/workflows/spring-artifactory-gradle-release-staging.yml +++ b/.github/workflows/spring-artifactory-gradle-release-staging.yml @@ -56,8 +56,7 @@ jobs: echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV - name: Set Release Version - run: | - sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties + run: sed -i "s/version=.*/version=${{ inputs.releaseVersion }}/" gradle.properties - name: Build and Publish run: |