Update version to 1.9.0 (#527) #299
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: Build Package | |
on: | |
push: | |
branches: | |
- main | |
- "releases/*" | |
workflow_dispatch: {} | |
jobs: | |
build-bridge-libraries: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest] | |
include: | |
- os: ubuntu-latest | |
out-file: libtemporal_sdk_core_c_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_core_c_bridge.so | |
out-prefix: linux-arm64 | |
runsOn: ubuntu-24.04-arm64-2-core | |
# 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: alpine-latest | |
out-file: libtemporal_sdk_core_c_bridge.so | |
out-prefix: linux-musl-x64 | |
# Need Alpine container since GH runner doesn't have one | |
container: mcr.microsoft.com/dotnet/sdk:8.0-alpine | |
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip | |
runsOn: ubuntu-latest | |
- os: macos-intel | |
out-file: libtemporal_sdk_core_c_bridge.dylib | |
out-prefix: osx-x64 | |
runsOn: macos-13 | |
- os: macos-arm | |
out-file: libtemporal_sdk_core_c_bridge.dylib | |
out-prefix: osx-arm64 | |
runsOn: macos-14 | |
- os: windows-latest | |
out-file: temporal_sdk_core_c_bridge.dll | |
out-prefix: win-x64 | |
runs-on: ${{ matrix.runsOn || matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
if: ${{ !matrix.container }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Setup Rust cache | |
if: ${{ !matrix.container }} | |
# Fixed version due to https://github.com/Swatinem/rust-cache/issues/183#issuecomment-1893979126 | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: src/Temporalio/Bridge | |
key: ${{ matrix.os }} | |
- name: Install protoc | |
if: ${{ !matrix.container }} | |
uses: arduino/setup-protoc@v3 | |
with: | |
version: "23.x" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build (non-Docker) | |
if: ${{ !matrix.container }} | |
run: cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto | |
- name: Build (Docker non-Alpine) | |
if: ${{ matrix.container && matrix.os != 'alpine-latest' }} | |
run: | | |
docker run --rm -v "$(pwd):/workspace" -w /workspace \ | |
${{ matrix.container }} \ | |
sh -c ' \ | |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y \ | |
&& . $HOME/.cargo/env \ | |
&& curl -LO ${{ matrix.protobuf-url }} \ | |
&& unzip protoc-*.zip -d /usr/local/protobuf \ | |
&& export PATH="$PATH:/usr/local/protobuf/bin" \ | |
&& cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto \ | |
' | |
- name: Build (Docker Alpine) | |
if: ${{ matrix.container && matrix.os == 'alpine-latest' }} | |
run: | | |
docker run --rm -v "$(pwd):/workspace" -w /workspace \ | |
${{ matrix.container }} \ | |
sh -c ' \ | |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y \ | |
&& . $HOME/.cargo/env \ | |
&& apk add --no-cache build-base \ | |
&& curl -LO ${{ matrix.protobuf-url }} \ | |
&& unzip protoc-*.zip -d /usr/local/protobuf \ | |
&& export PATH="$PATH:/usr/local/protobuf/bin" \ | |
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto \ | |
' | |
- name: Upload bridge library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.out-prefix }}-bridge | |
path: src/Temporalio/Bridge/sdk-core/target/release-lto/${{ matrix.out-file }} | |
if-no-files-found: error | |
build-nuget-package: | |
needs: | |
- build-bridge-libraries | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download bridge libraries | |
uses: actions/download-artifact@v4 | |
with: | |
path: bridge-libraries | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- name: Build package | |
run: dotnet pack -c Release /p:BridgeLibraryRoot=${{ github.workspace }}/bridge-libraries | |
- name: Upload NuGet artifact | |
uses: actions/upload-artifact@v4 | |
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: false | |
matrix: | |
os: [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest] | |
include: | |
- os: ubuntu-arm | |
runsOn: ubuntu-24.04-arm64-2-core | |
- os: alpine-latest | |
container: mcr.microsoft.com/dotnet/sdk:6.0-alpine | |
runsOn: ubuntu-latest | |
- os: macos-intel | |
runsOn: macos-13 | |
- os: macos-arm | |
runsOn: macos-14 | |
runs-on: ${{ matrix.runsOn || matrix.os }} | |
container: ${{ matrix.container }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download NuGet artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-package | |
path: ${{ github.workspace }}/nuget-package | |
- name: Setup .NET (non-Alpine) | |
uses: actions/setup-dotnet@v4 | |
if: ${{ matrix.os != 'alpine-latest' }} | |
with: | |
# Specific .NET version required because GitHub macos ARM image has | |
# bad pre-installed .NET version | |
dotnet-version: 6.x | |
- name: Setup .NET (Alpine) | |
if: ${{ matrix.os == 'alpine-latest' }} | |
run: apk add dotnet6-sdk | |
- name: Run smoke test (non-Windows) | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$GITHUB_WORKSPACE/nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease | |
dotnet run --project tests/Temporalio.SmokeTest | |
- name: Run smoke test (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$env:GITHUB_WORKSPACE/nuget-package/Temporalio/bin/Release;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@v2 | |
- name: Run .NET framework smoke test (Windows only) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "$env:GITHUB_WORKSPACE/nuget-package/Temporalio/bin/Release;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 |