OOMMFPy manual build and publish #20
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: OOMMFPy manual build and publish | |
on: | |
workflow_dispatch: | |
branches: [ test_gh_actions ] | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
build_packages: | |
name: Building wheels and main package | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
poetry-version: [1.8.3] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pip and poetry ${{ matrix.poetry-version }} | |
run: | | |
python -m ensurepip | |
python -m pip install --upgrade pip | |
python -m pip install poetry==${{ matrix.poetry-version }} | |
- name: Install dependencies | |
shell: bash | |
run: python -m poetry install | |
- name: Build with Poetry | |
run: | | |
python -m poetry build | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: poetry-dist-objects-${{ matrix.python-version }}-${{ matrix.os }} | |
path: | | |
dist/*.whl | |
pypipublish: | |
needs: build_packages | |
name: Publish to PyPI | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.12] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Download all build objects (artifacts) | |
uses: actions/download-artifact@v4 | |
- name: Extract files | |
run: | | |
ls -R | |
mkdir dist | |
mv poetry-dist-objects-*/*.whl dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |