This guide explains how to set up your own fork with automatic builds and auto-updates.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Upstream Repo │────>│ Your Fork │────>│ GitHub Release │
│ (21st-dev/1code)│ │ (auto-synced) │ │ (with builds) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ every 6 hours │ on push │
└───────────────────────┴───────────────────────┘
│
▼
┌─────────────────┐
│ Your Local App │
│ (auto-updates) │
└─────────────────┘
- Go to https://github.com/21st-dev/1code
- Click "Fork" in the top right
- Create the fork under your account
After forking:
- Go to your fork's Settings → Actions → General
- Under "Actions permissions", select "Allow all actions"
- Under "Workflow permissions", select "Read and write permissions"
- Click Save
- If your
mainbranch is protected, allow GitHub Actions to bypass it or disable "Require a pull request before merging" (auto-sync pushes directly tomain)
Trigger the first build manually:
- Go to Actions tab in your fork
- Select "Build and Release" workflow
- Click "Run workflow" → "Run workflow"
This will:
- Build the app for macOS (unsigned)
- Create a GitHub Release with the build artifacts
After the first release is created, configure your local app to use your fork:
# Clone your fork
git clone https://github.com/YOUR_USERNAME/1code.git
cd 1code
# Install dependencies
bun install
# Configure updates from your fork
bun run setup:fork YOUR_USERNAME
# Build and run the app
bun run devCreate/edit ~/Library/Application Support/1Code/update-config.json:
{
"source": "github",
"githubRepo": "YOUR_USERNAME/1code"
}# Build the app (unsigned, for local use)
bun run build
bun run package:mac -- --config.mac.identity=null --config.mac.notarize=nullInstall the app from release/1Code-*.dmg.
The sync-fork.yml workflow:
- Runs every 6 hours (configurable in cron)
- Fetches upstream
mainbranch - Merges changes into your fork
- If upstream release tag changed → triggers build workflow
You can also manually trigger a sync:
- Go to Actions → "Sync Fork with Upstream Main"
- Click "Run workflow"
- Optionally check "Force build" to rebuild even without changes
The app checks for updates:
- When the app starts (after 5 second delay)
- When the app window gains focus
- Minimum 1 minute between checks
When an update is found:
- Shows "Update available" banner
- User clicks "Update" to download
- After download, user clicks "Restart Now"
- App installs update and restarts
Edit .github/workflows/sync-fork.yml:
schedule:
# Every hour
- cron: "0 * * * *"
# Every 6 hours
- cron: "0 */6 * * *"
# Once a day at midnight
- cron: "0 0 * * *"Edit .github/workflows/build-release.yml:
build-windows:
if: true # Change from false to true
build-linux:
if: true # Change from false to trueTo switch back to official 21st.dev CDN updates:
bun run setup:fork --cdnOr delete the config file:
rm ~/Library/Application\ Support/1Code/update-config.jsonThe Claude Code binary download may require authentication. The workflow has continue-on-error: true for this step, but you may need to:
- Download binaries manually from the official release
- Add them to your fork's
resources/bin/directory - Commit and push
-
Check the update config:
cat ~/Library/Application\ Support/1Code/update-config.json
-
Verify your fork has releases:
https://github.com/YOUR_USERNAME/1code/releases -
Check app logs:
cat ~/Library/Logs/1Code/main.log | grep AutoUpdater
If the sync workflow fails due to merge conflicts:
- Clone your fork locally
- Resolve conflicts manually:
git fetch upstream git merge upstream/main # Resolve conflicts git push
- Unsigned builds: These builds are not code-signed or notarized
- macOS may show warnings when opening the app
- Right-click → Open to bypass Gatekeeper on first launch
- This is fine for personal use; for distribution, set up proper signing
| Workflow | Trigger | Purpose |
|---|---|---|
sync-fork.yml |
Cron (every 6 hours), manual | Sync with upstream main; trigger release on new upstream tag |
build-release.yml |
Manual or from sync-fork.yml |
Build and release |
| Config File | Location | Purpose |
|---|---|---|
update-config.json |
~/Library/Application Support/1Code/ |
Update source config |