Skip to content

Commit

Permalink
Add automatic development releases to pypi (#368)
Browse files Browse the repository at this point in the history
* initial attempt to push development builds

* add this branch to list allowed to cd

* try python 3.11

* fix my mistake

* add dependency install

* run build push after tests successfully complete. Try querying test pypi to confirm that incrementing works.

* cleanup and documentation

* skip existing for test pypi

* retarget to develop now that it appears to be working properly

* move development deployment into cd.yaml
  • Loading branch information
TShapinsky authored Feb 19, 2025
1 parent 393d290 commit fd1d17a
Show file tree
Hide file tree
Showing 5 changed files with 763 additions and 434 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,41 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

# deploy development distribution with changes to develop
deploy-dev-dist:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install-poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-in-project: false
virtualenvs-path: ~/.virtualenvs
- name: install dependencies
run: poetry install --no-root --with=dev
- name: increment dev version
env:
PYPI_URL: https://pypi.org
run: poetry run python scripts/bump_dev_version.py
- name: build dist
run: poetry build
- name: publish dev distribution to Test PyPI
id: test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: publish distribution to PyPI
if: steps.test-pypi.outcome == 'success'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ jobs:
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
files: ./coverage.xml
Loading

0 comments on commit fd1d17a

Please sign in to comment.