fix: .gitignore #9
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: Deploy to PyPi | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
concurrency: "main" | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
pip install build bump2version | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
# Wait until successful build to configure git and bump versions | |
- name: Configure Git | |
run: | | |
git config user.name "Bump Version" | |
git config user.email "[email protected]" | |
- name: Bump Major Version | |
run: | | |
bump2version major | |
echo "SKIPBUMP=TRUE" >> $GITHUB_ENV | |
if: "startsWith(github.event.head_commit.message, '[MAJOR]')" | |
- name: Bump Minor Version | |
run: | | |
bump2version minor | |
echo "SKIPBUMP=TRUE" >> $GITHUB_ENV | |
if: "startsWith(github.event.head_commit.message, '[FEATURE]')" | |
# Default action | |
- name: Bump Patch Version | |
run: | | |
bump2version patch | |
if: env.SKIPBUMP != 'TRUE' | |
- name: Push commit | |
run: git push https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git --follow-tags | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ | |
# Wait until successful build to configure git and bump versions | |
- name: Deploy to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |