Update README.md to remove note about DI issue (#152) #90
This file contains 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 Package | |
on: | |
push: | |
branches: | |
- main | |
- "releases/*" | |
jobs: | |
build-bridge-libraries: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, ubuntu-arm, macos-latest, macos-arm, windows-latest] | |
include: | |
- os: ubuntu-latest | |
out-file: libtemporal_sdk_bridge.so | |
out-prefix: linux-x64 | |
# We use the Python manylinux image for glibc compatibility | |
container: quay.io/pypa/manylinux2014_x86_64 | |
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip | |
- os: ubuntu-arm | |
out-file: libtemporal_sdk_bridge.so | |
out-prefix: linux-arm64 | |
runsOn: buildjet-4vcpu-ubuntu-2204-arm | |
# We use the Python manylinux image for glibc compatibility | |
container: quay.io/pypa/manylinux2014_aarch64 | |
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-aarch_64.zip | |
- os: macos-latest | |
out-file: libtemporal_sdk_bridge.dylib | |
out-prefix: osx-x64 | |
- os: macos-arm | |
out-file: libtemporal_sdk_bridge.dylib | |
out-prefix: osx-arm64 | |
alternative-target: aarch64-apple-darwin | |
runsOn: macos-latest | |
- os: windows-latest | |
out-file: temporal_sdk_bridge.dll | |
out-prefix: win-x64 | |
runs-on: ${{ matrix.runsOn || matrix.os }} | |
container: ${{ matrix.container }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: src/Temporalio/Bridge | |
key: ${{ matrix.os }} | |
- name: Add alternative Rust target | |
if: ${{ matrix.alternative-target }} | |
run: rustup target add ${{ matrix.alternative-target }} | |
- name: Install protoc (non-Linux) | |
# Does not work on Linux | |
if: ${{ matrix.os != 'ubuntu-latest' && matrix.os != 'ubuntu-arm' }} | |
uses: arduino/setup-protoc@v1 | |
with: | |
# TODO(cretz): Upgrade when https://github.com/arduino/setup-protoc/issues/33 fixed | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install protoc (Linux) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-arm' }} | |
run: | | |
curl --location -o protobuf-compiler.zip ${{ matrix.protobuf-url }} | |
mkdir protobuf-compiler | |
unzip protobuf-compiler.zip -d protobuf-compiler | |
echo $(realpath .)/protobuf-compiler/bin >> $GITHUB_PATH | |
- name: Build | |
if: ${{ !matrix.alternative-target }} | |
run: cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release | |
- name: Build alternative target | |
if: ${{ matrix.alternative-target != '' }} | |
run: cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release --target ${{ matrix.alternative-target }} | |
- name: Upload bridge library | |
if: ${{ !matrix.alternative-target }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.out-prefix }}-bridge | |
path: src/Temporalio/Bridge/target/release/${{ matrix.out-file }} | |
- name: Upload bridge library alternative target | |
if: ${{ matrix.alternative-target != '' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.out-prefix }}-bridge | |
path: src/Temporalio/Bridge/target/${{ matrix.alternative-target }}/release/${{ matrix.out-file }} | |
build-nuget-package: | |
needs: | |
- build-bridge-libraries | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Download bridge libraries | |
uses: actions/download-artifact@v3 | |
with: | |
path: bridge-libraries | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
- name: Build package | |
run: dotnet pack -c Release /p:BridgeLibraryRoot=${{ github.workspace }}/bridge-libraries | |
- name: Upload NuGet artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nuget-package | |
path: | | |
src/Temporalio/bin/Release/*.nupkg | |
src/Temporalio/bin/Release/*.snupkg | |
src/Temporalio.Extensions.DiagnosticSource/bin/Release/*.nupkg | |
src/Temporalio.Extensions.DiagnosticSource/bin/Release/*.snupkg | |
src/Temporalio.Extensions.Hosting/bin/Release/*.nupkg | |
src/Temporalio.Extensions.Hosting/bin/Release/*.snupkg | |
src/Temporalio.Extensions.OpenTelemetry/bin/Release/*.nupkg | |
src/Temporalio.Extensions.OpenTelemetry/bin/Release/*.snupkg | |
run-smoke-test: | |
needs: | |
- build-nuget-package | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, ubuntu-arm, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-arm | |
runsOn: buildjet-4vcpu-ubuntu-2204-arm | |
runs-on: ${{ matrix.runsOn || matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Download NuGet artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: nuget-package | |
path: nuget-package | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
- name: Run smoke test | |
run: | | |
dotnet add tests/Temporalio.SmokeTest package Temporalio -s "${{ github.workspace }}/nuget-package;https://api.nuget.org/v3/index.json" --prerelease | |
dotnet run --project tests/Temporalio.SmokeTest | |
- name: Setup msbuild (Windows only) | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Run .NET framework smoke test (Windows only) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "${{ github.workspace }}/nuget-package;https://api.nuget.org/v3/index.json" --prerelease | |
msbuild tests/Temporalio.SmokeTestDotNetFramework -t:restore,build -p:Platform=x64 | |
tests/Temporalio.SmokeTestDotNetFramework/bin/x64/Debug/Temporalio.SmokeTestDotNetFramework.exe |