Publish: PyPi #50
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: "Publish: PyPi" | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
deploy_linux: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./src/python/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y python3-setuptools | |
python -m pip install --upgrade pip | |
pip install wheel | |
make python | |
ls src/python | |
echo "-------" | |
ls src/python/code/gnoll/ | |
- name: Build package | |
working-directory: ./src/python/ | |
run: | | |
python setup.py bdist_wheel --plat-name=manylinux_2_17_x86_64 | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
packages_dir: ./src/python/dist | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN_2022 }} | |
#password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
deploy_wsl: | |
runs-on: windows-2022 | |
steps: | |
- uses: Vampire/setup-wsl@v1 | |
with: | |
distribution: Ubuntu-22.04 | |
update: 'true' | |
additional-packages: | |
python3-dev | |
bison | |
flex | |
python3-pip | |
build-essential | |
libssl-dev | |
libffi-dev | |
python3.10-venv | |
- uses: actions/checkout@v3 | |
- name: test | |
shell: wsl-bash {0} | |
run: | | |
export PATH="/root/.local/bin:$PATH" | |
python3 -m pip install --upgrade pip | |
python3 -m pip install wheel twine | |
python3 -m pip install --upgrade setuptools | |
make python | |
ls src/python | |
echo "-------" | |
ls src/python/code/gnoll/ | |
- name: Build package | |
shell: wsl-bash {0} | |
working-directory: ./src/python/ | |
run: | | |
# touch ~/.pypirc | |
python3 setup.py bdist_wheel --plat-name=manylinux1_x86_64 | |
python3 -m twine upload dist/* --non-interactive -u __token__ -p ${{ secrets.PYPI_API_TOKEN_2022 }} | |
# python3 -m twine upload dist/* --non-interactive -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} --repository-url https://test.pypi.org/legacy/ | |
deploy_mac: | |
runs-on: macos-12 | |
env: | |
working-directory: ./src/python/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel twine | |
make python | |
ls src/python | |
echo "-------" | |
ls src/python/code/gnoll/ | |
- name: Build package | |
working-directory: ./src/python/ | |
run: | | |
touch ~/.pypirc | |
python setup.py bdist_wheel | |
twine upload --non-interactive -u __token__ -p ${{ secrets.PYPI_API_TOKEN_2022 }} dist/* | |
# twine upload --non-interactive -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} --repository-url https://test.pypi.org/legacy/ dist/* |