Skip to content
Merged
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
38 changes: 38 additions & 0 deletions .github/actions/prepare-desktop-frontend/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Prepare desktop frontend
description: >-
Builds the workspace packages the desktop frontend imports and generates its
gitignored marketplace JSON. Every job that runs tsc, vite, or `tauri build`
against apps/desktop must call this first — keeping it in one place is what
stops validate/release/nightly from drifting apart.

inputs:
strict:
description: Pass --strict to the marketplace generator (fail on plugin data errors).
required: false
default: 'true'

runs:
using: composite
steps:
# The desktop frontend imports @harness-kit/design-tokens and
# @harness-kit/ui directly, which in turn need shared + core built.
- name: Build workspace dependencies
shell: bash
run: |
pnpm --filter @harness-kit/shared build
pnpm --filter @harness-kit/core build
pnpm --filter @harness-kit/design-tokens build
pnpm --filter @harness-kit/ui build

# The desktop Marketplace page imports a static marketplace JSON generated
# from git (gitignored build output) — same pattern as the website. Without
# this, `tsc` fails with TS2307 on ./marketplace.generated.json.
- name: Generate marketplace data
shell: bash
run: |
STRICT=""
if [[ "${{ inputs.strict }}" == "true" ]]; then
STRICT="--strict"
fi
pnpm --filter @harness-kit/marketplace-data generate $STRICT -- \
--out ../../apps/desktop/src/lib/marketplace/marketplace.generated.json
45 changes: 39 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build workspace dependencies
run: |
pnpm --filter @harness-kit/shared build
pnpm --filter @harness-kit/core build
pnpm --filter @harness-kit/design-tokens build
pnpm --filter @harness-kit/ui build
- uses: ./.github/actions/prepare-desktop-frontend

- name: Build desktop app
run: |
Expand Down Expand Up @@ -209,3 +204,41 @@ jobs:
git push
env:
GITHUB_SHA: ${{ github.sha }}

# A scheduled workflow fails where nobody is looking — this one was red for
# four nights before anyone noticed. Surface it as an issue instead.
report-failure:
needs: [build-cli-standalone, build-desktop, publish]
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Open or update the nightly failure issue
run: |
# --label fails hard if the label doesn't exist yet.
gh label create nightly-failure \
--color B60205 \
--description "Automated: the nightly build is red" 2>/dev/null || true

RUN_URL="https://github.com/${GH_REPO}/actions/runs/${GH_RUN_ID}"
BODY="Nightly build failed on \`main\` (commit \`${GITHUB_SHA:0:7}\`).

Run: $RUN_URL"

EXISTING=$(gh issue list --state open --label nightly-failure \
--json number --jq '.[0].number')

if [[ -n "$EXISTING" ]]; then
gh issue comment "$EXISTING" --body "$BODY"
else
gh issue create \
--title "Nightly build failing" \
--label nightly-failure \
--body "$BODY"
fi
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
GH_RUN_ID: ${{ github.run_id }}
GITHUB_SHA: ${{ github.sha }}
14 changes: 1 addition & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

# Mirrors validate.yml's desktop-build-test job — the desktop frontend
# imports @harness-kit/design-tokens and @harness-kit/ui directly.
- name: Build workspace dependencies
run: |
pnpm --filter @harness-kit/shared build
pnpm --filter @harness-kit/core build
pnpm --filter @harness-kit/design-tokens build
pnpm --filter @harness-kit/ui build

# The desktop Marketplace page imports a static marketplace JSON generated
# from git (gitignored build output) — same pattern as the website.
- name: Generate marketplace data
run: pnpm --filter @harness-kit/marketplace-data generate --strict -- --out ../../apps/desktop/src/lib/marketplace/marketplace.generated.json
- uses: ./.github/actions/prepare-desktop-frontend

- name: Build desktop app
run: pnpm --filter harness-kit-desktop tauri build
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build workspace dependencies
run: |
pnpm --filter @harness-kit/shared build
pnpm --filter @harness-kit/core build
pnpm --filter @harness-kit/design-tokens build
pnpm --filter @harness-kit/ui build

# The desktop Marketplace page imports a static marketplace JSON generated
# from git (gitignored build output) — same pattern as the website. Generate
# it before anything that touches the desktop frontend runs below.
- name: Generate marketplace data
run: pnpm --filter @harness-kit/marketplace-data generate -- --out ../../apps/desktop/src/lib/marketplace/marketplace.generated.json
- uses: ./.github/actions/prepare-desktop-frontend
with:
strict: 'false'

- name: TypeScript check (desktop)
run: pnpm --filter harness-kit-desktop exec tsc --noEmit
Expand Down