name: Build and Release mxPIC Wheels # This tells GitHub to ONLY run this pipeline when you push a version tag (e.g., v1.0.0) on: release: types: [published] jobs: # --- JOB 1: THE COMPILER --- build-wheels: name: Build on ${{ matrix.os }} # The matrix allows us to build for Windows and Linux simultaneously! runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest] python-version: ['3.10'] steps: - name: Checkout Code uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Build Dependencies # Install the tools required by our custom build_wheel.py script run: | python -m pip install --upgrade pip pip install build wheel mypy Cython setuptools - name: Run Auto-Builder (Compiles C-extensions & Injects .pyi) run: python build_wheel.py - name: Temporarily Store the Built Wheel uses: actions/upload-artifact@v4 with: name: mxpic-wheels-${{ matrix.os }} path: dist/*.whl retention-days: 1 # --- JOB 2: THE RELEASER --- create-release: name: Publish to GitHub Releases needs: build-wheels # Waits for both Windows and Linux to finish runs-on: ubuntu-latest permissions: contents: write # Required to allow the bot to create a release page steps: - name: Checkout Code uses: actions/checkout@v4 - name: Download all OS Wheels uses: actions/download-artifact@v4 with: pattern: mxpic-wheels-* path: dist merge-multiple: true - name: Upload Assets to Gitea Release uses: softprops/action-gh-release@v1 with: files: "dist/*.whl" api_key: ${{ secrets.GITEA_TOKEN }}