-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to a single
finalize-release.yml
GHA
- Loading branch information
1 parent
989b140
commit 1766e68
Showing
5 changed files
with
63 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
# 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 }}`" | ||
# } |