From 17197c645fc66f3ba69239eecac554c01a55c7e8 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Thu, 2 Feb 2023 20:16:30 +0000 Subject: [PATCH 1/2] chore: run tests on linux, macos and windows and release builds on tag creation only (#370) --- .github/workflows/preview-deployments.yml | 128 ++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 .github/workflows/preview-deployments.yml diff --git a/.github/workflows/preview-deployments.yml b/.github/workflows/preview-deployments.yml new file mode 100644 index 000000000..855637d6b --- /dev/null +++ b/.github/workflows/preview-deployments.yml @@ -0,0 +1,128 @@ +# CI to release the project for Linux, Windows, and MacOS + +name: Upload Preview Packages + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + macos: + runs-on: macos-latest + strategy: + matrix: + python-version: ["3.7"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: aarch64-apple-darwin + profile: minimal + default: true + - name: Build wheels - x86_64 + uses: messense/maturin-action@v1 + with: + target: x86_64 + args: -i python --release --out dist + - name: Install build wheel - x86_64 + run: | + pip install --force-reinstall dist/robyn*.whl + cd ~ && python -c 'import robyn' + - name: Build wheels - universal2 + uses: messense/maturin-action@v1 + with: + args: -i python --release --universal2 --out dist --no-sdist + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + windows: + runs-on: windows-latest + strategy: + matrix: + python-version: ["3.7"] + target: [x64, x86] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.target }} + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + default: true + - name: Build wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: -i python --release --out dist --no-sdist + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + linux: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7"] + target: [x86_64, i686] + steps: + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + default: true + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build Wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: -i python${{ matrix.python-version }} --release --out dist --no-sdist + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + linux-cross: + runs-on: ubuntu-latest + strategy: + matrix: + python: [{ version: "3.7", abi: "cp37-cp37m" }] + target: [aarch64, armv7, s390x, ppc64le] + steps: + - uses: actions/checkout@v3 + - name: Build Wheels + uses: messense/maturin-action@v1 + env: + PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib + with: + target: ${{ matrix.target }} + manylinux: auto + args: -i python3.9 --release --out dist --no-sdist + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist From 6076bde24b667da5c7ffd1fa7733055568bad3b5 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Thu, 2 Feb 2023 20:09:55 +0000 Subject: [PATCH 2/2] chore: address the suggestions --- .github/workflows/preview-deployments.yml | 25 ++++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/preview-deployments.yml b/.github/workflows/preview-deployments.yml index 855637d6b..fd4ae5199 100644 --- a/.github/workflows/preview-deployments.yml +++ b/.github/workflows/preview-deployments.yml @@ -13,14 +13,11 @@ on: jobs: macos: runs-on: macos-latest - strategy: - matrix: - python-version: ["3.7"] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "3.7" - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -32,11 +29,7 @@ jobs: uses: messense/maturin-action@v1 with: target: x86_64 - args: -i python --release --out dist - - name: Install build wheel - x86_64 - run: | - pip install --force-reinstall dist/robyn*.whl - cd ~ && python -c 'import robyn' + args: -i python --release --out dist --no-sdist - name: Build wheels - universal2 uses: messense/maturin-action@v1 with: @@ -51,13 +44,12 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.7"] target: [x64, x86] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "3.7" architecture: ${{ matrix.target }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 @@ -69,7 +61,7 @@ jobs: uses: messense/maturin-action@v1 with: target: ${{ matrix.target }} - args: -i python --release --out dist --no-sdist + args: -i python3.7 --release --out dist --no-sdist - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -80,7 +72,6 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7"] target: [x86_64, i686] steps: - uses: actions/checkout@v3 @@ -92,13 +83,13 @@ jobs: default: true - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "3.7" - name: Build Wheels uses: messense/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: auto - args: -i python${{ matrix.python-version }} --release --out dist --no-sdist + args: -i python3.7 --out dist --no-sdist - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -109,7 +100,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [{ version: "3.7", abi: "cp37-cp37m" }] + python: [{ abi: "cp37-cp37m" }] target: [aarch64, armv7, s390x, ppc64le] steps: - uses: actions/checkout@v3 @@ -120,7 +111,7 @@ jobs: with: target: ${{ matrix.target }} manylinux: auto - args: -i python3.9 --release --out dist --no-sdist + args: -i python3.7 --release --out dist --no-sdist - name: Upload wheels uses: actions/upload-artifact@v3 with: