Repository navigation
move _cdef.h and _surface.json into python/libdogecoin/ #17
Workflow file for this run
This file contains hidden or 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 and upload to PyPI | |
| # Build on every branch push, tag push, and pull request change: | |
| on: [push, pull_request] | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.archs }} for ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - armhf-linux | |
| - aarch64-linux | |
| - x86_64-linux-dbg | |
| - x86_64-macos | |
| - x86_64-win | |
| - i686-win | |
| - i686-linux | |
| include: | |
| - name: armhf-linux | |
| host: arm-linux-gnueabihf | |
| os: ubuntu-22.04 | |
| arch: arm32v7 | |
| - name: aarch64-linux | |
| host: aarch64-linux-gnu | |
| os: ubuntu-22.04 | |
| arch: arm64v8 | |
| - name: x86_64-linux-dbg | |
| host: x86_64-pc-linux-gnu | |
| os: ubuntu-22.04 | |
| arch: amd64 | |
| - name: i686-linux | |
| host: i686-pc-linux-gnu | |
| os: ubuntu-22.04 | |
| arch: i386 | |
| - name: x86_64-macos | |
| host: x86_64-apple-darwin14 | |
| os: macos-latest | |
| arch: amd64 | |
| - name: x86_64-win | |
| host: x86_64-w64-mingw32 | |
| os: windows-latest | |
| arch: amd64 | |
| plat-name: amd64 | |
| - name: i686-win | |
| host: i686-w64-mingw32 | |
| os: windows-latest | |
| arch: i386 | |
| plat-name: win32 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build wheels for ${{ matrix.host }} | |
| if: runner.os == 'Linux' | |
| run: | | |
| ./bin/dist --host=${{ matrix.host }} | |
| # docker buildx build \ | |
| # -t xanimo/python-libdogecoin:${{ matrix.arch }} \ | |
| # --build-arg FLAVOR=${FLAVOR:-"bullseye"} \ | |
| # --build-arg ARCH=${{ matrix.arch }} \ | |
| # --build-arg TARGET_HOST=${{ matrix.host }} \ | |
| # --target artifact \ | |
| # --output type=local,dest=. . | |
| - name: Setup WSL | |
| if: runner.os == 'Windows' | |
| uses: Vampire/setup-wsl@v7.0.0 | |
| - uses: actions/setup-python@v5 | |
| if: runner.os != 'Linux' && runner.os != 'Windows' | |
| name: Install Python | |
| with: | |
| python-version: '3.10' | |
| - name: Install Python build dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: pip install --upgrade cython setuptools build requests pytest wheel | |
| - name: Build wheels for ${{ matrix.host }} | |
| if: runner.os == 'Windows' | |
| shell: wsl-bash {0} | |
| run: | | |
| mkdir -p ./wheels | |
| bash ./bin/init --arch=${{ matrix.plat-name }} | |
| - name: Build wheels for ${{ matrix.host }} | |
| if: matrix.host == 'x86_64-apple-darwin14' | |
| env: | |
| CC: clang -arch x86_64 | |
| CXX: clang++ -arch x86_64 | |
| ARCHFLAGS: -arch x86_64 | |
| _PYTHON_HOST_PLATFORM: macosx-10.9-x86_64 | |
| run: | | |
| brew install autoconf automake libtool | |
| mkdir -p wheels | |
| python fetch.py --host=${{ matrix.host }} | |
| python -m build -w | |
| cp ./dist/*.whl ./wheels | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.name }} | |
| path: ./wheels/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.10' | |
| - run: pip install --upgrade pip cython setuptools build | |
| - name: Build sdist | |
| run: | | |
| mkdir -p wheels | |
| python -m build -s | |
| cp dist/*.tar.gz ./wheels | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: wheels/*.tar.gz | |
| ci_gate: | |
| name: CI gate — all targets must pass | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "All CI targets passed." | |
| upload_pypi: | |
| needs: [ci_gate] | |
| runs-on: ubuntu-latest | |
| # upload to PyPI on every tag starting with 'v' | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_PASSWORD }} | |
| repository_url: https://upload.pypi.org/legacy/ | |
| verbose: true | |
| print_hash: true |