Skip to content

Commit ebe6762

Browse files
committed
Use cibuildwheel and update grpcio
1 parent 25caaf0 commit ebe6762

File tree

5 files changed

+281
-174
lines changed

5 files changed

+281
-174
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,38 +77,76 @@ jobs:
7777
# Compile the binaries and upload artifacts
7878
compile-binaries:
7979
strategy:
80-
fail-fast: true
80+
fail-fast: false
8181
matrix:
8282
include:
8383
- os: ubuntu-latest
8484
package-suffix: linux-amd64
85+
ci-arch: auto
86+
- os: ubuntu-latest
87+
package-suffix: linux-aarch64
88+
ci-arch: aarch64
8589
- os: macos-latest
8690
package-suffix: macos-amd64
91+
ci-arch: auto
92+
- os: macos-latest
93+
package-suffix: macos-arm64
94+
ci-arch: arm64
95+
rust-add-target: aarch64-apple-darwin
8796
- os: windows-latest
8897
package-suffix: windows-amd64
98+
ci-arch: auto
8999
runs-on: ${{ matrix.os }}
100+
continue-on-error: true
90101
steps:
91102
- uses: actions/checkout@v2
92103
with:
93104
submodules: recursive
94-
- uses: actions-rs/toolchain@v1
105+
- uses: actions/setup-python@v1
106+
with:
107+
python-version: "3.10"
108+
109+
# Install Rust locally for non-Linux (Linux uses an internal docker
110+
# command to build with cibuildwheel which uses rustup install defined
111+
# in pyproject.toml)
112+
- if: ${{ runner.os != 'Linux' }}
113+
uses: actions-rs/toolchain@v1
95114
with:
96115
toolchain: stable
97-
- uses: Swatinem/rust-cache@v1
116+
target: ${{ matrix.rust-add-target }}
117+
- if: ${{ runner.os != 'Linux' }}
118+
uses: Swatinem/rust-cache@v1
98119
with:
99120
working-directory: temporalio/bridge
100-
- uses: actions/setup-python@v1
101-
with:
102-
python-version: "3.10"
103-
# Needed for tests since they use external server
104-
- uses: actions/setup-go@v2
121+
122+
# Need QEMU for ARM build on Linux
123+
- if: ${{ matrix.package-suffix == 'linux-aarch64' }}
124+
uses: docker/setup-qemu-action@v1
105125
with:
106-
go-version: "1.18"
126+
image: tonistiigi/binfmt:latest
127+
platforms: arm64
128+
129+
# Prepare
107130
- run: python -m pip install --upgrade wheel poetry poethepoet
108131
- run: poetry install --no-root
109-
- run: poetry build
132+
133+
# Add the source dist only for Linux x64 for now
134+
- if: ${{ matrix.package-suffix == 'linux-amd64' }}
135+
run: poetry build --format sdist
136+
137+
# Build and fix the wheel
138+
- run: poetry run cibuildwheel --output-dir dist --arch ${{ matrix.ci-arch }}
110139
- run: poe fix-wheel
111-
- run: poe test-dist-single
140+
141+
# Do test only for ci-arch auto (i.e. local machine)
142+
- if: ${{ matrix.ci-arch == 'auto' }}
143+
uses: actions/setup-go@v2
144+
with:
145+
go-version: "1.18"
146+
- if: ${{ matrix.ci-arch == 'auto' }}
147+
run: poe test-dist-single
148+
149+
# Upload dist
112150
- uses: actions/upload-artifact@v2
113151
with:
114152
name: packages-${{ matrix.package-suffix }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ These steps can be followed to use with a virtual environment and `pip`:
5757

5858
For macOS M1 users on Python 3.10+, due to an
5959
[improperly named wheel in PyPI for gRPC](https://github.com/grpc/grpc/issues/28387), you may have to run
60-
`pip install --no-binary :all: grpcio --ignore-installed` in your environment before use.
60+
`pip install --no-binary :all: grpcio --ignore-installed` in your environment before use. (this is fixed in the next
61+
version of `temporalio` and in the `main` branch)
6162

6263
The SDK is now ready for use. To build from source, see "Building" near the end of this documentation.
6364

0 commit comments

Comments
 (0)