Merge pull request #23 from brainelectronics/feature/use-changelog-sn… #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# this file is *not* meant to cover or endorse the use of GitHub Actions, but | |
# rather to help make automated releases for this project | |
name: Upload Python Package | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# all history is needed to crawl it properly | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install build dependencies | |
run: | | |
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi | |
- name: Update changelog with snippets | |
run: | | |
changelog-generator \ | |
changelog changelog.md \ | |
--snippets=.snippets \ | |
--in-place | |
- name: Build package | |
run: | | |
changelog2version \ | |
--changelog_file changelog.md \ | |
--version_file be_upy_blink/version.py \ | |
--version_file_type py \ | |
--debug | |
python setup.py sdist | |
rm dist/*.orig | |
# sdist call create non conform twine files *.orig, remove them | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1.5 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true | |
verbose: true | |
print_hash: true | |
- name: 'Create changelog based release' | |
uses: brainelectronics/changelog-based-release@v1 | |
with: | |
# note you'll typically need to create a personal access token | |
# with permissions to create releases in the other repo | |
# or you set the "contents" permissions to "write" as in this example | |
changelog-path: changelog.md | |
tag-name-prefix: '' | |
tag-name-extension: '' | |
release-name-prefix: '' | |
release-name-extension: '' | |
draft-release: true | |
prerelease: false |