Skip to content

Commit

Permalink
move development deployment into cd.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Feb 18, 2025
1 parent b133eff commit 4239bf2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 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 }}
41 changes: 1 addition & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,43 +149,4 @@ jobs:
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml

# deploy development distribution with changes to develop
deploy-dev-dist:
needs: testing
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 }}
files: ./coverage.xml

0 comments on commit 4239bf2

Please sign in to comment.