Publish to PyPI under the mirrored and original name #73
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |