update to collection2 (#24) #36
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
name: CD | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Evaluate version bump | |
run: | | |
case "${{ github.event.head_commit.message }}" in | |
PATCH*) | |
part=patch;; | |
MAJOR*) | |
part=major;; | |
*) | |
part=minor;; | |
esac | |
echo "part=$(echo $part)" >> $GITHUB_ENV | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build bump2version==1.0.1 | |
- name: bump version | |
run: | | |
git config --global user.name 'version bump' | |
git config --global user.email '[email protected]' | |
bump2version \ | |
--commit \ | |
--tag \ | |
${{ env.part }} | |
git push --atomic origin main v$(cat .bumpversion.cfg | grep -Po "current_version = \K\d+\.\d+\.\d+") | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |