|
1 | | -name: "Update Changelog" |
2 | | - |
3 | 1 | on: |
4 | 2 | release: |
5 | | - types: [released] |
| 3 | + type: published |
6 | 4 |
|
7 | 5 | jobs: |
8 | | - update: |
| 6 | + comment: |
9 | 7 | runs-on: ubuntu-latest |
10 | | - |
11 | 8 | steps: |
12 | | - - name: Checkout code |
13 | | - uses: actions/checkout@v2 |
| 9 | + - uses: actions/checkout@v2 |
| 10 | + - name: Set up Python |
| 11 | + uses: actions/setup-python@v1 |
14 | 12 | with: |
15 | | - ref: main |
16 | | - |
17 | | - - name: Update Changelog |
18 | | - uses: stefanzweifel/changelog-updater-action@v1 |
| 13 | + python-version: "3.8" |
| 14 | + - name: Update version |
| 15 | + id: version |
| 16 | + run: | |
| 17 | + echo "GITHUB_REF is a tag you set for the release" |
| 18 | + echo "Your GitHub ref: ${GITHUB_REF}" |
| 19 | + VERSION=`echo "${GITHUB_REF}" | cut -f 3 -d "/"` |
| 20 | + echo "Preparing version ${VERSION}" |
| 21 | + echo "__version__ = \"${VERSION}\"" > __version__.py |
| 22 | + echo "##[set-output name=version;]$(echo ${VERSION})" |
| 23 | + - uses: vemel/update-changelog@0.0.1 |
| 24 | + id: changelog |
19 | 25 | with: |
20 | | - release-notes: ${{ github.event.release.body }} |
21 | | - latest-version: ${{ github.event.release.name }} |
22 | | - |
23 | | - - name: Commit updated CHANGELOG |
24 | | - uses: stefanzweifel/git-auto-commit-action@v4 |
| 26 | + version: ${{ steps.version.outputs.version }} |
| 27 | + - name: Create Pull Request |
| 28 | + uses: peter-evans/create-pull-request@v2 |
25 | 29 | with: |
26 | | - branch: main |
27 | | - commit_message: Update CHANGELOG |
28 | | - file_pattern: CHANGELOG.md |
| 30 | + commit-message: Release ${{ steps.version.outputs.version }} |
| 31 | + labels: release, bot |
| 32 | + title: "Release ${{ steps.version.outputs.version }}" |
| 33 | + body: | |
| 34 | + # Release ${{ steps.version.outputs.version }} |
| 35 | +
|
| 36 | + Merge this PR to update your version and changelog! |
| 37 | +
|
| 38 | + ## Included Pull Requests |
| 39 | +
|
| 40 | + ${{ steps.changelog.outputs.pulls_list_md }} |
0 commit comments