Document Forgejo development flow
This commit is contained in:
parent
647e0d17da
commit
2d6d480f14
5 changed files with 63 additions and 53 deletions
|
|
@ -1,20 +1,22 @@
|
|||
---
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
- Treat `origin` as Codeberg: `git@codeberg.org:peezy-tech/codex-flows.git`.
|
||||
- Treat `github` as the GitHub mirror: `https://github.com/peezy-tech/codex-flows.git`.
|
||||
- Treat `origin` as Forgejo: `git@jojo.build: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`.
|
||||
- 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.
|
||||
- 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`.
|
||||
|
|
@ -25,8 +27,8 @@ When asked to set up or verify the repo, check:
|
|||
|
||||
```bash
|
||||
git remote -v
|
||||
ssh -T git@codeberg.org
|
||||
fj --host codeberg.org auth list
|
||||
ssh -T git@jojo.build
|
||||
fj --host jojo.build auth list
|
||||
gpg --list-secret-keys --keyid-format=long
|
||||
git status --short --branch
|
||||
```
|
||||
|
|
@ -34,8 +36,8 @@ git status --short --branch
|
|||
Expected local key files:
|
||||
|
||||
```text
|
||||
~/.ssh/id_ed25519_codeberg.pub
|
||||
~/.config/codeberg-keys/matamune-codeberg-gpg.asc
|
||||
~/.ssh/id_ed25519_jojo_build.pub
|
||||
~/.config/forgejo-keys/matamune-jojo-build-gpg.asc
|
||||
```
|
||||
|
||||
## Release Workflow
|
||||
|
|
@ -60,9 +62,10 @@ Then:
|
|||
|
||||
1. Bump `packages/codex-client/package.json`.
|
||||
2. Commit.
|
||||
3. Push to Codeberg: `git push`.
|
||||
4. Push to GitHub mirror: `git push github main`.
|
||||
5. Run GitHub workflow `.github/workflows/publish-codex-flows.yml` with `confirm_package=@peezy.tech/codex-flows`.
|
||||
3. Push to Forgejo: `git push`.
|
||||
4. Confirm Codeberg mirror has received the commit.
|
||||
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`.
|
||||
|
||||
## References
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
interface:
|
||||
display_name: "Codeberg Development Flow"
|
||||
short_description: "Codeberg-first development and release mirror flow."
|
||||
default_prompt: "Use the Codeberg-first development flow for remotes, branch tracking, Forgejo CLI, signed commits, GitHub mirroring, and npm trusted publishing."
|
||||
display_name: "Forgejo Development Flow"
|
||||
short_description: "Forgejo-first development, Codeberg mirroring, and GitHub publishing flow."
|
||||
default_prompt: "Use the Forgejo-first development flow for remotes, branch tracking, Forgejo CLI, signed commits, Codeberg mirroring, GitHub publishing, and npm trusted publishing."
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# Codeberg Development Flow Reference
|
||||
# Forgejo Development Flow Reference
|
||||
|
||||
## Remotes
|
||||
|
||||
```bash
|
||||
git remote -v
|
||||
# origin git@codeberg.org:peezy-tech/codex-flows.git
|
||||
# origin git@jojo.build: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
|
||||
git branch --set-upstream-to=origin/main main
|
||||
|
|
@ -16,11 +17,12 @@ git status --short --branch
|
|||
# ## main...origin/main
|
||||
```
|
||||
|
||||
Use Codeberg for day-to-day work:
|
||||
Use Forgejo for day-to-day work. Forgejo should push-mirror to Codeberg:
|
||||
|
||||
```bash
|
||||
git pull
|
||||
git push
|
||||
git ls-remote codeberg refs/heads/main
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```text
|
||||
~/.ssh/id_ed25519_codeberg.pub
|
||||
~/.ssh/id_ed25519_jojo_build.pub
|
||||
```
|
||||
|
||||
GPG public key:
|
||||
|
||||
```text
|
||||
~/.config/codeberg-keys/matamune-codeberg-gpg.asc
|
||||
~/.config/forgejo-keys/matamune-jojo-build-gpg.asc
|
||||
```
|
||||
|
||||
Git signing is expected:
|
||||
|
|
@ -55,23 +57,23 @@ git config --global user.signingkey E3B0D5FB2E5CF11FAFB2EA113BB8E7D3B968A324
|
|||
|
||||
`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
|
||||
fj --host codeberg.org auth list
|
||||
fj --host jojo.build auth list
|
||||
```
|
||||
|
||||
If authentication needs to be recreated:
|
||||
|
||||
```bash
|
||||
fj --host codeberg.org auth add-key matamune <token>
|
||||
fj --host codeberg.org auth use-ssh true
|
||||
fj --host jojo.build auth add-key matamune <token>
|
||||
fj --host jojo.build auth use-ssh true
|
||||
```
|
||||
|
||||
Create the organization repo when missing:
|
||||
|
||||
```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" \
|
||||
-S true
|
||||
```
|
||||
|
|
@ -79,7 +81,7 @@ fj --host codeberg.org org repo create peezy-tech codex-flows \
|
|||
Verify the repository:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
|
|
@ -101,7 +103,7 @@ npm view @peezy.tech/codex-flows version repository --json
|
|||
|
||||
## Current Constructed State
|
||||
|
||||
- Codeberg repo: `https://codeberg.org/peezy-tech/codex-flows`
|
||||
- GitHub mirror: `https://github.com/peezy-tech/codex-flows`
|
||||
- `origin/main` and `github/main` should be kept aligned for release commits.
|
||||
- Latest setup commit: `cebe948fbc44a027d905d26a972ab243f6a5d9c6`.
|
||||
- Forgejo repo: `https://jojo.build/peezy-tech/codex-flows`
|
||||
- Codeberg mirror: `https://codeberg.org/peezy-tech/codex-flows`
|
||||
- GitHub publishing repo: `https://github.com/peezy-tech/codex-flows`
|
||||
- `origin/main`, `codeberg/main`, and `github/main` should be kept aligned for release commits.
|
||||
|
|
|
|||
|
|
@ -63,14 +63,14 @@ bun run test
|
|||
|
||||
## 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
|
||||
|
||||
The public development home for this monorepo is `codeberg.org/peezy-tech/codex-flows`.
|
||||
The GitHub mirror at `peezy-tech/codex-flows` exists for npm trusted publishing.
|
||||
The canonical development home for this monorepo is `jojo.build/peezy-tech/codex-flows`.
|
||||
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`.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,26 @@
|
|||
# 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
|
||||
|
||||
Use Codeberg as the normal development remote:
|
||||
Use Forgejo as the normal development remote:
|
||||
|
||||
```bash
|
||||
git remote -v
|
||||
# origin git@codeberg.org:peezy-tech/codex-flows.git
|
||||
# origin git@jojo.build: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
|
||||
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:
|
||||
|
||||
```bash
|
||||
|
|
@ -26,30 +29,31 @@ git push github main
|
|||
|
||||
## Machine Keys
|
||||
|
||||
This machine uses a dedicated Codeberg SSH key:
|
||||
This machine uses dedicated Forgejo and Codeberg SSH keys:
|
||||
|
||||
```text
|
||||
~/.ssh/id_ed25519_jojo_build.pub
|
||||
~/.ssh/id_ed25519_codeberg.pub
|
||||
```
|
||||
|
||||
The public GPG key for commit verification is exported here:
|
||||
|
||||
```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` is installed as `fj`.
|
||||
|
||||
Authenticate with Codeberg after creating an application token:
|
||||
Authenticate with `jojo.build` after creating an application token:
|
||||
|
||||
```bash
|
||||
fj auth add-key <codeberg-username> <token>
|
||||
fj auth use-ssh true
|
||||
fj auth list
|
||||
fj --host jojo.build auth add-key <forgejo-username> <token>
|
||||
fj --host jojo.build auth use-ssh true
|
||||
fj --host jojo.build auth list
|
||||
```
|
||||
|
||||
If browser login is available, this may also work:
|
||||
|
|
@ -75,10 +79,11 @@ git diff --check
|
|||
To publish through GitHub trusted publishing:
|
||||
|
||||
1. Bump `packages/codex-client/package.json`.
|
||||
2. Commit and push to Codeberg.
|
||||
3. Push the same commit to GitHub.
|
||||
4. Run `.github/workflows/publish-codex-flows.yml` on GitHub with confirmation input `@peezy.tech/codex-flows`.
|
||||
5. Verify npm:
|
||||
2. Commit and push to Forgejo.
|
||||
3. Confirm the Codeberg mirror has received the commit.
|
||||
4. Push the same commit to GitHub.
|
||||
5. Run `.github/workflows/publish-codex-flows.yml` on GitHub with confirmation input `@peezy.tech/codex-flows`.
|
||||
6. Verify npm:
|
||||
|
||||
```bash
|
||||
npm dist-tag ls @peezy.tech/codex-flows
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue