Skip to content

Commit

Permalink
chore: fix pypi.org publishing (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Dec 29, 2023
1 parent fd9b148 commit ea56066
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/publish-dev-release-to-pypi.yml
Expand Up @@ -9,10 +9,18 @@ on:

env:
TOKEN: ${{ secrets.GH_TOKEN }}
# API tokens require username "__token__".
# Repo names other than pypi.org must be configured with:
# % poetry config repositories.testpypi https://test.pypi.org/legacy/
# and the env vars must be named accordingly:
# - POETRY_HTTP_BASIC_<REPO>_USERNAME
# - POETRY_PYPI_TOKEN_<REPO>
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_DASCHBOT_TOKEN }}

jobs:
publish-dev-release-to-pypi:
if: github.event.pull_request.merged == true && (contains(github.event.pull_request.title, 'fix') || contains(github.event.pull_request.title, 'feat'))
if: github.event.pull_request.merged == true && (startsWith(github.event.pull_request.title, 'fix') || startsWith(github.event.pull_request.title, 'feat'))
runs-on: ubuntu-latest
steps:
- name: Check out repo
Expand All @@ -30,8 +38,9 @@ jobs:
poetry self add poetry-exec-plugin
- name: bump version in pyproject.toml
run: poetry exec bump-version
- name: publish new version to PyPI
- name: build wheel
run: |
rm -rf dist/ build/
poetry build
poetry publish -u=__token__ -p=${{ secrets.PYPI_DASCHBOT_TOKEN }}
- name: publish new version to PyPI
run: poetry publish
13 changes: 11 additions & 2 deletions .github/workflows/publish-release-to-pypi.yml
Expand Up @@ -8,6 +8,14 @@ on:

env:
TOKEN: ${{ secrets.GH_TOKEN }}
# API tokens require username "__token__".
# Repo names other than pypi.org must be configured with:
# % poetry config repositories.testpypi https://test.pypi.org/legacy/
# and the env vars must be named accordingly:
# - POETRY_HTTP_BASIC_<REPO>_USERNAME
# - POETRY_PYPI_TOKEN_<REPO>
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_DASCHBOT_TOKEN }}

jobs:
publish-release-to-pypi:
Expand All @@ -25,11 +33,12 @@ jobs:
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install
- name: publish new version to PyPI
- name: build wheel
run: |
rm -rf dist/ build/
poetry build
poetry publish -u=__token__ -p=${{ secrets.PYPI_DASCHBOT_TOKEN }}
- name: publish new version to PyPI
run: poetry publish

notification:
name: Google chat notification about release and published version
Expand Down

0 comments on commit ea56066

Please sign in to comment.