|
| 1 | +name: changerelease |
1 | 2 | on: |
2 | | - release: |
3 | | - types: [released] |
4 | | - |
| 3 | + workflow_dispatch: {} |
| 4 | + push: |
| 5 | + paths: [CHANGELOG.md] |
| 6 | + branches: [master] |
| 7 | + tags: ["*"] |
| 8 | + |
5 | 9 | jobs: |
6 | | - comment: |
| 10 | + sync: |
7 | 11 | runs-on: ubuntu-latest |
8 | 12 | steps: |
9 | | - - uses: actions/checkout@v2 |
10 | | - - name: Set up Python |
11 | | - uses: actions/setup-python@v1 |
12 | | - with: |
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 |
25 | | - with: |
26 | | - version: ${{ steps.version.outputs.version }} |
27 | | - - name: Create Pull Request |
28 | | - uses: peter-evans/create-pull-request@v2 |
29 | | - with: |
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! |
| 13 | + - uses: actions/checkout@v2 |
37 | 14 |
|
38 | | - ## Included Pull Requests |
| 15 | + # Convert to markdown first |
| 16 | + # https://github.com/pandoc/pandoc-action-example |
| 17 | + - uses: docker://pandoc/core:2.14 |
| 18 | + with: |
| 19 | + args: "CHANGELOG.rst -f rst -t markdown -o CR_CHANGELOG.md" |
39 | 20 |
|
40 | | - ${{ steps.changelog.outputs.pulls_list_md }} |
| 21 | + - uses: dropseed/changerelease@v1 |
| 22 | + with: |
| 23 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + # optional |
| 25 | + tag_prefix: v |
| 26 | + changelog: CR_CHANGELOG.md |
| 27 | + remote_changelog: false |
0 commit comments