|
| 1 | +name: Create release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: "🚀 Release" |
| 11 | + runs-on: ubuntu-18.04 |
| 12 | + steps: |
| 13 | + - name: "Check-out" |
| 14 | + uses: actions/checkout@v1 |
| 15 | + - name: "Update Release CHANGELOG" |
| 16 | + id: update-release-changelog |
| 17 | + uses: heinrichreimer/github-changelog-generator-action@v2.2 |
| 18 | + with: |
| 19 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 20 | + onlyLastTag: true |
| 21 | + stripHeaders: false |
| 22 | + base: "CHANGELOG.md" |
| 23 | + headerLabel: "# Changelog" |
| 24 | + breakingLabel: '### Breaking' |
| 25 | + enhancementLabel: '### Enhancements' |
| 26 | + stripGeneratorNotice: true |
| 27 | + bugsLabel: '### Fixes' |
| 28 | + issues: true |
| 29 | + issuesWoLabels: true |
| 30 | + pullRequests: true |
| 31 | + prWoLabels: true |
| 32 | + author: false |
| 33 | + verbose: true |
| 34 | + - name: Commit CHANGELOG Changes |
| 35 | + run: | |
| 36 | + git add . |
| 37 | + git config user.name "zihe.jia" |
| 38 | + git config user.email "zihe.jia@mixpanel.com" |
| 39 | + git commit -m "Update CHANGELOG" |
| 40 | + - name: Push CHANGELOG changes |
| 41 | + uses: ad-m/github-push-action@v0.6.0 |
| 42 | + with: |
| 43 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + branch: master |
| 45 | + force: true |
| 46 | + - name: "Prepare for the Github Release" |
| 47 | + id: generate-release-changelog |
| 48 | + uses: heinrichreimer/github-changelog-generator-action@v2.2 |
| 49 | + with: |
| 50 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + output: "output.md" |
| 52 | + headerLabel: "# Changelog" |
| 53 | + onlyLastTag: true |
| 54 | + stripHeaders: false |
| 55 | + breakingLabel: '### Breaking' |
| 56 | + enhancementLabel: '### Enhancements' |
| 57 | + stripGeneratorNotice: true |
| 58 | + bugsLabel: '### Fixes' |
| 59 | + issues: true |
| 60 | + issuesWoLabels: true |
| 61 | + pullRequests: true |
| 62 | + prWoLabels: true |
| 63 | + author: false |
| 64 | + verbose: true |
| 65 | + - name: "🚀 Create GitHub Release" |
| 66 | + uses: actions/create-release@v1 |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + with: |
| 70 | + tag_name: ${{ github.ref }} |
| 71 | + release_name: Release ${{ github.ref }} |
| 72 | + body: ${{ steps.generate-release-changelog.outputs.changelog }} |
0 commit comments