Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ jobs:
- name: Install cross
run: source ./bin/activate-hermit && cargo install cross --git https://github.com/cross-rs/cross

# Install Go for building temporal-service
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5
with:
go-version: '1.21'

- name: Build CLI
env:
CROSS_NO_WARNINGS: 0
Expand All @@ -77,9 +83,59 @@ jobs:
echo "Building with explicit PROTOC path..."
cross build --release --target ${TARGET} -p goose-cli -vv

# tar the goose binary as goose-<TARGET>.tar.bz2
cd target/${TARGET}/release
tar -cjf goose-${TARGET}.tar.bz2 goose
- name: Build temporal-service for target platform
run: |
source ./bin/activate-hermit
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"

# Set Go cross-compilation variables based on target
case "${TARGET}" in
"x86_64-unknown-linux-gnu")
export GOOS=linux
export GOARCH=amd64
BINARY_NAME="temporal-service"
;;
"aarch64-unknown-linux-gnu")
export GOOS=linux
export GOARCH=arm64
BINARY_NAME="temporal-service"
;;
"x86_64-apple-darwin")
export GOOS=darwin
export GOARCH=amd64
BINARY_NAME="temporal-service"
;;
"aarch64-apple-darwin")
export GOOS=darwin
export GOARCH=arm64
BINARY_NAME="temporal-service"
;;
*)
echo "Unsupported target: ${TARGET}"
exit 1
;;
esac

echo "Building temporal-service for ${GOOS}/${GOARCH}..."
cd temporal-service
go build -o "../target/${TARGET}/release/${BINARY_NAME}" main.go
echo "temporal-service built successfully for ${TARGET}"

- name: Package CLI with temporal-service
run: |
source ./bin/activate-hermit
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"

# Create a directory for the package contents
mkdir -p "target/${TARGET}/release/goose-package"

# Copy binaries
cp "target/${TARGET}/release/goose" "target/${TARGET}/release/goose-package/"
cp "target/${TARGET}/release/temporal-service" "target/${TARGET}/release/goose-package/"

# Create the tar archive with both 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

- name: Upload CLI artifact
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/bundle-desktop-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,34 @@ jobs:
restore-keys: |
${{ runner.os }}-intel-cargo-build-

# Install Go for building temporal-service
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5
with:
go-version: '1.21'

- name: Build goose-server for Intel macOS (x86_64)
run: |
source ./bin/activate-hermit
rustup target add x86_64-apple-darwin
cargo build --release -p goose-server --target x86_64-apple-darwin

# Build temporal-service
- name: Build temporal-service
run: |
echo "Building temporal-service..."
cd temporal-service
go build -o temporal-service main.go
chmod +x temporal-service
echo "temporal-service built successfully"

# Install and prepare temporal CLI
- name: Install temporal CLI via hermit
run: |
echo "Installing temporal CLI via hermit..."
./bin/hermit install temporal-cli
echo "temporal CLI installed successfully"

# Post-build cleanup to free space
- name: Post-build cleanup
run: |
Expand All @@ -158,8 +180,11 @@ jobs:
# Check disk space after cleanup
df -h

- name: Copy binary into Electron folder
run: cp target/x86_64-apple-darwin/release/goosed ui/desktop/src/bin/goosed
- name: Copy binaries into Electron folder
run: |
cp target/x86_64-apple-darwin/release/goosed ui/desktop/src/bin/goosed
cp temporal-service/temporal-service ui/desktop/src/bin/temporal-service
cp bin/temporal ui/desktop/src/bin/temporal

- name: Add MacOS certs for signing and notarization
if: ${{ inputs.signing }}
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/bundle-desktop-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ jobs:
cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && \
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/"

# 4.5) Build temporal-service for Windows
- name: Build temporal-service for Windows
run: |
echo "Building temporal-service for Windows..."
docker run --rm \
-v "$(pwd)":/usr/src/myapp \
-w /usr/src/myapp/temporal-service \
golang:latest \
sh -c "GOOS=windows GOARCH=amd64 go build -o temporal-service.exe main.go"
echo "temporal-service.exe built successfully"

# 4.6) Download temporal CLI for Windows
- name: Download temporal CLI for Windows
run: |
echo "Downloading temporal CLI for Windows..."
TEMPORAL_VERSION="1.3.0"
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 temporal-cli-windows.zip
chmod +x temporal.exe
echo "temporal CLI downloaded successfully"

# 5) Prepare Windows binary and DLLs
- name: Prepare Windows binary and DLLs
run: |
Expand All @@ -87,6 +108,16 @@ jobs:
exit 1
fi

if [ ! -f "./temporal-service/temporal-service.exe" ]; then
echo "temporal-service.exe not found."
exit 1
fi

if [ ! -f "./temporal.exe" ]; then
echo "temporal.exe not found."
exit 1
fi

echo "Cleaning destination directory..."
rm -rf ./ui/desktop/src/bin
mkdir -p ./ui/desktop/src/bin
Expand All @@ -95,6 +126,12 @@ jobs:
cp -f ./target/x86_64-pc-windows-gnu/release/goosed.exe ./ui/desktop/src/bin/
cp -f ./target/x86_64-pc-windows-gnu/release/*.dll ./ui/desktop/src/bin/

echo "Copying temporal-service.exe..."
cp -f ./temporal-service/temporal-service.exe ./ui/desktop/src/bin/

echo "Copying temporal.exe..."
cp -f ./temporal.exe ./ui/desktop/src/bin/

# Copy Windows platform files (tools, scripts, etc.)
if [ -d "./ui/desktop/src/platform/windows/bin" ]; then
echo "Copying Windows platform files..."
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/bundle-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,32 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-build-

# Install Go for building temporal-service
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # pin@v5
with:
go-version: '1.21'

# Build the project
- name: Build goosed
run: source ./bin/activate-hermit && cargo build --release -p goose-server

# Build temporal-service
- name: Build temporal-service
run: |
echo "Building temporal-service..."
cd temporal-service
go build -o temporal-service main.go
chmod +x temporal-service
echo "temporal-service built successfully"

# Install and prepare temporal CLI
- name: Install temporal CLI via hermit
run: |
echo "Installing temporal CLI via hermit..."
./bin/hermit install temporal-cli
echo "temporal CLI installed successfully"

# Post-build cleanup to free space
- name: Post-build cleanup
run: |
Expand All @@ -197,8 +219,11 @@ jobs:
# Check disk space after cleanup
df -h

- name: Copy binary into Electron folder
run: cp target/release/goosed ui/desktop/src/bin/goosed
- name: Copy binaries into Electron folder
run: |
cp target/release/goosed ui/desktop/src/bin/goosed
cp temporal-service/temporal-service ui/desktop/src/bin/temporal-service
cp bin/temporal ui/desktop/src/bin/temporal

- name: Add MacOS certs for signing and notarization
if: ${{ inputs.signing }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ benchmark-*
benchconf.json
scripts/fake.sh
do_not_version/
/ui/desktop/src/bin/temporal
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ copy-binary BUILD_MODE="release":
echo "Binary not found in target/{{BUILD_MODE}}"; \
exit 1; \
fi
@if [ -f ./temporal-service/temporal-service ]; then \
echo "Copying temporal-service binary..."; \
cp -p ./temporal-service/temporal-service ./ui/desktop/src/bin/; \
else \
echo "temporal-service binary not found. Building it..."; \
cd temporal-service && ./build.sh && cp -p temporal-service ../ui/desktop/src/bin/; \
fi
@./copy-temporal-binary.sh

# Copy binary command for Intel build
copy-binary-intel:
Expand All @@ -69,6 +77,14 @@ copy-binary-intel:
echo "Intel release binary not found."; \
exit 1; \
fi
@if [ -f ./temporal-service/temporal-service ]; then \
echo "Copying temporal-service binary..."; \
cp -p ./temporal-service/temporal-service ./ui/desktop/src/bin/; \
else \
echo "temporal-service binary not found. Building it..."; \
cd temporal-service && ./build.sh && cp -p temporal-service ../ui/desktop/src/bin/; \
fi
@./copy-temporal-binary.sh

# Copy Windows binary command
copy-binary-windows:
Expand All @@ -80,6 +96,14 @@ copy-binary-windows:
Write-Host 'Windows binary not found.' -ForegroundColor Red; \
exit 1; \
}"
@if [ -f ./temporal-service/temporal-service.exe ]; then \
echo "Copying Windows temporal-service binary..."; \
cp -p ./temporal-service/temporal-service.exe ./ui/desktop/src/bin/; \
else \
echo "Windows temporal-service binary not found. Building it..."; \
cd temporal-service && GOOS=windows GOARCH=amd64 go build -o temporal-service.exe main.go && cp temporal-service.exe ../ui/desktop/src/bin/; \
fi
@echo "Note: Temporal CLI for Windows will be downloaded at runtime if needed"

# Run UI with latest
run-ui:
Expand All @@ -93,10 +117,10 @@ run-ui-only:


# Run UI with alpha changes
run-ui-alpha:
run-ui-alpha temporal="true":
@just release-binary
@echo "Running UI..."
cd ui/desktop && npm install && ALPHA=true npm run start-alpha-gui
@echo "Running UI with {{ if temporal == "true" { "Temporal" } else { "Legacy" } }} scheduler..."
cd ui/desktop && npm install && ALPHA=true GOOSE_SCHEDULER_TYPE={{ if temporal == "true" { "temporal" } else { "legacy" } }} npm run start-alpha-gui

# Run UI with latest (Windows version)
run-ui-windows:
Expand Down Expand Up @@ -352,4 +376,4 @@ kotlin-example:
cd bindings/kotlin/ && java \
-Djna.library.path=$HOME/Development/goose/target/debug \
-classpath "example.jar:libs/kotlin-stdlib-1.9.0.jar:libs/kotlinx-coroutines-core-jvm-1.7.3.jar:libs/jna-5.13.0.jar" \
UsageKt
UsageKt
Loading
Loading