2023-01-06 01:08:29 +01:00
|
|
|
name: Release
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ release ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-01-06 01:13:58 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
token: ${{ secrets.GH_API_SECRET }}
|
2023-01-06 01:08:29 +01:00
|
|
|
|
|
|
|
- name: Set up Python 3.10
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2024-06-25 19:29:33 +02:00
|
|
|
pip install build wheel
|
2023-01-06 01:08:29 +01:00
|
|
|
|
|
|
|
- name: Get Current Version
|
|
|
|
run: |
|
|
|
|
project_version=$(python3 setup.py --version)
|
|
|
|
echo "project_version=$project_version" >> $GITHUB_OUTPUT
|
|
|
|
id: get_current_version
|
|
|
|
|
|
|
|
- name: Create Tag
|
|
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
|
|
with:
|
2024-06-08 23:14:00 +02:00
|
|
|
custom_tag: "${{steps.get_current_version.outputs.project_version}}"
|
2023-01-06 01:15:26 +01:00
|
|
|
github_token: ${{ secrets.GH_API_SECRET }}
|
2023-01-06 01:08:29 +01:00
|
|
|
|
|
|
|
- name: Build Changelog
|
|
|
|
id: build_changelog
|
|
|
|
uses: mikepenz/release-changelog-builder-action@v3.4.0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_API_SECRET }}
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: 'v${{steps.get_current_version.outputs.project_version}}'
|
|
|
|
body: ${{steps.build_changelog.outputs.changelog}}
|
|
|
|
token: ${{ secrets.GH_API_SECRET }}
|
|
|
|
|
|
|
|
- name: Build Python Package
|
2024-06-25 19:29:33 +02:00
|
|
|
run: rm -rf build *.egg-info/ && python3 -m build
|
2023-01-06 01:08:29 +01:00
|
|
|
|
|
|
|
- name: Publish to PyPi
|
|
|
|
uses: pypa/gh-action-pypi-publish@v1.6.4
|
|
|
|
with:
|
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
2023-01-06 01:13:58 +01:00
|
|
|
|
|
|
|
- name: Sync Release with Master
|
|
|
|
run: |
|
|
|
|
git fetch origin
|
|
|
|
git checkout release
|
|
|
|
git pull origin release
|
|
|
|
git checkout master
|
|
|
|
git pull origin master
|
|
|
|
git merge release --ff-only
|
|
|
|
git push origin master
|