2021-06-30 17:32:32 +02:00
|
|
|
|
|
|
|
name: Release Drafter
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-30 18:08:56 +02:00
|
|
|
- main
|
2021-06-30 17:32:32 +02:00
|
|
|
|
2021-10-23 21:57:46 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: read
|
|
|
|
|
2021-06-30 17:32:32 +02:00
|
|
|
jobs:
|
|
|
|
update_release_draft:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: release-drafter/release-drafter@v5
|
|
|
|
id: release-draft
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
# Update version number in setup.py
|
2023-09-25 00:04:02 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-30 17:32:32 +02:00
|
|
|
- name: Calculate version
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
tag="${{ steps.release-draft.outputs.tag_name }}"
|
2022-11-22 19:30:14 +01:00
|
|
|
echo "version=${tag:1}" >> $GITHUB_OUTPUT
|
2021-06-30 17:32:32 +02:00
|
|
|
|
|
|
|
- name: Set setup.py version
|
|
|
|
run: |
|
|
|
|
sed -i "s/VERSION = .*/VERSION = \"${{ steps.version.outputs.version }}\"/g" setup.py
|
|
|
|
# github actions email from here: https://github.community/t/github-actions-bot-email-address/17204
|
|
|
|
- name: Commit changes
|
|
|
|
run: |
|
|
|
|
if ! git diff --quiet; then
|
|
|
|
git config --global user.name "github-actions[bot]"
|
|
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git commit -am "Bump version to ${{ steps.version.outputs.version }}"
|
|
|
|
git push
|
|
|
|
fi
|