Document Forgejo development flow

This commit is contained in:
matamune 2026-05-12 20:22:32 +00:00
parent 647e0d17da
commit 2d6d480f14
Signed by: matamune
GPG key ID: 3BB8E7D3B968A324
5 changed files with 63 additions and 53 deletions

View file

@ -1,20 +1,22 @@
--- ---
name: codeberg-development-flow name: codeberg-development-flow
description: Use when working in this repository on development flow, remotes, Codeberg or Forgejo CLI operations, Codeberg repo creation, branch tracking, commit signing, mirroring to GitHub, npm trusted publishing, release validation, or publishing @peezy.tech/codex-flows. description: Use when working in this repository on development flow, remotes, Forgejo or Codeberg CLI operations, Forgejo repo creation, branch tracking, commit signing, mirroring, npm trusted publishing, release validation, or publishing @peezy.tech/codex-flows.
--- ---
# Codeberg Development Flow # Forgejo Development Flow
## Overview ## Overview
Use Codeberg as the primary development forge. Keep GitHub as a mirror only for npm trusted publishing. Use Forgejo at `jojo.build` as the primary development forge. Keep Codeberg as a push mirror. Keep GitHub for npm trusted publishing only.
## Core Rules ## Core Rules
- Treat `origin` as Codeberg: `git@codeberg.org:peezy-tech/codex-flows.git`. - Treat `origin` as Forgejo: `git@jojo.build:peezy-tech/codex-flows.git`.
- Treat `github` as the GitHub mirror: `https://github.com/peezy-tech/codex-flows.git`. - Treat `codeberg` as the Codeberg mirror: `git@codeberg.org:peezy-tech/codex-flows.git`.
- Treat `github` as the GitHub publishing remote: `https://github.com/peezy-tech/codex-flows.git`.
- Keep `main` tracking `origin/main`, not `github/main`. - Keep `main` tracking `origin/main`, not `github/main`.
- Push normal development to Codeberg. - Push normal development to Forgejo.
- Configure Forgejo to push-mirror to Codeberg.
- Push to GitHub only when the release workflow must publish to npm. - Push to GitHub only when the release workflow must publish to npm.
- Do not add npm tokens to the repo or GitHub secrets. GitHub publishes through trusted publishing. - Do not add npm tokens to the repo or GitHub secrets. GitHub publishes through trusted publishing.
- Use package name `@peezy.tech/codex-flows`, not `@peezy-tech/codex-flows`. - Use package name `@peezy.tech/codex-flows`, not `@peezy-tech/codex-flows`.
@ -25,8 +27,8 @@ When asked to set up or verify the repo, check:
```bash ```bash
git remote -v git remote -v
ssh -T git@codeberg.org ssh -T git@jojo.build
fj --host codeberg.org auth list fj --host jojo.build auth list
gpg --list-secret-keys --keyid-format=long gpg --list-secret-keys --keyid-format=long
git status --short --branch git status --short --branch
``` ```
@ -34,8 +36,8 @@ git status --short --branch
Expected local key files: Expected local key files:
```text ```text
~/.ssh/id_ed25519_codeberg.pub ~/.ssh/id_ed25519_jojo_build.pub
~/.config/codeberg-keys/matamune-codeberg-gpg.asc ~/.config/forgejo-keys/matamune-jojo-build-gpg.asc
``` ```
## Release Workflow ## Release Workflow
@ -60,9 +62,10 @@ Then:
1. Bump `packages/codex-client/package.json`. 1. Bump `packages/codex-client/package.json`.
2. Commit. 2. Commit.
3. Push to Codeberg: `git push`. 3. Push to Forgejo: `git push`.
4. Push to GitHub mirror: `git push github main`. 4. Confirm Codeberg mirror has received the commit.
5. Run GitHub workflow `.github/workflows/publish-codex-flows.yml` with `confirm_package=@peezy.tech/codex-flows`. 5. Push to GitHub: `git push github main`.
6. Run GitHub workflow `.github/workflows/publish-codex-flows.yml` with `confirm_package=@peezy.tech/codex-flows`.
6. Verify `npm dist-tag ls @peezy.tech/codex-flows`. 6. Verify `npm dist-tag ls @peezy.tech/codex-flows`.
## References ## References

View file

@ -1,4 +1,4 @@
interface: interface:
display_name: "Codeberg Development Flow" display_name: "Forgejo Development Flow"
short_description: "Codeberg-first development and release mirror flow." short_description: "Forgejo-first development, Codeberg mirroring, and GitHub publishing flow."
default_prompt: "Use the Codeberg-first development flow for remotes, branch tracking, Forgejo CLI, signed commits, GitHub mirroring, and npm trusted publishing." default_prompt: "Use the Forgejo-first development flow for remotes, branch tracking, Forgejo CLI, signed commits, Codeberg mirroring, GitHub publishing, and npm trusted publishing."

View file

@ -1,14 +1,15 @@
# Codeberg Development Flow Reference # Forgejo Development Flow Reference
## Remotes ## Remotes
```bash ```bash
git remote -v git remote -v
# origin git@codeberg.org:peezy-tech/codex-flows.git # origin git@jojo.build:peezy-tech/codex-flows.git
# github https://github.com/peezy-tech/codex-flows.git # codeberg git@codeberg.org:peezy-tech/codex-flows.git
# github https://github.com/peezy-tech/codex-flows.git
``` ```
`main` should track Codeberg: `main` should track Forgejo:
```bash ```bash
git branch --set-upstream-to=origin/main main git branch --set-upstream-to=origin/main main
@ -16,11 +17,12 @@ git status --short --branch
# ## main...origin/main # ## main...origin/main
``` ```
Use Codeberg for day-to-day work: Use Forgejo for day-to-day work. Forgejo should push-mirror to Codeberg:
```bash ```bash
git pull git pull
git push git push
git ls-remote codeberg refs/heads/main
``` ```
Use GitHub only to run npm trusted publishing: Use GitHub only to run npm trusted publishing:
@ -35,13 +37,13 @@ gh workflow run publish-codex-flows.yml --repo peezy-tech/codex-flows --ref main
SSH public key: SSH public key:
```text ```text
~/.ssh/id_ed25519_codeberg.pub ~/.ssh/id_ed25519_jojo_build.pub
``` ```
GPG public key: GPG public key:
```text ```text
~/.config/codeberg-keys/matamune-codeberg-gpg.asc ~/.config/forgejo-keys/matamune-jojo-build-gpg.asc
``` ```
Git signing is expected: Git signing is expected:
@ -55,23 +57,23 @@ git config --global user.signingkey E3B0D5FB2E5CF11FAFB2EA113BB8E7D3B968A324
`forgejo-cli` is installed as `fj`. `forgejo-cli` is installed as `fj`.
The configured Codeberg login should be visible as `matamune@codeberg.org`: The configured Forgejo login should be visible for `jojo.build`:
```bash ```bash
fj --host codeberg.org auth list fj --host jojo.build auth list
``` ```
If authentication needs to be recreated: If authentication needs to be recreated:
```bash ```bash
fj --host codeberg.org auth add-key matamune <token> fj --host jojo.build auth add-key matamune <token>
fj --host codeberg.org auth use-ssh true fj --host jojo.build auth use-ssh true
``` ```
Create the organization repo when missing: Create the organization repo when missing:
```bash ```bash
fj --host codeberg.org org repo create peezy-tech codex-flows \ fj --host jojo.build org repo create peezy-tech codex-flows \
-d "Public monorepo for @peezy.tech/codex-flows" \ -d "Public monorepo for @peezy.tech/codex-flows" \
-S true -S true
``` ```
@ -79,7 +81,7 @@ fj --host codeberg.org org repo create peezy-tech codex-flows \
Verify the repository: Verify the repository:
```bash ```bash
fj --host codeberg.org repo view peezy-tech/codex-flows fj --host jojo.build repo view peezy-tech/codex-flows
git ls-remote origin HEAD refs/heads/main git ls-remote origin HEAD refs/heads/main
``` ```
@ -101,7 +103,7 @@ npm view @peezy.tech/codex-flows version repository --json
## Current Constructed State ## Current Constructed State
- Codeberg repo: `https://codeberg.org/peezy-tech/codex-flows` - Forgejo repo: `https://jojo.build/peezy-tech/codex-flows`
- GitHub mirror: `https://github.com/peezy-tech/codex-flows` - Codeberg mirror: `https://codeberg.org/peezy-tech/codex-flows`
- `origin/main` and `github/main` should be kept aligned for release commits. - GitHub publishing repo: `https://github.com/peezy-tech/codex-flows`
- Latest setup commit: `cebe948fbc44a027d905d26a972ab243f6a5d9c6`. - `origin/main`, `codeberg/main`, and `github/main` should be kept aligned for release commits.

View file

@ -63,14 +63,14 @@ bun run test
## Development Flow ## Development Flow
Development happens on Codeberg. GitHub is kept as a release mirror for npm trusted publishing. Development happens on Forgejo at `jojo.build`. Codeberg is configured as a push mirror, and GitHub is kept for npm trusted publishing only.
See [docs/development-flow.md](docs/development-flow.md) for remotes, key setup, Forgejo CLI setup, and the release procedure. See [docs/development-flow.md](docs/development-flow.md) for remotes, key setup, Forgejo CLI setup, mirroring, and the release procedure.
## Publishing ## Publishing
The public development home for this monorepo is `codeberg.org/peezy-tech/codex-flows`. The canonical development home for this monorepo is `jojo.build/peezy-tech/codex-flows`.
The GitHub mirror at `peezy-tech/codex-flows` exists for npm trusted publishing. Codeberg mirrors `peezy-tech/codex-flows`; the GitHub repository at `peezy-tech/codex-flows` exists for npm trusted publishing.
`@peezy.tech/codex-flows` is published from `packages/codex-client`. `@peezy.tech/codex-flows` is published from `packages/codex-client`.

View file

@ -1,23 +1,26 @@
# Development Flow # Development Flow
This monorepo is developed on Codeberg and mirrored to GitHub only for npm trusted publishing. This monorepo is developed on Forgejo at `jojo.build`. Codeberg is a push mirror, and GitHub is used only when npm trusted publishing needs its workflow.
## Remotes ## Remotes
Use Codeberg as the normal development remote: Use Forgejo as the normal development remote:
```bash ```bash
git remote -v git remote -v
# origin git@codeberg.org:peezy-tech/codex-flows.git # origin git@jojo.build:peezy-tech/codex-flows.git
# github https://github.com/peezy-tech/codex-flows.git # codeberg git@codeberg.org:peezy-tech/codex-flows.git
# github https://github.com/peezy-tech/codex-flows.git
``` ```
Push ordinary development to Codeberg: Push ordinary development to Forgejo:
```bash ```bash
git push origin main git push origin main
``` ```
Forgejo should push-mirror `main` to Codeberg. The local `codeberg` remote is kept for diagnostics and manual recovery.
Push to GitHub only when a release needs the trusted publishing workflow: Push to GitHub only when a release needs the trusted publishing workflow:
```bash ```bash
@ -26,30 +29,31 @@ git push github main
## Machine Keys ## Machine Keys
This machine uses a dedicated Codeberg SSH key: This machine uses dedicated Forgejo and Codeberg SSH keys:
```text ```text
~/.ssh/id_ed25519_jojo_build.pub
~/.ssh/id_ed25519_codeberg.pub ~/.ssh/id_ed25519_codeberg.pub
``` ```
The public GPG key for commit verification is exported here: The public GPG key for commit verification is exported here:
```text ```text
~/.config/codeberg-keys/matamune-codeberg-gpg.asc ~/.config/forgejo-keys/matamune-jojo-build-gpg.asc
``` ```
Upload both public keys to the Codeberg account before pushing over SSH or expecting verified commits. Upload the Forgejo SSH and GPG public keys to the `jojo.build` account before pushing over SSH or expecting verified commits. Keep the Codeberg SSH key available for mirror diagnostics.
## Forgejo CLI ## Forgejo CLI
`forgejo-cli` is installed as `fj`. `forgejo-cli` is installed as `fj`.
Authenticate with Codeberg after creating an application token: Authenticate with `jojo.build` after creating an application token:
```bash ```bash
fj auth add-key <codeberg-username> <token> fj --host jojo.build auth add-key <forgejo-username> <token>
fj auth use-ssh true fj --host jojo.build auth use-ssh true
fj auth list fj --host jojo.build auth list
``` ```
If browser login is available, this may also work: If browser login is available, this may also work:
@ -75,10 +79,11 @@ git diff --check
To publish through GitHub trusted publishing: To publish through GitHub trusted publishing:
1. Bump `packages/codex-client/package.json`. 1. Bump `packages/codex-client/package.json`.
2. Commit and push to Codeberg. 2. Commit and push to Forgejo.
3. Push the same commit to GitHub. 3. Confirm the Codeberg mirror has received the commit.
4. Run `.github/workflows/publish-codex-flows.yml` on GitHub with confirmation input `@peezy.tech/codex-flows`. 4. Push the same commit to GitHub.
5. Verify npm: 5. Run `.github/workflows/publish-codex-flows.yml` on GitHub with confirmation input `@peezy.tech/codex-flows`.
6. Verify npm:
```bash ```bash
npm dist-tag ls @peezy.tech/codex-flows npm dist-tag ls @peezy.tech/codex-flows