Skip to content

Update links in README.md, add badges for visibility #104

Update links in README.md, add badges for visibility

Update links in README.md, add badges for visibility #104

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'
env:
VERSION: 0.1.0
jobs:
bindings:
strategy:
fail-fast: false
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-13, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.8' }
- {runner: macos-13, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.9' }
- {runner: macos-13, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.10' }
- {runner: macos-13, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.11' }
- {runner: macos-13, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.12' }
- {runner: ubuntu-22.04, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.8' }
- {runner: ubuntu-22.04, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.9' }
- {runner: ubuntu-22.04, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.10' }
- {runner: ubuntu-22.04, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-22.04, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2019, arch: x64, py-arch: x64, qt-compiler: win64_msvc2019_64, config: RelWithDebInfo, py-version: '3.8' }
- {runner: windows-2019, arch: x64, py-arch: x64, qt-compiler: win64_msvc2019_64, config: RelWithDebInfo, py-version: '3.9' }
- {runner: windows-2019, arch: x64, py-arch: x64, qt-compiler: win64_msvc2019_64, config: RelWithDebInfo, py-version: '3.10' }
- {runner: windows-2019, arch: x64, py-arch: x64, qt-compiler: win64_msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2019, arch: x64, py-arch: x64, qt-compiler: win64_msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
runs-on: ${{ matrix.variant.runner }}
name: python${{ matrix.variant.py-version }} / ${{ matrix.variant.runner }} / ${{ matrix.variant.config }}
env:
CMAKE_FLAGS: ""
QT_VERSION: 6.6.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.variant.py-version }}
architecture: ${{ matrix.variant.py-arch }}
- name: Environment Setup (Windows)
if: startsWith(matrix.variant.runner, 'windows-')
run: |
Import-Module .\.github\Invoke-VisualStudio.ps1
Invoke-VisualStudio2019${{ matrix.variant.arch }}
- name: Environment Setup (Linux)
if: startsWith(matrix.variant.runner, 'ubuntu-')
run: |
sudo apt-get -y update
sudo apt install -y g++ ninja-build clang
echo CC=clang >> $GITHUB_ENV
echo CXX=clang++ >> $GITHUB_ENV
- name: Environment Setup (MacOS)
if: startsWith(matrix.variant.runner, 'macos-')
run: |
echo CC=clang >> $GITHUB_ENV
echo CXX=clang++ >> $GITHUB_ENV
- name: Cache Artifacts
id: cache-artifacts
uses: actions/cache@v4
with:
path: build/${{ env.QT_VERSION }}
key: aqt-install-${{ matrix.variant.runner }}-${{ matrix.variant.arch }}-${{ env.QT_VERSION }}-${{ matrix.variant.qt-compiler }}
- name: Setup Qt (Windows)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'windows-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build windows desktop ${{ env.QT_VERSION }} ${{ matrix.variant.qt-compiler }}
- name: Setup Qt (Linux)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'ubuntu-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build linux desktop ${{ env.QT_VERSION }} ${{ matrix.variant.qt-compiler }}
- name: Setup Qt (MacOS)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'macos-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build mac desktop ${{ env.QT_VERSION }} ${{ matrix.variant.qt-compiler }}
- name: Python installation
run: |
python -m pip install .[tests] -U --user
- name: Test
if: startsWith(matrix.variant.runner, 'macos-') == false
run: |
python -m pytest -v python/tests
- name: Build wheels (Linux)
if: startsWith(matrix.variant.runner, 'ubuntu-') == true && matrix.variant.py-version == '3.8'
uses: pypa/[email protected]
- name: Build wheels (Others)
if: startsWith(matrix.variant.runner, 'ubuntu-') == false
run: |
mkdir wheelhouse
python -m pip wheel . --wheel-dir wheelhouse --progress-bar on
- name: Upload artifacts
if: startsWith(matrix.variant.runner, 'ubuntu-') == false || matrix.variant.py-version != '3.8'
uses: actions/upload-artifact@v4
with:
name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }}
path: |
wheelhouse/die_python-*.whl
retention-days: 1
publish:
needs: bindings
strategy:
fail-fast: false
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-13, config: Release, py-version: '3.8' }
- {runner: macos-13, config: Release, py-version: '3.9' }
- {runner: macos-13, config: Release, py-version: '3.10' }
- {runner: macos-13, config: Release, py-version: '3.11' }
- {runner: macos-13, config: Release, py-version: '3.12' }
- {runner: ubuntu-22.04, config: RelWithDebInfo, py-version: '3.8' }
# - {runner: ubuntu-22.04, config: RelWithDebInfo, py-version: '3.9' }
# - {runner: ubuntu-22.04, config: RelWithDebInfo, py-version: '3.10' }
# - {runner: ubuntu-22.04, config: RelWithDebInfo, py-version: '3.11' }
# - {runner: ubuntu-22.04, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2019, config: RelWithDebInfo, py-version: '3.8' }
- {runner: windows-2019, config: RelWithDebInfo, py-version: '3.9' }
- {runner: windows-2019, config: RelWithDebInfo, py-version: '3.10' }
- {runner: windows-2019, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2019, config: RelWithDebInfo, py-version: '3.12' }
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: PyPI upload of ${{ matrix.variant.runner }}/${{ matrix.variant.config }}/py${{ matrix.variant.py-version }}
environment:
name: pypi
url: https://pypi.org/p/die-python
permissions:
id-token: write
steps:
- name: Download artifact for ${{ matrix.variant.runner }}/${{ matrix.variant.py-version }}/${{ matrix.variant.config }}
uses: actions/download-artifact@v4
id: download_wheels
with:
name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }}
path: .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ steps.download_wheels.outputs.download-path }}
print-hash: true