mirror of
https://github.com/aljazceru/goose.git
synced 2026-01-04 15:04:21 +01:00
add temporal service to builds. (#2842)
This commit is contained in:
62
.github/workflows/build-cli.yml
vendored
62
.github/workflows/build-cli.yml
vendored
@@ -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
|
||||
@@ -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
|
||||
|
||||
29
.github/workflows/bundle-desktop-intel.yml
vendored
29
.github/workflows/bundle-desktop-intel.yml
vendored
@@ -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: |
|
||||
@@ -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 }}
|
||||
|
||||
37
.github/workflows/bundle-desktop-windows.yml
vendored
37
.github/workflows/bundle-desktop-windows.yml
vendored
@@ -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: |
|
||||
@@ -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
|
||||
@@ -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..."
|
||||
|
||||
29
.github/workflows/bundle-desktop.yml
vendored
29
.github/workflows/bundle-desktop.yml
vendored
@@ -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: |
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user