alpha.2 fixes #43
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: Release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-version: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - name: Check tag version | |
| run: | | |
| version=$(grep -m1 '^version = ' crates/processing_pyo3/Cargo.toml | cut -d'"' -f2) | |
| if [ "v$version" != "${{ github.ref_name }}" ]; then | |
| echo "::error::tag ${{ github.ref_name }} does not match processing_pyo3 version $version" | |
| exit 1 | |
| fi | |
| generate-stubs: | |
| runs-on: ubuntu-22.04 | |
| needs: check-version | |
| if: ${{ !failure() && !cancelled() }} | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/setup | |
| - name: Generate type stubs | |
| run: | | |
| cargo build --release -p processing_pyo3 | |
| cargo run --release -p generate_stubs | |
| - name: Bundle shader packages | |
| run: cargo run --release -p bundle_shaders | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: python-assets | |
| path: | | |
| crates/processing_pyo3/mewnala/*.pyi | |
| crates/processing_pyo3/mewnala/shaders/ | |
| linux: | |
| runs-on: ubuntu-22.04 | |
| needs: generate-stubs | |
| strategy: | |
| matrix: | |
| # TODO: add aarch64 when we are ready to address long build times | |
| target: [x86_64] | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.x' | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: python-assets | |
| path: crates/processing_pyo3/mewnala | |
| - name: Setup QEMU | |
| if: matrix.target == 'aarch64' | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 | |
| with: | |
| container: "quay.io/pypa/manylinux_2_34_${{matrix.target}}:latest" | |
| docker-options: "-e PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/${{matrix.target}}-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig" | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| manylinux: 2_34 | |
| before-script-linux: | | |
| EXTRA_PACKAGES="" | |
| if [ "$(uname -m)" = "aarch64" ]; then | |
| EXTRA_PACKAGES="gcc-aarch64-linux-gnu" | |
| fi | |
| dnf -y install cmake gcc-c++ \ | |
| pkgconfig alsa-lib-devel systemd-devel \ | |
| libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel \ | |
| libxkbcommon-devel wayland-devel wayland-protocols-devel \ | |
| glfw-devel $EXTRA_PACKAGES | |
| working-directory: crates/processing_pyo3 | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: wheels-linux-${{ matrix.target }} | |
| path: crates/processing_pyo3/dist | |
| macos: | |
| runs-on: ${{ matrix.runner }} | |
| needs: generate-stubs | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: macos-14 | |
| target: aarch64 | |
| # TODO: lets add this build when we have a moment | |
| # - runner: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.x' | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: python-assets | |
| path: crates/processing_pyo3/mewnala | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| working-directory: crates/processing_pyo3 | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: wheels-macos-${{ matrix.target }} | |
| path: crates/processing_pyo3/dist | |
| windows: | |
| runs-on: windows-latest | |
| needs: generate-stubs | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.x' | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: python-assets | |
| path: crates/processing_pyo3/mewnala | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 | |
| with: | |
| target: x64 | |
| args: --release --out dist --find-interpreter | |
| working-directory: crates/processing_pyo3 | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: wheels-windows-x64 | |
| path: crates/processing_pyo3/dist | |
| sdist: | |
| runs-on: ubuntu-latest | |
| needs: generate-stubs | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: python-assets | |
| path: crates/processing_pyo3/mewnala | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| working-directory: crates/processing_pyo3 | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: wheels-sdist | |
| path: crates/processing_pyo3/dist | |
| ffi-linux: | |
| name: FFI Linux (x86_64) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: ./.github/actions/setup | |
| - name: Build FFI shared library | |
| run: cargo build --release -p processing_ffi --features wayland,x11 | |
| - name: Stage release files | |
| run: | | |
| mkdir -p staging/lib staging/include | |
| cp target/release/libprocessing.so staging/lib/ | |
| cp target/release/libprocessing.a staging/lib/ | |
| cp crates/processing_ffi/include/processing.h staging/include/ | |
| cp LICENSE.md staging/ | |
| tar -czvf libprocessing-${{ github.ref_name }}-linux-x86_64.tar.gz -C staging . | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: libprocessing-linux-x86_64 | |
| path: libprocessing-${{ github.ref_name }}-linux-x86_64.tar.gz | |
| ffi-macos: | |
| name: FFI macOS (aarch64) | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build FFI shared library | |
| run: cargo build --release -p processing_ffi | |
| - name: Stage release files | |
| run: | | |
| mkdir -p staging/lib staging/include | |
| cp target/release/libprocessing.dylib staging/lib/ | |
| cp target/release/libprocessing.a staging/lib/ | |
| cp crates/processing_ffi/include/processing.h staging/include/ | |
| cp LICENSE.md staging/ | |
| tar -czvf libprocessing-${{ github.ref_name }}-macos-aarch64.tar.gz -C staging . | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: libprocessing-macos-aarch64 | |
| path: libprocessing-${{ github.ref_name }}-macos-aarch64.tar.gz | |
| ffi-windows: | |
| name: FFI Windows (x64) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| submodules: true | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build FFI shared library | |
| run: cargo build --release -p processing_ffi | |
| - name: Stage release files | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path staging/lib, staging/include | Out-Null | |
| Copy-Item target/release/processing.dll staging/lib/ | |
| Copy-Item target/release/processing.dll.lib staging/lib/ | |
| Copy-Item target/release/processing.lib staging/lib/ | |
| Copy-Item crates/processing_ffi/include/processing.h staging/include/ | |
| Copy-Item LICENSE.md staging/ | |
| Compress-Archive -Path staging/* -DestinationPath libprocessing-${{ github.ref_name }}-windows-x64.zip | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: libprocessing-windows-x64 | |
| path: libprocessing-${{ github.ref_name }}-windows-x64.zip | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [linux, macos, windows, sdist] | |
| permissions: | |
| id-token: write | |
| environment: pypi | |
| steps: | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| github-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [ffi-linux, ffi-macos, ffi-windows, linux, macos, windows, sdist] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| pattern: libprocessing-* | |
| merge-multiple: true | |
| path: release-assets | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: release-assets | |
| - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2 | |
| with: | |
| files: release-assets/* | |
| generate_release_notes: true | |
| prerelease: ${{ contains(github.ref_name, '-') }} |