Skip to content

Commit 089fedb

Browse files
Add Release Github-Action
1 parent c77e311 commit 089fedb

File tree

1 file changed

+30
-0
lines changed
  • {{ cookiecutter.package_name }}/.github/workflows

1 file changed

+30
-0
lines changed

{{ cookiecutter.package_name }}/.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,33 @@ jobs:
122122
{%- endif %}
123123
secrets:
124124
pypi_token: {{ '${{ secrets.pypi_token }}' }}
125+
126+
release:
127+
if: startsWith(github.ref, 'refs/tags/v')
128+
runs-on: ubuntu-latest
129+
permissions:
130+
contents: write
131+
actions: none
132+
checks: none
133+
deployments: none
134+
steps:
135+
- name: Checkout repository
136+
uses: actions/checkout@v3
137+
- name: Install Pandoc
138+
run: sudo apt-get update && sudo apt-get install -y pandoc
139+
- name: Generate GitHub Release Notes
140+
run: |
141+
pip install bleach
142+
pandoc --wrap=none -t markdown_strict CHANGELOG.rst > notes.md
143+
python3 -c "import bleach, sys; print(bleach.clean(sys.stdin.read()))" < notes.md > release_notes.md
144+
{ echo "RELEASE_BODY<<EOF"; cat release_notes.md; echo "EOF"; } >> $GITHUB_ENV
145+
- name: Create GitHub Release
146+
uses: "actions/create-release@v1.1.4"
147+
env:
148+
GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }}
149+
with:
150+
tag_name: {{ '${{ github.ref }}' }}
151+
release_name: {{ '${{ github.ref_name }}' }}
152+
body: {{ '${{ env.RELEASE_BODY }}' }}
153+
draft: false
154+
prerelease: false

0 commit comments

Comments
 (0)