Skip to content
Open
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
37 changes: 36 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,34 @@ jobs:
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm generate-sdk
- run: pnpm --filter @epilot/cli generate

# The repo commits the generated artifacts of both @epilot/sdk and
# @epilot/cli. Regenerating above and finding no diff is what keeps them
# honest — without this the generators run, the output is thrown away,
# and the committed copies drift unnoticed.
- name: Check generated artifacts are up to date
run: |
if ! git diff --quiet; then
echo "::error::Generated artifacts are out of date. Run 'pnpm generate-sdk && pnpm --filter @epilot/cli generate' and commit the result."
git diff --stat
exit 1
fi

- run: pnpm build

# A build must not mutate tracked source: no code generation, no network
# fetches of live specs. Updating a spec is the deliberate
# 'npm run openapi' step documented in CONTRIBUTING.md. Checked directly
# after the build so a dirty tree can only be the build's doing.
- name: Check build left the tree clean
run: |
if ! git diff --quiet; then
echo "::error::'pnpm build' modified tracked files. A build must not regenerate or re-fetch committed source."
git diff --stat
exit 1
fi

- run: pnpm test

auto-release:
Expand Down Expand Up @@ -147,7 +174,15 @@ jobs:
pkg.version = '${CLI_VERSION}';
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');
"
FILES_TO_ADD="$FILES_TO_ADD packages/cli/package.json packages/cli-wrapper/package.json"
# src/index.ts embeds CLI_VERSION and definitions/ are copied from
# clients/, so the generated artifacts have to be rebuilt after the
# bump and staged with it. The "Build and test CLI" step above ran
# before the bump, and "Rebuild CLI with bumped version" runs after
# the push, so neither produces output this commit can carry.
cd "$GITHUB_WORKSPACE"
pnpm --filter @epilot/cli generate

FILES_TO_ADD="$FILES_TO_ADD packages/cli/ packages/cli-wrapper/package.json"
TAGS="$TAGS @epilot/cli@${CLI_VERSION}"
fi

Expand Down
4 changes: 2 additions & 2 deletions clients/configuration-hub-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"bundle-definition": "webpack",
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/configuration-hub.yaml",
"typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
"build": "npm run typegen && npm run typescript && npm run bundle-definition",
"prepublishOnly": "npm run build"
"build": "npm run typescript && npm run bundle-definition",
"prepublishOnly": "npm run typegen && npm run build"
},
"files": [
"*.js",
Expand Down
4 changes: 2 additions & 2 deletions clients/journey-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"bundle-definition": "webpack",
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/journey-config.yaml",
"typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
"build": "npm run openapi && npm run typegen && npm run typescript && npm run bundle-definition",
"build": "npm run typescript && npm run bundle-definition",
"eslint": "../node_modules/.bin/eslint -c ../.eslintrc.yml",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run typegen && npm run build"
},
"files": [
"*.js",
Expand Down