1
1
name : Build Package
2
2
on :
3
+ pull_request :
3
4
push :
4
5
branches :
5
6
- main
10
11
strategy :
11
12
fail-fast : false
12
13
matrix :
13
- os : [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
14
+ os : [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
14
15
include :
15
16
- os : ubuntu-latest
16
17
out-file : libtemporal_sdk_bridge.so
25
26
# We use the Python manylinux image for glibc compatibility
26
27
container : quay.io/pypa/manylinux2014_aarch64
27
28
protobuf-url : https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-aarch_64.zip
29
+ - os : alpine-latest
30
+ out-file : libtemporal_sdk_bridge.so
31
+ out-prefix : linux-musl-x64
32
+ # Need Alpine container since GH runner doesn't have one
33
+ container : mcr.microsoft.com/dotnet/sdk:8.0-alpine
34
+ protobuf-url : https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
35
+ runsOn : ubuntu-latest
28
36
- os : macos-intel
29
37
out-file : libtemporal_sdk_bridge.dylib
30
38
out-prefix : osx-x64
68
76
if : ${{ !matrix.container }}
69
77
run : cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release
70
78
71
- - name : Build (Docker)
72
- if : ${{ matrix.container }}
79
+ - name : Build (Docker non-Alpine )
80
+ if : ${{ matrix.container && matrix.os != 'alpine-latest' }}
73
81
run : |
74
82
docker run --rm -v "$(pwd):/workspace" -w /workspace \
75
83
${{ matrix.container }} \
@@ -82,11 +90,27 @@ jobs:
82
90
&& cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
83
91
'
84
92
93
+ - name : Build (Docker Alpine)
94
+ if : ${{ matrix.container && matrix.os == 'alpine-latest' }}
95
+ run : |
96
+ docker run --rm -v "$(pwd):/workspace" -w /workspace \
97
+ ${{ matrix.container }} \
98
+ sh -c ' \
99
+ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y \
100
+ && . $HOME/.cargo/env \
101
+ && apk add --no-cache build-base \
102
+ && curl -LO ${{ matrix.protobuf-url }} \
103
+ && unzip protoc-*.zip -d /usr/local/protobuf \
104
+ && export PATH="$PATH:/usr/local/protobuf/bin" \
105
+ && RUSTFLAGS="-C target-feature=-crt-static" cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
106
+ '
107
+
85
108
- name : Upload bridge library
86
109
uses : actions/upload-artifact@v4
87
110
with :
88
111
name : ${{ matrix.out-prefix }}-bridge
89
112
path : src/Temporalio/Bridge/target/release/${{ matrix.out-file }}
113
+ if-no-files-found : error
90
114
91
115
build-nuget-package :
92
116
needs :
@@ -129,15 +153,19 @@ jobs:
129
153
strategy :
130
154
fail-fast : false
131
155
matrix :
132
- os : [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
156
+ os : [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
133
157
include :
134
158
- os : ubuntu-arm
135
159
runsOn : buildjet-4vcpu-ubuntu-2204-arm
160
+ - os : alpine-latest
161
+ container : mcr.microsoft.com/dotnet/sdk:8.0-alpine
162
+ runsOn : ubuntu-latest
136
163
- os : macos-intel
137
164
runsOn : macos-13
138
165
- os : macos-arm
139
166
runsOn : macos-14
140
167
runs-on : ${{ matrix.runsOn || matrix.os }}
168
+ container : ${{ matrix.container }}
141
169
steps :
142
170
- name : Checkout repository
143
171
uses : actions/checkout@v4
@@ -148,7 +176,7 @@ jobs:
148
176
uses : actions/download-artifact@v4
149
177
with :
150
178
name : nuget-package
151
- path : nuget-package
179
+ path : ${{ github.workspace }}/ nuget-package
152
180
153
181
- name : Setup .NET
154
182
uses : actions/setup-dotnet@v4
@@ -157,9 +185,16 @@ jobs:
157
185
# bad pre-installed .NET version
158
186
dotnet-version : 6.x
159
187
160
- - name : Run smoke test
188
+ - name : Run smoke test (non-Windows)
189
+ if : ${{ matrix.os != 'windows-latest' }}
190
+ run : |
191
+ dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$GITHUB_WORKSPACE/nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
192
+ dotnet run --project tests/Temporalio.SmokeTest
193
+
194
+ - name : Run smoke test (Windows)
195
+ if : ${{ matrix.os == 'windows-latest' }}
161
196
run : |
162
- dotnet add tests/Temporalio.SmokeTest package Temporalio -s "${{ github.workspace }} /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
197
+ dotnet add tests/Temporalio.SmokeTest package Temporalio -s "$env:GITHUB_WORKSPACE /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
163
198
dotnet run --project tests/Temporalio.SmokeTest
164
199
165
200
- name : Setup msbuild (Windows only)
@@ -169,6 +204,6 @@ jobs:
169
204
- name : Run .NET framework smoke test (Windows only)
170
205
if : ${{ matrix.os == 'windows-latest' }}
171
206
run : |
172
- dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "${{ github.workspace }} /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
207
+ dotnet add tests/Temporalio.SmokeTestDotNetFramework package Temporalio -s "$env:GITHUB_WORKSPACE /nuget-package/Temporalio/bin/Release;https://api.nuget.org/v3/index.json" --prerelease
173
208
msbuild tests/Temporalio.SmokeTestDotNetFramework -t:restore,build -p:Platform=x64
174
209
tests/Temporalio.SmokeTestDotNetFramework/bin/x64/Debug/Temporalio.SmokeTestDotNetFramework.exe
0 commit comments