Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test against a RabbitMQ broker
on:
push:
branches:
- master
- main
pull_request:
types:
- opened
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish-pypi

on:
workflow_call:
inputs:
pypi_repository_url:
required: true
type: string
secrets:
pypi_api_login:
required: true
pypi_api_password:
required: true

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment:
name: pypi
url: https://pypi.org/p/rabbitmq-amqp-python-client
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- name: build with poetry
env:
REPO: ${{ inputs.pypi_repository_url }}
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="/home/runner/.local/bin:$PATH"
poetry config repositories.test-pypi $REPO
poetry build
# retrieve your distributions here
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
attestations: false
17 changes: 17 additions & 0 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: publish-release

on:
release:
types:
- released

jobs:
call-publish-pypi:
permissions:
id-token: write
uses: ./.github/workflows/publish-pypi.yaml
with:
pypi_repository_url: https://upload.pypi.org/legacy/
secrets:
pypi_api_login: __token__
pypi_api_password: ${{ secrets.PYPI_TOKEN }}