Bump version. #25
Workflow file for this run
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 | |
on: | |
push: | |
branches: [ develop ] | |
tags: ['**'] | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
build-sdist: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Create sdist | |
run: | | |
python configure.py | |
python -m pip install build | |
python -m build -s | |
- name: Check files | |
run: | | |
ls dist/ | |
python -m pip install twine | |
python -m twine check dist/* | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/* | |
if-no-files-found: error | |
build-test: | |
runs-on: ${{ matrix.os }} | |
needs: build-sdist | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: Download sdist | |
uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install sdist (Windows) | |
if: matrix.os == 'windows-latest' | |
run: python -m pip install ((Get-ChildItem -Path dist/ -Filter *.tar.gz)[0].FullName) | |
- name: Install sdist (Ubuntu/MacOS) | |
if: matrix.os != 'windows-latest' | |
run: python -m pip install $(ls dist/*.tar.gz| head -1) | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Run test suite | |
run: | | |
pip install pytest numpy | |
pytest | |
release: | |
if: github.repository == 'mcmtroffaes/pycddlib-standalone' | |
runs-on: 'ubuntu-latest' | |
permissions: | |
id-token: write | |
needs: [ build-sdist, build-test ] | |
steps: | |
- name: Download sdist | |
uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist/ | |
- name: List files | |
run: ls dist/ | |
- name: Publish to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 |