Update deployment workflows to include Twine for package uploads #34
Workflow file for this run
This file contains hidden or 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 new package into test pypi | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*d' | |
| jobs: | |
| build_manylinux2014: | |
| name: Build for manylinux2014 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: docker://quay.io/pypa/manylinux2014_x86_64 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| with: | |
| submodules: recursive | |
| - name: Install Git LFS | |
| run: | | |
| mkdir gitlfs && pushd gitlfs | |
| curl -L https://github.com/git-lfs/git-lfs/releases/download/v2.13.2/git-lfs-linux-amd64-v2.13.2.tar.gz | tar -zxv | |
| ./install.sh | |
| popd | |
| - name: Pull LFS files | |
| run: cd Kiwi && git config --global --add safe.directory /__w/kiwipiepy/kiwipiepy/Kiwi && git lfs pull | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| /opt/python/cp311-cp311/bin/pip install "cmake<4" | |
| rm /usr/local/bin/cmake || true | |
| ln -s /opt/python/cp311-cp311/bin/cmake /usr/local/bin/cmake | |
| yum install libffi-devel -y | |
| /opt/python/cp311-cp311/bin/python -m pip install --upgrade pip setuptools | |
| /opt/python/cp311-cp311/bin/python -m pip install twine wheel numpy | |
| /opt/python/cp311-cp311/bin/python setup.py sdist | |
| /opt/python/cp311-cp311/bin/python -m twine upload --repository testpypi dist/*.tar.gz | |
| USE_MIMALLOC=1 Py_LIMITED_API=1 /opt/python/cp311-cp311/bin/python setup.py build bdist_wheel | |
| auditwheel repair dist/*-linux_x86_64.whl | |
| for cp in cp314-cp314t | |
| do | |
| /opt/python/${cp}/bin/python -m pip install wheel setuptools numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py` | |
| USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel | |
| auditwheel repair dist/*-${cp}-linux_x86_64.whl | |
| done | |
| /opt/python/cp311-cp311/bin/python -m twine upload --repository testpypi wheelhouse/*.whl | |
| cd model | |
| /opt/python/cp311-cp311/bin/python setup.py sdist | |
| /opt/python/cp311-cp311/bin/python -m twine upload --repository testpypi dist/*.tar.gz | |
| build_macos: | |
| name: Build for macOS | |
| runs-on: macos-15 | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.14t] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: arm64 | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install twine wheel numpy==`python .github/workflows/numpy_version.py` setuptools | |
| MACOSX_DEPLOYMENT_TARGET=11.0 KIWI_CPU_ARCH=arm64 USE_MIMALLOC=1 python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_macos_limited_api: | |
| name: Build for macOS (with Limited API) | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| architecture: arm64 | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install twine wheel numpy setuptools | |
| MACOSX_DEPLOYMENT_TARGET=11.0 KIWI_CPU_ARCH=arm64 USE_MIMALLOC=1 Py_LIMITED_API=1 python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_macos_intel: | |
| name: Build for macOS Intel | |
| runs-on: macos-15-intel | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.14t] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install twine wheel numpy==`python .github/workflows/numpy_version.py` setuptools | |
| MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=x86_64 USE_MIMALLOC=1 python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_macos_intel_limited_api: | |
| name: Build for macOS Intel (with Limited API) | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| architecture: x64 | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install twine wheel numpy setuptools | |
| MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=x86_64 USE_MIMALLOC=1 Py_LIMITED_API=1 python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_windows: | |
| name: Build for Windows | |
| runs-on: windows-2022 | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.14t] | |
| architecture: [x64] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.architecture }} | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install --upgrade pip setuptools | |
| python -m pip install twine wheel numpy==$(python .github/workflows/numpy_version.py) | |
| $env:USE_MIMALLOC = 1; python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_windows_limited_api: | |
| name: Build for Windows (with Limited API) | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python 3.11 x64 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| architecture: x64 | |
| - name: Deploy | |
| continue-on-error: True | |
| env: | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| run: | | |
| python -m pip install --upgrade pip setuptools | |
| python -m pip install twine wheel numpy | |
| $env:USE_MIMALLOC = 1; $env:Py_LIMITED_API=1; python setup.py bdist_wheel | |
| twine upload --repository testpypi dist/* | |
| build_other_arch: | |
| name: Build for manylinux (other arch) | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| matrix: | |
| arch: [aarch64] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - uses: bab2min/run-on-arch-action@multiple-step-v2 | |
| name: Deploy | |
| id: runcmd | |
| with: | |
| image: quay.io/pypa/manylinux2014_${{ matrix.arch }} | |
| githubToken: ${{ github.token }} | |
| setup: | | |
| mkdir -p "${PWD}/artifacts" | |
| dockerRunArgs: | | |
| --volume "${PWD}/artifacts:/artifacts" | |
| env: | | |
| TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
| multipleRun: | | |
| - name: Build | |
| run: | | |
| /opt/python/cp311-cp311/bin/pip install "cmake<4" | |
| rm /usr/local/bin/cmake || true | |
| ln -s /opt/python/cp311-cp311/bin/cmake /usr/local/bin/cmake | |
| /opt/python/cp311-cp311/bin/pip install -U wheel setuptools numpy twine | |
| USE_MIMALLOC=1 Py_LIMITED_API=1 /opt/python/cp311-cp311/bin/python setup.py build bdist_wheel | |
| auditwheel repair dist/*.whl | |
| for cp in cp314-cp314t | |
| do | |
| /opt/python/${cp}/bin/pip install -U wheel setuptools numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py` | |
| USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel | |
| auditwheel repair dist/*-${cp}-*.whl | |
| done | |
| /opt/python/cp311-cp311/bin/twine upload --repository testpypi wheelhouse/*.whl |