Skip to content

Publish to PyPI under the mirrored and original name #73

Publish to PyPI under the mirrored and original name

Publish to PyPI under the mirrored and original name #73

Workflow file for this run

name: Publish to PyPI under the mirrored and original name
on:
release:
types:
- published
env:
PACKAGE_NAME1: discord-py-interactions
PACKAGE_NAME2: interactions.py
jobs:
build-and-publish:
runs-on: ubuntu-latest
if: "!github.event.release.prerelease"
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish packages
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
for PACKAGE_NAME in $PACKAGE_NAME1 $PACKAGE_NAME2; do
sed -i "s/name=.*,/name=\"$PACKAGE_NAME\",/" setup.py
python -m build --outdir dist/$PACKAGE_NAME
python -m twine upload --skip-existing -u __token__ -p $PYPI_API_TOKEN dist/$PACKAGE_NAME/*
done