feat(stacks): add the GitHub-repos Alchemy stack - #445
Open
Mkassabov wants to merge 7 commits into
Open
Conversation
Adds stacks/github, an Alchemy stack that manages one alchemy-run/distilled-<name> repository per packages/* SDK (23 today: 22 SDKs + core), discovered from the filesystem at deploy time. A new deploy-github-stack workflow deploys it on every push to main (usually a no-op) using the ALCHEMY_GITHUB_TOKEN PAT secret. The stack is standalone (own bun.lock, not a workspace member) because alchemy@2.0.0-beta.70 requires effect 4.0.0-beta.103 while the monorepo catalog hoists beta.105.
Swap localState() for Cloudflare.state() — the same remote state store the alchemy monorepo uses — so local and CI deploys converge one shared stack. The workflow now also passes CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID and deploys with --yes so state-store upgrade prompts can't hang CI. The target org is now the DISTILLED_REPOS_OWNER repository variable (falling back to alchemy-run) ahead of the move to a dedicated snapshot org.
Latest main release. Kills the effect version skew: beta.70 was built against the pre-rename Schema API (effect beta.103) while its @distilled.cloud deps floated to beta.105.
A stale bun manifest cache resolved next to the broken beta.70 (built against pre-rename effect Schema API); force-refreshed so the lockfile pins beta.72 + effect beta.105.
Follows the alchemy CI/CD tutorial: deployed once with an admin profile, it mints a Cloudflare API token scoped to the state-store worker and seeds all four CI values (CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, ALCHEMY_GITHUB_TOKEN, DISTILLED_REPOS_OWNER) into this repo's Actions configuration as code.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
stacks/github— an Alchemy stack that manages onealchemy-run/distilled-<name>GitHub repository perpackages/*directory (23 today: 22 SDKs +core), plus adeploy-github-stackworkflow that deploys it on every push tomain(usually a no-op) and onworkflow_dispatch.Long term these repos will hold per-SDK snapshots so consumers can fetch just the SDK they need at
--depth=1instead of cloning the monorepo or its multi-GB spec submodules. This PR only creates/converges the repositories; pushing snapshot content is a follow-up.How
alchemy.run.tsdiscovers the package list frompackages/*at deploy time, so a new SDK package automatically gets its repo on the next deploy.GitHub.Repositoryconverges against the live repo: existing repos are adopted and their settings synced, never duplicated; the default removal policy isretain, so nothing here can delete a repository..alchemy/state, gitignored). Empty state per CI run is safe for this stack because every resource reconciles against the live GitHub API.stacks/githubis deliberately not a workspace member and carries its ownbun.lock:alchemy@2.0.0-beta.70is built againsteffect@4.0.0-beta.103(Schema.TaggedErrorClass, removed in beta.104), while the monorepo catalog hoists beta.105 — a shared install breaks at import time.Setup required before merge
The workflow needs an
ALCHEMY_GITHUB_TOKENrepository secret: a PAT withreposcope and permission to create repositories in thealchemy-runorg (the built-inGITHUB_TOKENcannot create repositories).Verified
tsc -p stacks/github/tsconfig.jsonpasses (real checking,noCheckoff).CI=1 GITHUB_ACCESS_TOKEN=… bun alchemy plan --stage prodbuilds the stack and plans 23 creates, one per package.CI=true(set by Actions) it auto-selects the env method and readsGITHUB_ACCESS_TOKEN.