Upload FoldOptLib to PyPI #48
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: Upload FoldOptLib to PyPI | |
on: | |
release: | |
types: [edited, created, published] | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
python-version: ['3.9'] | |
include: | |
- os: windows-latest | |
compiler: "msvc" | |
- os: ubuntu-latest | |
compiler: "gcc" | |
- os: macos-latest | |
compiler: "gcc" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools wheel twine | |
- name: Set up C++ Compiler and Build Tools | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows') }} | |
cmake: true | |
ninja: true | |
vcpkg: true | |
cppcheck: true | |
clangtidy: true | |
- name: Build and Test | |
run: | | |
python setup.py sdist bdist_wheel | |
publish: | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build Package | |
run: python setup.py sdist bdist_wheel | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install twine | |
run: pip install twine | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |