Build test pypi packages #977
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: Build test pypi packages | |
on: | |
workflow_run: | |
workflows: [ Run CICD Tests ] | |
types: [ completed ] | |
branches: [ dev, cicd-fix ] | |
jobs: | |
build: | |
if: github.repository == 'ipspace/netlab' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade build | |
- name: Build package | |
run: | | |
python3 -m build | |
- name: Publish package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Build legacy package | |
run: | | |
cd legacy && python3 -m build | |
- name: Publish legacy package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_LEGACY_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
packages-dir: legacy/dist/ |