Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix pypi.org publishing #708

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/publish-dev-release-to-pypi.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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