diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4cce94ae8..b5cc91252 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -91,9 +91,8 @@ RUN /home/node/.local/bin/mise trust /workspace && /home/node/.local/bin/mise in # Install global npm packages RUN npm i -g opencode-ai @openai/codex opencommit @google/gemini-cli -# Install Bun with smol mode to reduce memory usage +# Enable smol mode in Bun to reduce memory usage RUN echo 'smol = true' > /home/node/bunfig.toml -RUN curl -fsSL https://bun.sh/install | bash # Aliases RUN echo "alias claude=\"claude --dangerously-skip-permissions\"" >> "/home/node/.zshrc" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ade884f79..dbb93a619 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [main] +permissions: + contents: read # Required for checking out code + jobs: quality: name: Code Quality & Tests diff --git a/.github/workflows/e2e-binaries.yml b/.github/workflows/e2e-binaries.yml new file mode 100644 index 000000000..188ee3aca --- /dev/null +++ b/.github/workflows/e2e-binaries.yml @@ -0,0 +1,81 @@ +name: E2E Tests on Cross-Platform + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read # Required for checking out code + +jobs: + build: + name: Build binaries + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.2 + + - name: Install dependencies + run: bun install --ignore-scripts + + - name: Build binaries + run: | + mkdir -p dist-bun + # Linux + bun build --compile --minify --sourcemap --target=bun-linux-x64 src/cli/index.ts --outfile dist-bun/rulesync-linux-x64 + bun build --compile --minify --sourcemap --target=bun-linux-arm64 src/cli/index.ts --outfile dist-bun/rulesync-linux-arm64 + # macOS + bun build --compile --minify --sourcemap --target=bun-darwin-x64 src/cli/index.ts --outfile dist-bun/rulesync-darwin-x64 + bun build --compile --minify --sourcemap --target=bun-darwin-arm64 src/cli/index.ts --outfile dist-bun/rulesync-darwin-arm64 + + - name: Cache binaries + uses: actions/cache/save@v4 + with: + path: dist-bun + key: rulesync-binaries-${{ github.sha }} + enableCrossOsArchive: true + + e2e: + name: E2E Test (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + needs: build + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Restore cached binaries + uses: actions/cache/restore@v4 + with: + path: dist-bun + key: rulesync-binaries-${{ github.sha }} + enableCrossOsArchive: true + fail-on-cache-miss: true + + - name: Make binary executable + env: + MATRIX_OS: ${{ matrix.os }} + run: | + if [ "$MATRIX_OS" = "ubuntu-latest" ]; then + chmod +x dist-bun/rulesync-linux-x64 + BINARY_PATH=dist-bun/rulesync-linux-x64 + else + chmod +x dist-bun/rulesync-darwin-arm64 + BINARY_PATH=dist-bun/rulesync-darwin-arm64 + fi + echo "BINARY_PATH=$BINARY_PATH" >> $GITHUB_ENV + + - name: Test binary version + run: | + "${BINARY_PATH}" --version diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml new file mode 100644 index 000000000..a79843d0e --- /dev/null +++ b/.github/workflows/release-binaries.yml @@ -0,0 +1,53 @@ +name: Release Binaries + +on: + release: + types: [created] + +permissions: + contents: write # Required for uploading release assets + +jobs: + build-binaries: + name: Build and upload binaries + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + ref: main + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.2 + + - name: Install dependencies + run: bun install --ignore-scripts + + - name: Build binaries + run: | + mkdir -p dist-bun + # Linux + bun build --compile --minify --sourcemap --target=bun-linux-x64 src/cli/index.ts --outfile dist-bun/rulesync-linux-x64 + bun build --compile --minify --sourcemap --target=bun-linux-arm64 src/cli/index.ts --outfile dist-bun/rulesync-linux-arm64 + # macOS + bun build --compile --minify --sourcemap --target=bun-darwin-x64 src/cli/index.ts --outfile dist-bun/rulesync-darwin-x64 + bun build --compile --minify --sourcemap --target=bun-darwin-arm64 src/cli/index.ts --outfile dist-bun/rulesync-darwin-arm64 + + - name: Generate checksums + run: | + cd dist-bun + sha256sum rulesync-* > SHA256SUMS + cat SHA256SUMS + + - name: Upload binaries to release + uses: softprops/action-gh-release@v2 + with: + files: | + dist-bun/rulesync-linux-x64 + dist-bun/rulesync-linux-arm64 + dist-bun/rulesync-darwin-x64 + dist-bun/rulesync-darwin-arm64 + dist-bun/SHA256SUMS diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a8051f00..e7348be6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: permissions: id-token: write # Required for OIDC - contents: read + contents: read # Required for checking out code jobs: publish: diff --git a/.gitignore b/.gitignore index f5555c3d7..919f73fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -122,6 +122,7 @@ out # Nuxt.js build / generate output .nuxt dist +dist-bun # Gatsby files .cache/ @@ -259,3 +260,7 @@ repomix-output.xml **/.geminiignore modular-mcp.json + +# Bun compiled binaries +dist-bun/ +*.bun-build diff --git a/cspell.json b/cspell.json index 3e02dbb1f..5352f5781 100644 --- a/cspell.json +++ b/cspell.json @@ -115,6 +115,7 @@ "geminicli", "geminiignore", "gibo", + "giget", "GITSTATUS", "globby", "gnueabihf", diff --git a/mise.toml b/mise.toml index 380d72c1f..9998851f1 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,5 @@ [tools] +bun = "1.3.2" node = "24" pnpm = "10.20.0" python = "3"