Skip to content
Closed
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
15 changes: 2 additions & 13 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,8 @@ jobs:
sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml
rm -f Cargo.toml.bak

- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable
target: ${{ matrix.architecture }}-${{ matrix.target-suffix }}

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
run: source ./bin/activate-hermit && cargo install cross --git https://github.com/cross-rs/cross

- name: Build CLI
env:
Expand All @@ -64,12 +58,7 @@ jobs:
RUST_BACKTRACE: 1
CROSS_VERBOSE: 1
run: |
# Install protoc if on macOS
if [ "${{ matrix.os }}" = "macos-latest" ]; then
brew install protobuf
export PROTOC=$(which protoc)
fi

source ./bin/activate-hermit
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
rustup target add "${TARGET}"
echo "Building for target: ${TARGET}"
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/bundle-desktop-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,16 @@ jobs:
# Update version in Cargo.toml
sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml
rm -f Cargo.toml.bak

# Update version in package.json

# Update version in package.json
source ./bin/activate-hermit
cd ui/desktop
npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version

- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable
targets: x86_64-apple-darwin

# Pre-build cleanup to ensure enough disk space
- name: Pre-build cleanup
run: |
source ./bin/activate-hermit
echo "Performing pre-build cleanup..."
# Clean npm cache
npm cache clean --force || true
Expand Down Expand Up @@ -137,7 +133,7 @@ jobs:

# Build specifically for Intel architecture
- name: Build goosed for Intel
run: cargo build --release -p goose-server --target x86_64-apple-darwin
run: source ./bin/activate-hermit && cargo build --release -p goose-server --target x86_64-apple-darwin

# Post-build cleanup to free space
- name: Post-build cleanup
Expand All @@ -164,13 +160,8 @@ jobs:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

- name: Set up Node.js
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # pin@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop

# Configure Electron builder for Intel architecture
Expand All @@ -187,6 +178,7 @@ jobs:
- name: Make Unsigned App
if: ${{ !inputs.signing }}
run: |
source ../../bin/activate-hermit
attempt=0
max_attempts=2
until [ $attempt -ge $max_attempts ]; do
Expand All @@ -204,6 +196,7 @@ jobs:
- name: Make Signed App
if: ${{ inputs.signing }}
run: |
source ../../bin/activate-hermit
attempt=0
max_attempts=2
until [ $attempt -ge $max_attempts ]; do
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/bundle-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ jobs:
sed -i.bak "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
rm -f Cargo.toml.bak

source ./bin/activate-hermit
# Update version in package.json
cd ui/desktop
npm version "${VERSION}" --no-git-tag-version --allow-same-version

# Pre-build cleanup to ensure enough disk space
- name: Pre-build cleanup
run: |
source ./bin/activate-hermit
echo "Performing pre-build cleanup..."
# Clean npm cache
npm cache clean --force || true
Expand All @@ -154,16 +156,6 @@ jobs:
# Check disk space after cleanup
df -h

- name: Install protobuf
run: |
brew install protobuf
echo "PROTOC=$(which protoc)" >> $GITHUB_ENV

- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable

- name: Cache Cargo registry
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
Expand All @@ -190,7 +182,7 @@ jobs:

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

# Post-build cleanup to free space
- name: Post-build cleanup
Expand All @@ -216,13 +208,8 @@ jobs:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

- name: Set up Node.js
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # pin@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop

# Check disk space before bundling
Expand All @@ -232,6 +219,7 @@ jobs:
- name: Make Unsigned App
if: ${{ !inputs.signing }}
run: |
source ../../bin/activate-hermit
attempt=0
max_attempts=2
until [ $attempt -ge $max_attempts ]; do
Expand All @@ -253,6 +241,7 @@ jobs:
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |

attempt=0
max_attempts=2
until [ $attempt -ge $max_attempts ]; do
Expand Down
27 changes: 6 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ jobs:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable

- name: Run cargo fmt
run: cargo fmt --check
run: source ./bin/activate-hermit && cargo fmt --check

rust-build-and-test:
name: Build and Test Rust Project
Expand Down Expand Up @@ -57,12 +52,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt update -y
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev protobuf-compiler

- name: Setup Rust
uses: dtolnay/rust-toolchain@38b70195107dddab2c7bbd522bcf763bac00963b # pin@stable
with:
toolchain: stable
sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev

- name: Cache Cargo Registry
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
Expand Down Expand Up @@ -91,7 +81,7 @@ jobs:
- name: Build and Test
run: |
gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar'
cargo test
source ../bin/activate-hermit && cargo test
working-directory: crates

# Add disk space cleanup before linting
Expand Down Expand Up @@ -120,7 +110,7 @@ jobs:
run: df -h

- name: Lint
run: cargo clippy -- -D warnings
run: source ./bin/activate-hermit && cargo clippy -- -D warnings

desktop-lint:
name: Lint Electron Desktop App
Expand All @@ -129,17 +119,12 @@ jobs:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4

- name: Set up Node.js
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # pin@v2
with:
node-version: "lts/*"

- name: Install Dependencies
run: npm ci
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop

- name: Run Lint
run: npm run lint:check
run: source ../../bin/activate-hermit && npm run lint:check
working-directory: ui/desktop

# Faster Desktop App build for PRs only
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ target/
./ui/desktop/out

# Hermit
/.hermit/
/bin/
.hermit/

debug_*.txt

Expand Down
42 changes: 0 additions & 42 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
# Configuration for cross-compiling using cross
[build.env]
passthrough = [
"PROTOC",
"RUST_LOG",
"RUST_BACKTRACE"
]

[target.aarch64-unknown-linux-gnu]
xargo = false
pre-build = [
# Add the ARM64 architecture and install necessary dependencies
"dpkg --add-architecture arm64",
"""\
apt-get update --fix-missing && apt-get install -y \
curl \
unzip \
pkg-config \
libssl-dev:arm64 \
libdbus-1-dev:arm64 \
libxcb1-dev:arm64
""",
"""\
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
unzip -o protoc-31.1-linux-x86_64.zip -d /usr/local && \
chmod +x /usr/local/bin/protoc && \
ln -sf /usr/local/bin/protoc /usr/bin/protoc && \
which protoc && \
protoc --version
"""
]

Expand All @@ -35,40 +18,15 @@ xargo = false
pre-build = [
"""\
apt-get update && apt-get install -y \
curl \
unzip \
pkg-config \
libssl-dev \
libdbus-1-dev \
libxcb1-dev
""",
"""\
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
unzip -o protoc-31.1-linux-x86_64.zip -d /usr/local && \
chmod +x /usr/local/bin/protoc && \
ln -sf /usr/local/bin/protoc /usr/bin/protoc && \
which protoc && \
protoc --version
"""
]
env = { "PROTOC" = "/usr/bin/protoc", "PATH" = "/usr/local/bin:${PATH}" }

[target.x86_64-pc-windows-gnu]
image = "dockcross/windows-static-x64:latest"
# Enable verbose output for Windows builds
build-std = true
env = { "RUST_LOG" = "debug", "RUST_BACKTRACE" = "1", "CROSS_VERBOSE" = "1" }
pre-build = [
"""\
apt-get update && apt-get install -y \
curl \
unzip
""",
"""\
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip && \
unzip protoc-31.1-linux-x86_64.zip -d /usr/local && \
chmod +x /usr/local/bin/protoc && \
export PROTOC=/usr/local/bin/protoc && \
protoc --version
"""
]
1 change: 1 addition & 0 deletions bin/.node-22.9.0.pkg
1 change: 1 addition & 0 deletions bin/.protoc-31.1.pkg
1 change: 1 addition & 0 deletions bin/.rustup-1.25.2.pkg
7 changes: 7 additions & 0 deletions bin/README.hermit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hermit environment

This is a [Hermit](https://github.com/cashapp/hermit) bin directory.

The symlinks in this directory are managed by Hermit and will automatically
download and install Hermit itself as well as packages. These packages are
local to this environment.
21 changes: 21 additions & 0 deletions bin/activate-hermit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# This file must be used with "source bin/activate-hermit" from bash or zsh.
# You cannot run it directly
#
# THIS FILE IS GENERATED; DO NOT MODIFY

if [ "${BASH_SOURCE-}" = "$0" ]; then
echo "You must source this script: \$ source $0" >&2
exit 33
fi

BIN_DIR="$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")"
if "${BIN_DIR}/hermit" noop > /dev/null; then
eval "$("${BIN_DIR}/hermit" activate "${BIN_DIR}/..")"

if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ]; then
hash -r 2>/dev/null
fi

echo "Hermit environment $("${HERMIT_ENV}"/bin/hermit env HERMIT_ENV) activated"
fi
24 changes: 24 additions & 0 deletions bin/activate-hermit.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env fish

# This file must be sourced with "source bin/activate-hermit.fish" from Fish shell.
# You cannot run it directly.
#
# THIS FILE IS GENERATED; DO NOT MODIFY

if status is-interactive
set BIN_DIR (dirname (status --current-filename))

if "$BIN_DIR/hermit" noop > /dev/null
# Source the activation script generated by Hermit
"$BIN_DIR/hermit" activate "$BIN_DIR/.." | source

# Clear the command cache if applicable
functions -c > /dev/null 2>&1

# Display activation message
echo "Hermit environment $($HERMIT_ENV/bin/hermit env HERMIT_ENV) activated"
end
else
echo "You must source this script: source $argv[0]" >&2
exit 33
end
1 change: 1 addition & 0 deletions bin/cargo
1 change: 1 addition & 0 deletions bin/cargo-clippy
1 change: 1 addition & 0 deletions bin/cargo-fmt
1 change: 1 addition & 0 deletions bin/cargo-miri
1 change: 1 addition & 0 deletions bin/clippy-driver
Loading
Loading