diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..06c63f91 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,11 @@ +/.github/ @coder/ghostty-web-maintainers +/scripts/ @coder/ghostty-web-maintainers +/patches/ @coder/ghostty-web-maintainers +/ghostty @coder/ghostty-web-maintainers +/.gitmodules @coder/ghostty-web-maintainers +/package.json @coder/ghostty-web-maintainers +/bun.lock @coder/ghostty-web-maintainers +/demo/package.json @coder/ghostty-web-maintainers +/demo/bun.lock @coder/ghostty-web-maintainers +/vite.config.js @coder/ghostty-web-maintainers +/release-please-config.json @coder/ghostty-web-maintainers diff --git a/.github/actions/setup-zig/action.yml b/.github/actions/setup-zig/action.yml index 06730782..66163363 100644 --- a/.github/actions/setup-zig/action.yml +++ b/.github/actions/setup-zig/action.yml @@ -5,23 +5,29 @@ inputs: description: 'Zig version to install' required: true default: '0.15.2' + cache: + description: 'Reuse a cached Zig installation' + required: false + default: 'true' runs: using: 'composite' steps: - name: Cache Zig - uses: actions/cache@v4 + if: inputs.cache == 'true' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 id: cache-zig with: path: | ~/zig - key: zig-${{ runner.os }}-${{ inputs.version }} + key: zig-v2-${{ runner.os }}-${{ inputs.version }} - name: Download and install Zig if: steps.cache-zig.outputs.cache-hit != 'true' shell: bash + env: + VERSION: ${{ inputs.version }} run: | - set -e - VERSION="${{ inputs.version }}" + set -euo pipefail # Determine platform if [[ "$OSTYPE" == "linux-gnu"* ]]; then @@ -44,8 +50,26 @@ runs: TARBALL="zig-${ARCH}-${PLATFORM}-${VERSION}.tar.xz" URL="https://ziglang.org/download/${VERSION}/${TARBALL}" + # SHA-256 of each supported tarball, from https://ziglang.org/download/ + case "${TARBALL}" in + zig-x86_64-linux-0.15.2.tar.xz) + SHA256="02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239" + ;; + zig-aarch64-macos-0.15.2.tar.xz) + SHA256="3cc2bab367e185cdfb27501c4b30b1b0653c28d9f73df8dc91488e66ece5fa6b" + ;; + zig-x86_64-macos-0.15.2.tar.xz) + SHA256="375b6909fc1495d16fc2c7db9538f707456bfc3373b14ee83fdd3e22b3d43f7f" + ;; + *) + echo "No checksum recorded for ${TARBALL}; add it to .github/actions/setup-zig/action.yml" + exit 1 + ;; + esac + echo "Downloading Zig ${VERSION} for ${PLATFORM}-${ARCH}..." - curl --retry 3 --retry-delay 5 -L -o "/tmp/${TARBALL}" "${URL}" + curl --fail --retry 3 --retry-delay 5 -L -o "/tmp/${TARBALL}" "${URL}" + echo "${SHA256} /tmp/${TARBALL}" | shasum -a 256 -c - # Extract to home directory mkdir -p ~/zig diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ba15e03d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,37 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directories: + - / + - /.github/actions/setup-zig + schedule: + interval: weekly + commit-message: + prefix: ci + groups: + actions: + patterns: + - '*' + + - package-ecosystem: bun + directory: / + schedule: + interval: weekly + commit-message: + prefix: chore + groups: + tooling: + patterns: + - '*' + update-types: + - minor + - patch + + - package-ecosystem: bun + directory: /demo + schedule: + interval: weekly + commit-message: + prefix: deps + ignore: + - dependency-name: ghostty-web diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c86f4298..9889de4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,19 +6,24 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: fmt: name: fmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Check formatting run: bun run fmt @@ -27,14 +32,16 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Run linter run: bun run lint @@ -43,14 +50,16 @@ jobs: name: type check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Check types run: bun run typecheck @@ -59,13 +68,14 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: submodules: recursive + persist-credentials: false - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - uses: ./.github/actions/setup-zig with: @@ -75,7 +85,7 @@ jobs: run: ./scripts/build-wasm.sh - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Run tests run: bun test @@ -84,13 +94,14 @@ jobs: name: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: submodules: recursive + persist-credentials: false - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - uses: ./.github/actions/setup-zig with: @@ -109,7 +120,7 @@ jobs: fi - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Build library run: bun run build diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 03a36bc9..03bf2c06 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -21,15 +21,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 persist-credentials: false - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 with: - bun-version: latest + bun-version: 1.4.4 - name: Install dependencies env: