Skip to content

PyPI wheel packaging #13

PyPI wheel packaging

PyPI wheel packaging #13

Workflow file for this run

name: PyPI wheel packaging
on: workflow_dispatch
env:
MOPAC_VERSION: 23.1.2
jobs:
build-wheel:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
environment: pypi-deployment
strategy:
matrix:
os: [macos-13, ubuntu-latest, windows-latest]
include:
- osname: mac
platform: macosx-10.13-universal2
arc: zip
lib: dylib
libdir: lib
util: unzip
os: macos-13
- osname: linux
platform: manylinux_2_17_x86_64
arc: tar.gz
lib: so*
libdir: lib
util: "tar -xvzf"
os: ubuntu-latest
- osname: win
platform: win-amd64
arc: zip
lib: dll
libdir: bin
util: unzip
os: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download the shared library from GitHub Release
shell: bash
run: |
curl -OL https://github.com/openmopac/mopac/releases/download/v${{ env.MOPAC_VERSION }}/mopac-${{ env.MOPAC_VERSION }}-${{ matrix.osname }}.${{ matrix.arc }}
${{ matrix.util }} mopac-${{ env.MOPAC_VERSION }}-${{ matrix.osname }}.${{ matrix.arc }}
mkdir src/mopactools/lib
mv mopac-${{ env.MOPAC_VERSION }}-${{ matrix.osname }}/${{ matrix.libdir }}/*.${{ matrix.lib }} src/mopactools/lib
ls src/mopactools/lib
- name: Build package
shell: bash
run: |
pip install build
python -m build -C--build-option=--plat-name=${{ matrix.platform }}
- name: Run tests
shell: bash
run: |
pip install .
pip install pytest
pytest
# I'll do this by hand for now...
# - name: Deploy to PyPI
# shell: bash
# run: |
# pip install twine==6.0.1
# python -m twine upload --repository testpypi dist/*
- name: Save wheel artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-wheel
path: dist