diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml new file mode 100644 index 0000000..fe49648 --- /dev/null +++ b/.github/workflows/lua.yml @@ -0,0 +1,88 @@ +name: lua + +on: + push: + branches: + - ci + - stable + +permissions: + contents: read + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + steps: + - uses: actions/checkout@v4 + - run: rustup update + - run: cargo build --release --features=lua + - uses: actions/upload-artifact@v4 + with: + name: codemp_native-lua-linux-${{ matrix.platform.target }}-gnu.so # will this rename???? + path: target/release/libcodemp.so + + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + steps: + - uses: actions/checkout@v4 + - run: cargo build --release --features=lua + - uses: actions/upload-artifact@v4 + with: + name: codemp_native-lua-linux-${{ matrix.platform.target }}-musl.so # will this rename???? + path: target/release/libcodemp.so + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 + steps: + - uses: actions/checkout@v4 + - run: cargo build --release --features=lua + - uses: actions/upload-artifact@v4 + with: + name: codemp_native-lua-windows-${{ matrix.platform.target }}.dll # will this rename???? + path: target/release/codemp.dll + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-12 + target: x64 + - runner: macos-14 + target: aarch64 + steps: + - uses: actions/checkout@v4 + - run: cargo build --release --features=lua + - uses: actions/upload-artifact@v4 + with: + name: codemp_native-lua-macos-${{ matrix.platform.target }}.dylib # will this rename???? + path: target/release/codemp.dylib diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..d56e45c --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,165 @@ +# This file is autogenerated by maturin v1.7.1 +# To update, run +# +# maturin generate-ci github +# +name: python + +on: + push: + branches: + - ci + - stable + +permissions: + contents: read + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + - runner: ubuntu-latest + target: s390x + - runner: ubuntu-latest + target: ppc64le + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist/py + sccache: 'true' + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist/py + + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist/py + sccache: 'true' + manylinux: musllinux_1_2 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-musllinux-${{ matrix.platform.target }} + path: dist/py + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + architecture: ${{ matrix.platform.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist/py + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist/py + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-12 + target: x86_64 + - runner: macos-14 + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist/py + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist/py + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist/py + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: dist/py + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, musllinux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v4 + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 79% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 58c8097..a13ac11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,19 @@ -name: build+test +name: test on: push: branches: + - ci - dev env: CARGO_TERM_COLOR: always +permissions: + contents: read + jobs: - build_and_test: - name: Rust project - latest + test: runs-on: ubuntu-latest strategy: fail-fast: false @@ -29,9 +32,6 @@ jobs: steps: - uses: arduino/setup-protoc@v2 - uses: actions/checkout@v3 - - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.ACTIONS_SSH_DEPLOY_KEY }} - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - run: cargo build --verbose --features=${{ matrix.features }} - run: cargo test --verbose --features=${{ matrix.features }} diff --git a/README.md b/README.md index fc44a02..38db108 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![codemp](https://code.mp/static/banner.png)](https://code.mp) -[![Actions Status](https://github.com/hexedtech/codemp/actions/workflows/ci.yml/badge.svg)](https://github.com/hexedtech/codemp/actions) +[![Actions Status](https://github.com/hexedtech/codemp/actions/workflows/test.yml/badge.svg)](https://github.com/hexedtech/codemp/actions) [![docs.rs](https://img.shields.io/docsrs/codemp)](https://docs.rs/codemp/0.7.0-beta.2/codemp/) [![Crates.io Version](https://img.shields.io/crates/v/codemp)](https://crates.io/crates/codemp) [![NPM Version](https://img.shields.io/npm/v/codemp)](https://npmjs.org/package/codemp)