chore: bump version to 1.1.1 #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, Publish & Optional SEA | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*.*.*'] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build-package: | |
| name: Build npm package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter ./apps/agent-inbox build | |
| - run: pnpm --filter ./apps/agent-inbox test src/__tests__/packaging.test.ts src/__tests__/cli.test.ts src/__tests__/setup.test.ts | |
| - name: Pack npm tarball | |
| run: | | |
| mkdir -p artifacts | |
| pnpm --filter ./apps/agent-inbox pack --pack-destination artifacts | |
| - name: Smoke test npm tarball install | |
| run: | | |
| set -euo pipefail | |
| install_dir=$(mktemp -d) | |
| npm_cache_dir=$(mktemp -d) | |
| home_dir=$(mktemp -d) | |
| tarball=$(echo "$PWD"/artifacts/*.tgz) | |
| cd "$install_dir" | |
| npm init -y >/dev/null 2>&1 | |
| NPM_CONFIG_CACHE="$npm_cache_dir" npm install "$tarball" | |
| INSTALL_DIR="$install_dir" HOME_DIR="$home_dir" python3 <<'PY' | |
| import os | |
| import pty | |
| import select | |
| import subprocess | |
| import sys | |
| import time | |
| env = dict(os.environ) | |
| env["HOME"] = env["HOME_DIR"] | |
| master_fd, slave_fd = pty.openpty() | |
| process = None | |
| chunks = [] | |
| markers = ("No platforms configured yet", "Which platform to configure", "Agent Inbox") | |
| try: | |
| process = subprocess.Popen( | |
| ["./node_modules/.bin/agent-inbox"], | |
| cwd=env["INSTALL_DIR"], | |
| env=env, | |
| stdin=slave_fd, | |
| stdout=slave_fd, | |
| stderr=slave_fd, | |
| ) | |
| os.close(slave_fd) | |
| deadline = time.time() + 5 | |
| while time.time() < deadline: | |
| ready, _, _ = select.select([master_fd], [], [], 0.2) | |
| if master_fd not in ready: | |
| continue | |
| data = os.read(master_fd, 8192) | |
| if not data: | |
| break | |
| chunks.append(data) | |
| output = b"".join(chunks).decode("utf-8", errors="replace") | |
| if any(marker in output for marker in markers): | |
| break | |
| finally: | |
| try: | |
| os.close(slave_fd) | |
| except OSError: | |
| pass | |
| try: | |
| if process is not None: | |
| process.terminate() | |
| process.wait(timeout=1) | |
| except Exception: | |
| try: | |
| if process is not None: | |
| process.kill() | |
| process.wait(timeout=1) | |
| except Exception: | |
| pass | |
| try: | |
| os.close(master_fd) | |
| except OSError: | |
| pass | |
| output = b"".join(chunks).decode("utf-8", errors="replace") | |
| print(output) | |
| if not any( | |
| token in output | |
| for token in ("No platforms configured yet", "Which platform to configure", "Agent Inbox") | |
| ): | |
| sys.exit(1) | |
| PY | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: agent-inbox-npm-package | |
| path: artifacts/*.tgz | |
| publish-npm: | |
| name: Publish npm package | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build-package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| registry-url: https://registry.npmjs.org | |
| - run: pnpm install --frozen-lockfile | |
| - id: package-name | |
| name: Check publish package name | |
| run: | | |
| package_name=$(node -p "JSON.parse(require('node:fs').readFileSync('apps/agent-inbox/package.json', 'utf8')).name") | |
| echo "package_name=$package_name" >> "$GITHUB_OUTPUT" | |
| if [[ "$package_name" == "@doctorwu/agent-inbox" ]]; then | |
| echo "publish_ready=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "publish_ready=false" >> "$GITHUB_OUTPUT" | |
| echo "Skipping npm publish until package name is set to @doctorwu/agent-inbox." | |
| fi | |
| - name: Publish package | |
| if: steps.package-name.outputs.publish_ready == 'true' | |
| run: pnpm --filter ./apps/agent-inbox publish --access public --provenance --no-git-checks | |
| build-sea: | |
| name: Build SEA (${{ matrix.os }}-${{ matrix.arch }}) | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| include: | |
| - os: darwin | |
| arch: x64 | |
| runner: macos-15-intel | |
| - os: darwin | |
| arch: arm64 | |
| runner: macos-14 | |
| - os: linux | |
| arch: x64 | |
| runner: ubuntu-latest | |
| - os: linux | |
| arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter ./apps/agent-inbox build | |
| - run: pnpm --filter ./apps/agent-inbox build:sea | |
| - name: Rename executable | |
| run: mv apps/agent-inbox/dist/agent-inbox apps/agent-inbox/dist/agent-inbox-${{ matrix.os }}-${{ matrix.arch }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: agent-inbox-${{ matrix.os }}-${{ matrix.arch }} | |
| path: apps/agent-inbox/dist/agent-inbox-${{ matrix.os }}-${{ matrix.arch }} |