diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index dda1e9e7..75acc485 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -206,6 +206,12 @@ jobs: RUST_BACKTRACE=1 \ cargo build --release --target x86_64-pc-windows-gnu -p goose-cli --jobs 4 + echo '=== Copying Windows runtime DLLs ===' + GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) + cp \"\$GCC_DIR/libstdc++-6.dll\" target/x86_64-pc-windows-gnu/release/ + cp \"\$GCC_DIR/libgcc_s_seh-1.dll\" target/x86_64-pc-windows-gnu/release/ + cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll target/x86_64-pc-windows-gnu/release/ + echo '✅ Build completed successfully!' ls -la target/x86_64-pc-windows-gnu/release/ " @@ -219,6 +225,9 @@ jobs: echo "✅ Windows CLI binary found!" ls -la ./target/x86_64-pc-windows-gnu/release/goose.exe + + echo "✅ Windows runtime DLLs:" + ls -la ./target/x86_64-pc-windows-gnu/release/*.dll - name: Build temporal-service for target platform using build.sh script (Linux/macOS) if: matrix.use-cross @@ -282,6 +291,71 @@ jobs: mv temporal-service/temporal-service.exe target/x86_64-pc-windows-gnu/release/temporal-service.exe echo "temporal-service.exe built successfully for Windows" + - name: Download temporal CLI (Linux/macOS) + if: matrix.use-cross + run: | + export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}" + TEMPORAL_VERSION="1.3.0" + + # Set platform-specific download parameters + case "${TARGET}" in + "x86_64-unknown-linux-gnu") + TEMPORAL_OS="linux" + TEMPORAL_ARCH="amd64" + TEMPORAL_EXT="" + ;; + "aarch64-unknown-linux-gnu") + TEMPORAL_OS="linux" + TEMPORAL_ARCH="arm64" + TEMPORAL_EXT="" + ;; + "x86_64-apple-darwin") + TEMPORAL_OS="darwin" + TEMPORAL_ARCH="amd64" + TEMPORAL_EXT="" + ;; + "aarch64-apple-darwin") + TEMPORAL_OS="darwin" + TEMPORAL_ARCH="arm64" + TEMPORAL_EXT="" + ;; + *) + echo "Unsupported target for temporal CLI: ${TARGET}" + exit 1 + ;; + esac + + echo "Downloading temporal CLI for ${TEMPORAL_OS}/${TEMPORAL_ARCH}..." + TEMPORAL_FILE="temporal_cli_${TEMPORAL_VERSION}_${TEMPORAL_OS}_${TEMPORAL_ARCH}.tar.gz" + curl -L "https://github.com/temporalio/cli/releases/download/v${TEMPORAL_VERSION}/${TEMPORAL_FILE}" -o "${TEMPORAL_FILE}" + + # Extract temporal CLI + tar -xzf "${TEMPORAL_FILE}" + chmod +x temporal${TEMPORAL_EXT} + + # Move to target directory + mv temporal${TEMPORAL_EXT} "target/${TARGET}/release/temporal${TEMPORAL_EXT}" + + # Clean up + rm -f "${TEMPORAL_FILE}" + echo "temporal CLI downloaded successfully for ${TARGET}" + + - name: Download temporal CLI (Windows) + if: matrix.use-docker + run: | + TEMPORAL_VERSION="1.3.0" + echo "Downloading temporal CLI for Windows..." + curl -L "https://github.com/temporalio/cli/releases/download/v${TEMPORAL_VERSION}/temporal_cli_${TEMPORAL_VERSION}_windows_amd64.zip" -o temporal-cli-windows.zip + unzip -o temporal-cli-windows.zip + chmod +x temporal.exe + + # Move to target directory + mv temporal.exe target/x86_64-pc-windows-gnu/release/temporal.exe + + # Clean up + rm -f temporal-cli-windows.zip + echo "temporal CLI downloaded successfully for Windows" + - name: Package CLI with temporal-service (Linux/macOS) if: matrix.use-cross run: | @@ -294,8 +368,9 @@ jobs: # Copy binaries cp "target/${TARGET}/release/goose" "target/${TARGET}/release/goose-package/" cp "target/${TARGET}/release/temporal-service" "target/${TARGET}/release/goose-package/" + cp "target/${TARGET}/release/temporal" "target/${TARGET}/release/goose-package/" - # Create the tar archive with both binaries + # Create the tar archive with all binaries cd "target/${TARGET}/release" tar -cjf "goose-${TARGET}.tar.bz2" -C goose-package . echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV @@ -311,8 +386,12 @@ jobs: # Copy binaries cp "target/${TARGET}/release/goose.exe" "target/${TARGET}/release/goose-package/" cp "target/${TARGET}/release/temporal-service.exe" "target/${TARGET}/release/goose-package/" + cp "target/${TARGET}/release/temporal.exe" "target/${TARGET}/release/goose-package/" - # Create the zip archive with both binaries (Windows uses zip instead of tar.bz2) + # Copy Windows runtime DLLs + cp "target/${TARGET}/release/"*.dll "target/${TARGET}/release/goose-package/" + + # Create the zip archive with all binaries and DLLs cd "target/${TARGET}/release" zip -r "goose-${TARGET}.zip" goose-package/ echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.zip" >> $GITHUB_ENV diff --git a/download_cli.sh b/download_cli.sh index aac68c67..3761971c 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -168,19 +168,41 @@ else mv "$TMP_DIR/goose" "$GOOSE_BIN_DIR/$OUT_FILE" fi -# Also move temporal-service if it exists (for scheduling functionality) +# Also move temporal-service and temporal CLI if they exist if [ "$OS" = "windows" ]; then if [ -f "$TMP_DIR/temporal-service.exe" ]; then echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service.exe" mv "$TMP_DIR/temporal-service.exe" "$GOOSE_BIN_DIR/temporal-service.exe" chmod +x "$GOOSE_BIN_DIR/temporal-service.exe" fi + + # Move temporal CLI if it exists + if [ -f "$TMP_DIR/temporal.exe" ]; then + echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal.exe" + mv "$TMP_DIR/temporal.exe" "$GOOSE_BIN_DIR/temporal.exe" + chmod +x "$GOOSE_BIN_DIR/temporal.exe" + fi + + # Copy Windows runtime DLLs if they exist + for dll in "$TMP_DIR"/*.dll; do + if [ -f "$dll" ]; then + echo "Moving Windows runtime DLL: $(basename "$dll")" + mv "$dll" "$GOOSE_BIN_DIR/" + fi + done else if [ -f "$TMP_DIR/temporal-service" ]; then echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service" mv "$TMP_DIR/temporal-service" "$GOOSE_BIN_DIR/temporal-service" chmod +x "$GOOSE_BIN_DIR/temporal-service" fi + + # Move temporal CLI if it exists + if [ -f "$TMP_DIR/temporal" ]; then + echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal" + mv "$TMP_DIR/temporal" "$GOOSE_BIN_DIR/temporal" + chmod +x "$GOOSE_BIN_DIR/temporal" + fi fi # skip configuration for non-interactive installs e.g. automation, docker