4040 target-suffix : unknown-linux-gnu
4141 build-on : ubuntu-latest
4242 use-cross : true
43+ - os : ubuntu-latest
44+ architecture : x86_64
45+ target-suffix : unknown-linux-musl
46+ build-on : ubuntu-latest
47+ use-cross : false
4348 # macOS builds
4449 - os : macos-latest
4550 architecture : x86_64
8489
8590 # Cache Cargo registry and git dependencies for Windows builds
8691 - name : Cache Cargo registry (Windows)
92+ - name : Build CLI (Linux MUSL)
93+ if : matrix.architecture == 'x86_64' && matrix.target-suffix == 'unknown-linux-musl' && !matrix.use-cross
94+ env :
95+ RUST_LOG : debug
96+ RUST_BACKTRACE : 1
97+ run : |
98+ source ./bin/activate-hermit
99+ export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
100+ rustup target add "${TARGET}"
101+ echo "Building for target: ${TARGET}"
102+ echo "Rust toolchain info:"
103+ rustup show
104+ echo "Building with explicit PROTOC path..."
105+ cargo build --release --target ${TARGET} -p goose-cli -vv
106+
107+
87108 if : matrix.use-docker
88109 uses : actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f
89110 with :
@@ -168,6 +189,22 @@ jobs:
168189 export PROTOC=/usr/bin/protoc
169190
170191 echo '=== Optimized Cargo configuration ==='
192+ - name : Build temporal-service for Linux MUSL
193+ if : matrix.architecture == 'x86_64' && matrix.target-suffix == 'unknown-linux-musl' && !matrix.use-cross
194+ run : |
195+ source ./bin/activate-hermit
196+ export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
197+ export GOOS=linux
198+ export GOARCH=amd64
199+ BINARY_NAME="temporal-service"
200+
201+ echo "Building temporal-service for ${GOOS}/${GOARCH} using build.sh script..."
202+ cd temporal-service
203+ GOOS="${GOOS}" GOARCH="${GOARCH}" ./build.sh
204+ mv "${BINARY_NAME}" "../target/${TARGET}/release/${BINARY_NAME}"
205+ echo "temporal-service built successfully for ${TARGET}"
206+
207+
171208 mkdir -p .cargo
172209 echo '[build]' > .cargo/config.toml
173210 echo 'jobs = 4' >> .cargo/config.toml
@@ -238,6 +275,27 @@ jobs:
238275 # Set Go cross-compilation variables based on target
239276 case "${TARGET}" in
240277 "x86_64-unknown-linux-gnu")
278+ - name : Download temporal CLI (Linux MUSL)
279+ if : matrix.architecture == 'x86_64' && matrix.target-suffix == 'unknown-linux-musl' && !matrix.use-cross
280+ run : |
281+ export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
282+ TEMPORAL_VERSION="1.3.0"
283+ TEMPORAL_OS="linux"
284+ TEMPORAL_ARCH="amd64"
285+ TEMPORAL_EXT=""
286+
287+ echo "Downloading temporal CLI for ${TEMPORAL_OS}/${TEMPORAL_ARCH}..."
288+ TEMPORAL_FILE="temporal_cli_${TEMPORAL_VERSION}_${TEMPORAL_OS}_${TEMPORAL_ARCH}.tar.gz"
289+ curl -L "https://github.com/temporalio/cli/releases/download/v${TEMPORAL_VERSION}/${TEMPORAL_FILE}" -o "${TEMPORAL_FILE}"
290+
291+ tar -xzf "${TEMPORAL_FILE}"
292+ chmod +x temporal${TEMPORAL_EXT}
293+
294+ mv temporal${TEMPORAL_EXT} "target/${TARGET}/release/temporal${TEMPORAL_EXT}"
295+ rm -f "${TEMPORAL_FILE}"
296+ echo "temporal CLI downloaded successfully for ${TARGET}"
297+
298+
241299 export GOOS=linux
242300 export GOARCH=amd64
243301 BINARY_NAME="temporal-service"
@@ -247,6 +305,11 @@ jobs:
247305 export GOARCH=arm64
248306 BINARY_NAME="temporal-service"
249307 ;;
308+ "x86_64-unknown-linux-musl")
309+ export GOOS=linux
310+ export GOARCH=amd64
311+ BINARY_NAME="temporal-service"
312+ ;;
250313 "x86_64-apple-darwin")
251314 export GOOS=darwin
252315 export GOARCH=amd64
@@ -312,6 +375,11 @@ jobs:
312375 TEMPORAL_ARCH="arm64"
313376 TEMPORAL_EXT=""
314377 ;;
378+ "x86_64-unknown-linux-musl")
379+ TEMPORAL_OS="linux"
380+ TEMPORAL_ARCH="amd64"
381+ TEMPORAL_EXT=""
382+ ;;
315383 "x86_64-apple-darwin")
316384 TEMPORAL_OS="darwin"
317385 TEMPORAL_ARCH="amd64"
@@ -363,7 +431,7 @@ jobs:
363431 echo "temporal CLI downloaded successfully for Windows"
364432
365433 - name : Package CLI with temporal-service (Linux/macOS)
366- if : matrix.use-cross
434+ if : matrix.use-cross || (matrix.architecture == 'x86_64' && matrix.target-suffix == 'unknown-linux-musl' && !matrix.use-cross)
367435 run : |
368436 source ./bin/activate-hermit
369437 export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
0 commit comments