|
19 | 19 | # jobs can work on it.
|
20 | 20 | staging:
|
21 | 21 | runs-on: ubuntu-latest
|
| 22 | + outputs: |
| 23 | + project-version: ${{ steps.output.outputs.project-version }} |
22 | 24 | steps:
|
23 | 25 | - uses: actions/checkout@v2
|
24 | 26 | - uses: actions/setup-java@v1
|
|
61 | 63 | tag-release-branch: ${{ env.PROJECT_VERSION }}
|
62 | 64 | tag-release-tag: ${{ env.PROJECT_VERSION }}
|
63 | 65 | tag-release-tag-prefix: v
|
| 66 | + - name: Output |
| 67 | + id: output |
| 68 | + env: |
| 69 | + PROJECT_VERSION: ${{ env.PROJECT_VERSION }} |
| 70 | + run: | |
| 71 | + echo "::set-output name=project-version::$PROJECT_VERSION" |
64 | 72 |
|
65 | 73 | # wait manual approval.
|
66 | 74 | # promote build from staging to milestones
|
@@ -92,3 +100,53 @@ jobs:
|
92 | 100 | - name: Promote Build
|
93 | 101 | run: |
|
94 | 102 | jfrog rt build-promote libs-milestone-local
|
| 103 | +
|
| 104 | + ghrelease: |
| 105 | + runs-on: ubuntu-latest |
| 106 | + needs: [staging, promote] |
| 107 | + steps: |
| 108 | + - uses: actions/checkout@v2 |
| 109 | + - name: Install Tooling |
| 110 | + run: | |
| 111 | + curl -sSL https://github.com/cbroglie/mustache/releases/download/v1.2.2/mustache_1.2.2_linux_amd64.tar.gz | sudo tar -C /usr/local/bin/ --no-same-owner -xzv mustache |
| 112 | + - name: GitHub Release |
| 113 | + env: |
| 114 | + PROJECT_VERSION: ${{needs.staging.outputs.project-version}} |
| 115 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 116 | + RELEASE_NOTES_FILE: ${{runner.temp}}/release_notes.md5 |
| 117 | + RELEASE_NOTES_DATA: ${{runner.temp}}/release_notes_data.json |
| 118 | + RELEASE_NOTES_HEADERS: ${{runner.temp}}/release_notes_headers.json |
| 119 | + RELEASE_NOTES_FOOTERS: ${{runner.temp}}/release_notes_footers.json |
| 120 | + RELEASE_NOTES_ISSUES: ${{runner.temp}}/release_notes_issues.json |
| 121 | + run: | |
| 122 | + gh issue list \ |
| 123 | + --repo spring-projects/spring-statemachine \ |
| 124 | + --milestone $PROJECT_VERSION \ |
| 125 | + --label automation/rlnotes-header \ |
| 126 | + --state all --json title,body \ |
| 127 | + --jq '{headers:map(.),headerslength:(length)}' \ |
| 128 | + > $RELEASE_NOTES_HEADERS |
| 129 | + gh issue list \ |
| 130 | + --repo spring-projects/spring-statemachine \ |
| 131 | + --milestone $PROJECT_VERSION \ |
| 132 | + --label automation/rlnotes-footer \ |
| 133 | + --state all --json title,body \ |
| 134 | + --jq '{footers:map(.),footerslength:(length)}' \ |
| 135 | + > $RELEASE_NOTES_FOOTERS |
| 136 | + gh issue list \ |
| 137 | + --repo spring-projects/spring-statemachine \ |
| 138 | + --milestone $PROJECT_VERSION \ |
| 139 | + --state all --json number,title,labels \ |
| 140 | + --jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))))}' \ |
| 141 | + > $RELEASE_NOTES_ISSUES |
| 142 | + jq -s '{issues:(.[0].issues),headers:(.[1].headers),headerslength:(.[1].headerslength),footers:(.[2].footers), footerslength:(.[2].footerslength)}' \ |
| 143 | + $RELEASE_NOTES_ISSUES \ |
| 144 | + $RELEASE_NOTES_HEADERS \ |
| 145 | + $RELEASE_NOTES_FOOTERS \ |
| 146 | + > $RELEASE_NOTES_DATA |
| 147 | + mustache $RELEASE_NOTES_DATA .github/rlnotes.mustache > $RELEASE_NOTES_FILE |
| 148 | + gh release create v$PROJECT_VERSION \ |
| 149 | + --draft \ |
| 150 | + --prerelease \ |
| 151 | + --title "$PROJECT_VERSION" \ |
| 152 | + --notes-file $RELEASE_NOTES_FILE |
0 commit comments