🛟 Updated.
872a940 parent: 5e2e762 modified
.claude/skills/release/SKILL.md +54 -42 | @@ -1,19 +1,19 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | name: release |
| 3 | -description: Prepare a mini-me (mm) release — takes the version as a parameter (1.0.0 or v1.0.0; the tag is always v-prefixed), asks for it when missing, closes the version's milestone, writes the bilingual release notes in release-notes/, updates the version in the three install guides, sets TAG in .release.env, then asks the user to commit, push and run the local-ci-*.sh scripts. Use when the user wants to release, cut, tag or publish a new version of mm. | |
| 3 | +description: Prepare a razorbill (rzb) release — takes the version as a parameter (1.0.0 or v1.0.0; the tag is always v-prefixed), asks for it when missing, closes the version's milestone, sets the version in the code, tests and docs, writes the bilingual release notes in release-notes/, updates the version in INSTALL.MACOS.md / .fr.md, sets TAG in .release.env, runs the checks, then asks the user to commit, push and run the local-ci-*.sh scripts on the Mac (build, sign, notarize, publish on Rickub). Use when the user wants to release, cut, tag or publish a new version of razorbill / rzb. | |
| 4 | 4 | --- |
| 5 | 5 | |
| 6 | 6 | # Release |
| 7 | 7 | |
| 8 | -Prepare everything a release of `mm` needs, then hand over to the user for the one step that commits, pushes and tags. **Never commit, push or run `./local-ci-03-create-draft.sh` and the next steps yourself**: it runs `git add .`, commits, pushes `main` and pushes the tag — outward-facing and hard to undo, and the user commits and pushes themselves. | |
| 8 | +Prepare everything a release of `rzb` needs, then hand over to the user. **Never commit, push, tag or run `./local-ci-02-build.sh` and the next steps yourself**: they need the Mac (signing, notarization), and steps 03–06 create the tag and publish on Rickub — outward-facing and hard to undo. The user commits, pushes and runs them. | |
| 9 | 9 | |
| 10 | -Talk to the user in their language (French for this project's author). Read `.memory/` first, as `CLAUDE.md` requires: the history says how the previous releases were prepared. | |
| 10 | +Talk to the user in their language (French for this project's author). Read `.memory/` first, as `CLAUDE.md` requires: the history says how the previous releases were prepared. How the CI works is in `docs/en/how-to/package-a-release.md`. | |
| 11 | 11 | |
| 12 | 12 | ## 1. The version |
| 13 | 13 | |
| 14 | 14 | 1. Take the version from the skill's argument. If there is none, **ask for it** (AskUserQuestion, with the next patch, minor and major versions after the latest tag as options). |
| 15 | 15 | 2. Normalise it: strip a leading `v` or `V`, check it is `MAJOR.MINOR.PATCH` (digits only). Refuse anything else and ask again. |
| 16 | -3. From here: `VERSION=1.0.0` (no `v`, for the install guides) and `TAG=v1.0.0` (always with the `v`, for `.release.env`, the notes and the milestone). | |
| 16 | +3. From here: `VERSION=1.0.0` (no `v`: the code, the docs, the archive name, the install guides) and `TAG=v1.0.0` (always with the `v`: `.release.env`, the notes' file names, the milestone). | |
| 17 | 17 | 4. Find the previous release: `git tag --sort=-v:refname | head -1`. The notes cover `PREV..HEAD`. |
| 18 | 18 | |
| 19 | 19 | ## 2. Check before writing anything |
| @@ -22,75 +22,87 @@ Stop and report — do not work around — when one of these fails: | ||
| 22 | 22 | |
| 23 | 23 | | Check | Command | When it fails | |
| 24 | 24 | |-------|---------|---------------| |
| 25 | -| The tag is free, here and on the remote | `git rev-parse -q --verify refs/tags/$TAG`, `git ls-remote --tags origin refs/tags/$TAG` | Say so; the user chooses another version | | |
| 26 | -| On `main` | `git branch --show-current` | the release is cut from the remote's `main`: ask the user to merge first | | |
| 27 | -| Nothing unrelated in the working tree | `git status --short` | `local-ci-03-create-draft.sh` refuses a tree that is not clean: list the files and ask whether they belong in the release | | |
| 25 | +| The tag is free here | `git rev-parse -q --verify refs/tags/$TAG` | Say so; the user chooses another version. (`origin` is SSH, closed from the sandbox: the user checks the remote, or `local-ci-03` refuses an existing release with 409.) | | |
| 26 | +| On `main` | `git branch --show-current` | The release is cut from the remote's `main`: ask the user to merge first | | |
| 27 | +| Nothing unrelated in the working tree | `git status --short` | `local-ci-02` and `03` refuse a tree that is not clean: list the files and ask whether they belong in the release | | |
| 28 | 28 | | The version is newer than the previous tag | compare the numbers | Ask the user to confirm | |
| 29 | 29 | |
| 30 | 30 | ## 3. The milestone |
| 31 | 31 | |
| 32 | -1. List the tickets of milestone `$TAG` in `.tickets/issues/*.yaml` (`milestone: $TAG`) with their state. | |
| 33 | -2. If some are still open, list them and ask: release anyway (and move them to another milestone?), or stop. Do not close or move a ticket without the user's answer. | |
| 32 | +1. List the tickets of milestone `$TAG` (also try the title without the `v`, and titles like `vX.Y — name`) in `.tickets/issues/*.yaml` (`milestone: …`) with their state and open tasks. | |
| 33 | +2. If some are still open, list them and ask: release anyway (and move them to another milestone?), or stop. Do not close or move a ticket without the user's answer. A ticket whose remaining task can only be checked on the Mac (e.g. `scripts/check-hardened-runtime.sh`) is closed only after the user reports the result. | |
| 34 | 34 | 3. When the user agrees, set the milestone `state: closed` in `.tickets/milestones.yaml`. If the milestone does not exist, say so and go on — it is not a blocker. |
| 35 | 35 | |
| 36 | -## 4. The release notes | |
| 36 | +## 4. The version in the code, the tests and the docs | |
| 37 | 37 | |
| 38 | -Write `release-notes/$TAG.en.md` and `release-notes/$TAG.fr.md`. **Read the previous notes first** (`release-notes/$PREV.en.md` and `.fr.md`) and follow their structure and tone exactly: | |
| 38 | +1. `Sources/RazorbillCore/Razorbill.swift`: `public static let version = "$VERSION"` and the example in its doc comment. `local-ci-01` and `03` refuse a `TAG` that differs from it. | |
| 39 | +2. Find every other place that shows the previous version: `grep -rn "$PREV_VERSION" --include=*.md --include=*.swift --include=*.drawio . | grep -v -e '^./.build' -e '^./.memory' -e '^./.tickets' -e '^./release-notes'`. Usually: `Sources/RazorbillCLI/Commands/VersionCommand.swift` (doc), `Tests/RazorbillCLITests/OtherCommandsTests.swift` (the version test), `README.md`, `docs/en` and `docs/fr` (getting started, build on the Mac, CLI and HTTP references), the title of `docs/diagrams/packages.drawio` (and its exports). Update them all. | |
| 40 | +3. TUI tests use a version as a fake server version (`.connected(version: "…")`): it is test data, leave it. | |
| 41 | + | |
| 42 | +## 5. The release notes | |
| 43 | + | |
| 44 | +Write `release-notes/$TAG.md` (English) and `release-notes/$TAG.fr.md`. **Read the previous notes first** (`release-notes/$PREV.md` and `.fr.md`) and follow their structure and tone: | |
| 39 | 45 | |
| 40 | 46 | ``` |
| 41 | -# mini-me vX.Y.Z | |
| 47 | +# razorbill X.Y.Z | |
| 42 | 48 | |
| 43 | -*[Version française](vX.Y.Z.fr.md)* (FR: *[English version](vX.Y.Z.en.md)*) | |
| 49 | +*[Version française](vX.Y.Z.fr.md)* (FR: *[English version](vX.Y.Z.md)*) | |
| 44 | 50 | |
| 45 | -<one-sentence summary — the same sentence goes in the index> | |
| 51 | +<one-paragraph summary — local-ci-03 copies it into the release text: the first line after the | |
| 52 | +title that does not start with #, * or a space> | |
| 46 | 53 | |
| 47 | -## New (FR: ## Nouveautés) — one ### per feature, with its ticket (#123) | |
| 54 | +## New (FR: ## Nouveautés) — one item per feature, with its ticket (#123) when useful | |
| 48 | 55 | ## Fixed (FR: ## Corrections) — when there are fixes |
| 49 | -## Demos (FR: ## Démos) | |
| 50 | -## Documentation | |
| 51 | 56 | ## Upgrading (FR: ## Mise à jour) — breaking changes, new keys, changed messages |
| 57 | +## Install (FR: ## Installation) — the archive name, INSTALL.MACOS.md, signed or not | |
| 52 | 58 | ``` |
| 53 | 59 | |
| 54 | -Sources, in this order — **the commit messages say nothing** ("🛟 Updated."), never build the notes from them: | |
| 60 | +Sources, in this order: | |
| 55 | 61 | |
| 56 | 62 | 1. `git diff --name-status $PREV..HEAD` (skip `.memory/` and `.tickets/`) — what actually changed; |
| 57 | -2. the comments of the milestone's tickets — what was built, the user's choices, the measured numbers; | |
| 58 | -3. `.memory/history.md` since the previous release — decisions, traps, measurements. | |
| 63 | +2. the bodies, tasks and comments of the milestone's tickets — what was built, the user's choices, the measured numbers; | |
| 64 | +3. `.memory/history.md` since the previous release — decisions, traps, measurements; | |
| 65 | +4. the commit messages, last: they help, but check each claim against 1–3. | |
| 59 | 66 | |
| 60 | 67 | Rules: |
| 61 | 68 | |
| 62 | -- **Only verified facts.** Every number (timings, scores, sizes) must come from a ticket comment, the history or a demo README — check each one before writing it. Never invent a figure. | |
| 63 | -- Write for users: what they can do now, how to turn it on, what changed for them. No internal function names unless the user types them (config keys, flags, commands, messages). | |
| 64 | -- Mention what was **not** done or not measured when a ticket says so. | |
| 65 | -- The French note is a translation, not a copy; its links point to `docs/fr/…`. | |
| 69 | +- **Only verified facts.** Every number (tokens/s, sizes, test counts) must come from a ticket comment, the history or a doc — check each one. Never invent a figure. | |
| 70 | +- Write for users: what they can do now, how to turn it on, what changed for them. No internal type names unless the user types them (config keys, options, commands, routes, messages). | |
| 71 | +- Say what was **not** done or not verified when a ticket or the history says so. | |
| 72 | +- The French note is a translation, not a copy; its links point to `docs/fr/…` and `INSTALL.MACOS.fr.md`. | |
| 66 | 73 | - Do not hard-wrap prose (one paragraph or list item per line). |
| 67 | 74 | - Check that every relative link resolves (`release-notes/` is the base). |
| 68 | 75 | |
| 69 | -Then update `release-notes/README.md`: add the new row on top with the date `not tagged yet` and the summary sentence; give the previous release's row its tag date (`git log -1 --format=%ad --date=short $PREV`) if it still says `not tagged yet`. | |
| 76 | +## 6. The install guides | |
| 70 | 77 | |
| 71 | -## 5. The install guides | |
| 78 | +Set `VERSION=$VERSION` (no `v`) in every command block of `INSTALL.MACOS.md` and `INSTALL.MACOS.fr.md` (the short version and the checked one). Leave the section about archives before 1.0.0 alone. Check that the names the guides use (`razorbill-${VERSION}-macos-arm64.tar.gz`, its folder, `SHA256SUMS`, `com.bots-garden.rzb`) still match what `local-ci-02-build.sh` and `scripts/release.sh` produce. The download links only work once the release is published: say so to the user. | |
| 72 | 79 | |
| 73 | -Set the version (without the `v`) in the three guides, and check nothing else names an old version: | |
| 80 | +## 7. .release.env | |
| 74 | 81 | |
| 75 | -| File | Line | | |
| 76 | -|------|------| | |
| 77 | -| `INSTALL.MACOS.md` | every `VERSION=X.Y.Z` above "Versions up to v1.0.4" (the short version and the signed one), and the `mm-X.Y.Z-darwin-arm64` of the expected output. Never the one under "Versions up to v1.0.4": it stays `1.0.4` | | |
| 78 | -| `INSTALL.LINUX.md` | `VERSION=X.Y.Z` | | |
| 79 | -| `INSTALL.WINDOWS.md` | `$Version = "X.Y.Z"` | | |
| 82 | +Set `TAG="$TAG"` in `.release.env` (git-ignored; with the `v`). If the file is missing, create it from the template in `docs/en/how-to/package-a-release.md`. Leave `ABOUT`, `OWNER`, `REPO`, `RZB_SIGN_IDENTITY` and `RZB_NOTARY_PROFILE` as they are unless the user asks. Check that `.ci.cd.token.env` exists (never print it) and that both files are git-ignored (`git check-ignore .release.env .ci.cd.token.env`). | |
| 80 | 83 | |
| 81 | -Check that the asset names the guides download (`mm-${VERSION}-<os>-<arch>[.exe]`, `SHA256SUMS`) still match what `local-ci-02-build.sh` builds. The links only work once the release is published: say so to the user. | |
| 84 | +## 8. Checks | |
| 82 | 85 | |
| 83 | -## 6. .release.env | |
| 86 | +Run what the project relies on and report the results honestly (counts, failures with their output): | |
| 84 | 87 | |
| 85 | -Set `TAG="$TAG"` in `.release.env` (with the `v`). Leave `ABOUT`, `OWNER`, `REPO`, `MM_SIGN_IDENTITY` and `MM_NOTARY_PROFILE` as they are unless the user asks. With the last two set, `local-ci-02-build.sh` signs and notarizes the macOS binary, on a Mac only: see `RELEASING.macos.en.md`. | |
| 88 | +- Linux: `scripts/test.sh`, `swiftlint lint --quiet Sources Tests` and `swift format lint -r Sources Tests` (both must print nothing), `shellcheck -x local-ci-*.sh scripts/*.sh`. | |
| 89 | +- Mac, when the host runner is up: `tools/host-runner/host.sh test . razorbill` (a 502 means it is down: ask the user to start it, or leave it to `local-ci-01` on the Mac). | |
| 90 | +- The quality gate: `python3 .claude/skills/quality/scripts/quality_report.py --workspace .`. | |
| 91 | +- `LOCAL_CI_SKIP_GIT_CHECK=1 LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` needs `release/$TAG/SHA256SUMS`, which only step 02 makes: skip it before the build, or point it at a throwaway `LOCAL_CI_ENV_FILE`. | |
| 86 | 92 | |
| 87 | -## 7. Hand over | |
| 93 | +## 9. Hand over | |
| 88 | 94 | |
| 89 | -1. Run the checks the project relies on, and report the results honestly: `bash -l -c "go test ./... -count=1"`, `gofmt -l`, `go vet ./...`. | |
| 90 | -2. Show the user what changed (`git status --short`) and summarise the notes in a few lines. | |
| 91 | -3. Ask the user to commit and push, then to run in order: `./local-ci-01-check.sh`, `./local-ci-02-build.sh`, `./local-ci-03-create-draft.sh` (it creates the tag and uses `release-notes/<TAG>.en.md`), `./local-ci-04-upload.sh` and `./local-ci-05-publish.sh`, which asks them to type the tag because a published prerelease becomes `/releases/latest`. Optionally, `./local-ci-06-promote.sh` then removes the pre-release label (asks for the tag too). | |
| 92 | -4. After the user has run it: the index row can get its date (the tag date) in the next release, as step 4 does. | |
| 95 | +1. Show the user what changed (`git status --short`) and summarise the notes in a few lines. | |
| 96 | +2. Ask the user to commit and push `main` (from the Mac: `origin` is SSH), then to run, **on the Mac, from the repository root, with kDrive sync paused during step 02**: | |
| 97 | + 1. once, or after an MLX / macOS upgrade: `scripts/check-hardened-runtime.sh`; | |
| 98 | + 2. `./local-ci-01-check.sh`; | |
| 99 | + 3. `./local-ci-02-build.sh` (signs and notarizes when `RZB_SIGN_IDENTITY` is set); | |
| 100 | + 4. `./local-ci-03-create-draft.sh` (creates the tag `$TAG` on Rickub and a draft prerelease); | |
| 101 | + 5. `./local-ci-04-upload.sh`; | |
| 102 | + 6. `./local-ci-05-publish.sh`, which asks them to type the tag because a published prerelease becomes `/releases/latest`; | |
| 103 | + 7. optionally `./local-ci-06-promote.sh`, which removes the pre-release label (asks for the tag too). | |
| 104 | +3. Then `git fetch --tags` locally: the tag is created on Rickub by step 03, not in the local repository. | |
| 93 | 105 | |
| 94 | -## 8. The project memory | |
| 106 | +## 10. The project memory | |
| 95 | 107 | |
| 96 | -As `CLAUDE.md` requires, append one entry to `.memory/history.md` (the version, the milestone, the notes written, what is left to the user) and update today's handoff. Do not touch `summary.md` unless the release changes how the project is built or released. | |
| 108 | +As `CLAUDE.md` requires, append one entry to `.memory/history.md` (the version, the milestone, the notes written, the checks, what is left to the user) and update today's handoff. Update `summary.md` only for what the release changes in how the project is built or released. | |
| @@ -1,19 +1,19 @@ | |||
| 1 | --- | 1 | --- |
| 2 | name: release | 2 | name: release |
| 3 | -description: Prepare a mini-me (mm) release — takes the version as a parameter (1.0.0 or v1.0.0; the tag is always v-prefixed), asks for it when missing, closes the version's milestone, writes the bilingual release notes in release-notes/, updates the version in the three install guides, sets TAG in .release.env, then asks the user to commit, push and run the local-ci-*.sh scripts. Use when the user wants to release, cut, tag or publish a new version of mm. | 3 | +description: Prepare a razorbill (rzb) release — takes the version as a parameter (1.0.0 or v1.0.0; the tag is always v-prefixed), asks for it when missing, closes the version's milestone, sets the version in the code, tests and docs, writes the bilingual release notes in release-notes/, updates the version in INSTALL.MACOS.md / .fr.md, sets TAG in .release.env, runs the checks, then asks the user to commit, push and run the local-ci-*.sh scripts on the Mac (build, sign, notarize, publish on Rickub). Use when the user wants to release, cut, tag or publish a new version of razorbill / rzb. |
| 4 | --- | 4 | --- |
| 5 | 5 | ||
| 6 | # Release | 6 | # Release |
| 7 | 7 | ||
| 8 | -Prepare everything a release of `mm` needs, then hand over to the user for the one step that commits, pushes and tags. **Never commit, push or run `./local-ci-03-create-draft.sh` and the next steps yourself**: it runs `git add .`, commits, pushes `main` and pushes the tag — outward-facing and hard to undo, and the user commits and pushes themselves. | 8 | +Prepare everything a release of `rzb` needs, then hand over to the user. **Never commit, push, tag or run `./local-ci-02-build.sh` and the next steps yourself**: they need the Mac (signing, notarization), and steps 03–06 create the tag and publish on Rickub — outward-facing and hard to undo. The user commits, pushes and runs them. |
| 9 | 9 | ||
| 10 | -Talk to the user in their language (French for this project's author). Read `.memory/` first, as `CLAUDE.md` requires: the history says how the previous releases were prepared. | 10 | +Talk to the user in their language (French for this project's author). Read `.memory/` first, as `CLAUDE.md` requires: the history says how the previous releases were prepared. How the CI works is in `docs/en/how-to/package-a-release.md`. |
| 11 | 11 | ||
| 12 | ## 1. The version | 12 | ## 1. The version |
| 13 | 13 | ||
| 14 | 1. Take the version from the skill's argument. If there is none, **ask for it** (AskUserQuestion, with the next patch, minor and major versions after the latest tag as options). | 14 | 1. Take the version from the skill's argument. If there is none, **ask for it** (AskUserQuestion, with the next patch, minor and major versions after the latest tag as options). |
| 15 | 2. Normalise it: strip a leading `v` or `V`, check it is `MAJOR.MINOR.PATCH` (digits only). Refuse anything else and ask again. | 15 | 2. Normalise it: strip a leading `v` or `V`, check it is `MAJOR.MINOR.PATCH` (digits only). Refuse anything else and ask again. |
| 16 | -3. From here: `VERSION=1.0.0` (no `v`, for the install guides) and `TAG=v1.0.0` (always with the `v`, for `.release.env`, the notes and the milestone). | 16 | +3. From here: `VERSION=1.0.0` (no `v`: the code, the docs, the archive name, the install guides) and `TAG=v1.0.0` (always with the `v`: `.release.env`, the notes' file names, the milestone). |
| 17 | 4. Find the previous release: `git tag --sort=-v:refname | head -1`. The notes cover `PREV..HEAD`. | 17 | 4. Find the previous release: `git tag --sort=-v:refname | head -1`. The notes cover `PREV..HEAD`. |
| 18 | 18 | ||
| 19 | ## 2. Check before writing anything | 19 | ## 2. Check before writing anything |
| @@ -22,75 +22,87 @@ Stop and report — do not work around — when one of these fails: | |||
| 22 | 22 | ||
| 23 | | Check | Command | When it fails | | 23 | | Check | Command | When it fails | |
| 24 | |-------|---------|---------------| | 24 | |-------|---------|---------------| |
| 25 | -| The tag is free, here and on the remote | `git rev-parse -q --verify refs/tags/$TAG`, `git ls-remote --tags origin refs/tags/$TAG` | Say so; the user chooses another version | | 25 | +| The tag is free here | `git rev-parse -q --verify refs/tags/$TAG` | Say so; the user chooses another version. (`origin` is SSH, closed from the sandbox: the user checks the remote, or `local-ci-03` refuses an existing release with 409.) | |
| 26 | -| On `main` | `git branch --show-current` | the release is cut from the remote's `main`: ask the user to merge first | | 26 | +| On `main` | `git branch --show-current` | The release is cut from the remote's `main`: ask the user to merge first | |
| 27 | -| Nothing unrelated in the working tree | `git status --short` | `local-ci-03-create-draft.sh` refuses a tree that is not clean: list the files and ask whether they belong in the release | | 27 | +| Nothing unrelated in the working tree | `git status --short` | `local-ci-02` and `03` refuse a tree that is not clean: list the files and ask whether they belong in the release | |
| 28 | | The version is newer than the previous tag | compare the numbers | Ask the user to confirm | | 28 | | The version is newer than the previous tag | compare the numbers | Ask the user to confirm | |
| 29 | 29 | ||
| 30 | ## 3. The milestone | 30 | ## 3. The milestone |
| 31 | 31 | ||
| 32 | -1. List the tickets of milestone `$TAG` in `.tickets/issues/*.yaml` (`milestone: $TAG`) with their state. | 32 | +1. List the tickets of milestone `$TAG` (also try the title without the `v`, and titles like `vX.Y — name`) in `.tickets/issues/*.yaml` (`milestone: …`) with their state and open tasks. |
| 33 | -2. If some are still open, list them and ask: release anyway (and move them to another milestone?), or stop. Do not close or move a ticket without the user's answer. | 33 | +2. If some are still open, list them and ask: release anyway (and move them to another milestone?), or stop. Do not close or move a ticket without the user's answer. A ticket whose remaining task can only be checked on the Mac (e.g. `scripts/check-hardened-runtime.sh`) is closed only after the user reports the result. |
| 34 | 3. When the user agrees, set the milestone `state: closed` in `.tickets/milestones.yaml`. If the milestone does not exist, say so and go on — it is not a blocker. | 34 | 3. When the user agrees, set the milestone `state: closed` in `.tickets/milestones.yaml`. If the milestone does not exist, say so and go on — it is not a blocker. |
| 35 | 35 | ||
| 36 | -## 4. The release notes | 36 | +## 4. The version in the code, the tests and the docs |
| 37 | 37 | ||
| 38 | -Write `release-notes/$TAG.en.md` and `release-notes/$TAG.fr.md`. **Read the previous notes first** (`release-notes/$PREV.en.md` and `.fr.md`) and follow their structure and tone exactly: | 38 | +1. `Sources/RazorbillCore/Razorbill.swift`: `public static let version = "$VERSION"` and the example in its doc comment. `local-ci-01` and `03` refuse a `TAG` that differs from it. |
| 39 | +2. Find every other place that shows the previous version: `grep -rn "$PREV_VERSION" --include=*.md --include=*.swift --include=*.drawio . | grep -v -e '^./.build' -e '^./.memory' -e '^./.tickets' -e '^./release-notes'`. Usually: `Sources/RazorbillCLI/Commands/VersionCommand.swift` (doc), `Tests/RazorbillCLITests/OtherCommandsTests.swift` (the version test), `README.md`, `docs/en` and `docs/fr` (getting started, build on the Mac, CLI and HTTP references), the title of `docs/diagrams/packages.drawio` (and its exports). Update them all. | ||
| 40 | +3. TUI tests use a version as a fake server version (`.connected(version: "…")`): it is test data, leave it. | ||
| 41 | + | ||
| 42 | +## 5. The release notes | ||
| 43 | + | ||
| 44 | +Write `release-notes/$TAG.md` (English) and `release-notes/$TAG.fr.md`. **Read the previous notes first** (`release-notes/$PREV.md` and `.fr.md`) and follow their structure and tone: | ||
| 39 | 45 | ||
| 40 | ``` | 46 | ``` |
| 41 | -# mini-me vX.Y.Z | 47 | +# razorbill X.Y.Z |
| 42 | 48 | ||
| 43 | -*[Version française](vX.Y.Z.fr.md)* (FR: *[English version](vX.Y.Z.en.md)*) | 49 | +*[Version française](vX.Y.Z.fr.md)* (FR: *[English version](vX.Y.Z.md)*) |
| 44 | 50 | ||
| 45 | -<one-sentence summary — the same sentence goes in the index> | 51 | +<one-paragraph summary — local-ci-03 copies it into the release text: the first line after the |
| 52 | +title that does not start with #, * or a space> | ||
| 46 | 53 | ||
| 47 | -## New (FR: ## Nouveautés) — one ### per feature, with its ticket (#123) | 54 | +## New (FR: ## Nouveautés) — one item per feature, with its ticket (#123) when useful |
| 48 | ## Fixed (FR: ## Corrections) — when there are fixes | 55 | ## Fixed (FR: ## Corrections) — when there are fixes |
| 49 | -## Demos (FR: ## Démos) | ||
| 50 | -## Documentation | ||
| 51 | ## Upgrading (FR: ## Mise à jour) — breaking changes, new keys, changed messages | 56 | ## Upgrading (FR: ## Mise à jour) — breaking changes, new keys, changed messages |
| 57 | +## Install (FR: ## Installation) — the archive name, INSTALL.MACOS.md, signed or not | ||
| 52 | ``` | 58 | ``` |
| 53 | 59 | ||
| 54 | -Sources, in this order — **the commit messages say nothing** ("🛟 Updated."), never build the notes from them: | 60 | +Sources, in this order: |
| 55 | 61 | ||
| 56 | 1. `git diff --name-status $PREV..HEAD` (skip `.memory/` and `.tickets/`) — what actually changed; | 62 | 1. `git diff --name-status $PREV..HEAD` (skip `.memory/` and `.tickets/`) — what actually changed; |
| 57 | -2. the comments of the milestone's tickets — what was built, the user's choices, the measured numbers; | 63 | +2. the bodies, tasks and comments of the milestone's tickets — what was built, the user's choices, the measured numbers; |
| 58 | -3. `.memory/history.md` since the previous release — decisions, traps, measurements. | 64 | +3. `.memory/history.md` since the previous release — decisions, traps, measurements; |
| 65 | +4. the commit messages, last: they help, but check each claim against 1–3. | ||
| 59 | 66 | ||
| 60 | Rules: | 67 | Rules: |
| 61 | 68 | ||
| 62 | -- **Only verified facts.** Every number (timings, scores, sizes) must come from a ticket comment, the history or a demo README — check each one before writing it. Never invent a figure. | 69 | +- **Only verified facts.** Every number (tokens/s, sizes, test counts) must come from a ticket comment, the history or a doc — check each one. Never invent a figure. |
| 63 | -- Write for users: what they can do now, how to turn it on, what changed for them. No internal function names unless the user types them (config keys, flags, commands, messages). | 70 | +- Write for users: what they can do now, how to turn it on, what changed for them. No internal type names unless the user types them (config keys, options, commands, routes, messages). |
| 64 | -- Mention what was **not** done or not measured when a ticket says so. | 71 | +- Say what was **not** done or not verified when a ticket or the history says so. |
| 65 | -- The French note is a translation, not a copy; its links point to `docs/fr/…`. | 72 | +- The French note is a translation, not a copy; its links point to `docs/fr/…` and `INSTALL.MACOS.fr.md`. |
| 66 | - Do not hard-wrap prose (one paragraph or list item per line). | 73 | - Do not hard-wrap prose (one paragraph or list item per line). |
| 67 | - Check that every relative link resolves (`release-notes/` is the base). | 74 | - Check that every relative link resolves (`release-notes/` is the base). |
| 68 | 75 | ||
| 69 | -Then update `release-notes/README.md`: add the new row on top with the date `not tagged yet` and the summary sentence; give the previous release's row its tag date (`git log -1 --format=%ad --date=short $PREV`) if it still says `not tagged yet`. | 76 | +## 6. The install guides |
| 70 | 77 | ||
| 71 | -## 5. The install guides | 78 | +Set `VERSION=$VERSION` (no `v`) in every command block of `INSTALL.MACOS.md` and `INSTALL.MACOS.fr.md` (the short version and the checked one). Leave the section about archives before 1.0.0 alone. Check that the names the guides use (`razorbill-${VERSION}-macos-arm64.tar.gz`, its folder, `SHA256SUMS`, `com.bots-garden.rzb`) still match what `local-ci-02-build.sh` and `scripts/release.sh` produce. The download links only work once the release is published: say so to the user. |
| 72 | 79 | ||
| 73 | -Set the version (without the `v`) in the three guides, and check nothing else names an old version: | 80 | +## 7. .release.env |
| 74 | 81 | ||
| 75 | -| File | Line | | 82 | +Set `TAG="$TAG"` in `.release.env` (git-ignored; with the `v`). If the file is missing, create it from the template in `docs/en/how-to/package-a-release.md`. Leave `ABOUT`, `OWNER`, `REPO`, `RZB_SIGN_IDENTITY` and `RZB_NOTARY_PROFILE` as they are unless the user asks. Check that `.ci.cd.token.env` exists (never print it) and that both files are git-ignored (`git check-ignore .release.env .ci.cd.token.env`). |
| 76 | -|------|------| | ||
| 77 | -| `INSTALL.MACOS.md` | every `VERSION=X.Y.Z` above "Versions up to v1.0.4" (the short version and the signed one), and the `mm-X.Y.Z-darwin-arm64` of the expected output. Never the one under "Versions up to v1.0.4": it stays `1.0.4` | | ||
| 78 | -| `INSTALL.LINUX.md` | `VERSION=X.Y.Z` | | ||
| 79 | -| `INSTALL.WINDOWS.md` | `$Version = "X.Y.Z"` | | ||
| 80 | 83 | ||
| 81 | -Check that the asset names the guides download (`mm-${VERSION}-<os>-<arch>[.exe]`, `SHA256SUMS`) still match what `local-ci-02-build.sh` builds. The links only work once the release is published: say so to the user. | 84 | +## 8. Checks |
| 82 | 85 | ||
| 83 | -## 6. .release.env | 86 | +Run what the project relies on and report the results honestly (counts, failures with their output): |
| 84 | 87 | ||
| 85 | -Set `TAG="$TAG"` in `.release.env` (with the `v`). Leave `ABOUT`, `OWNER`, `REPO`, `MM_SIGN_IDENTITY` and `MM_NOTARY_PROFILE` as they are unless the user asks. With the last two set, `local-ci-02-build.sh` signs and notarizes the macOS binary, on a Mac only: see `RELEASING.macos.en.md`. | 88 | +- Linux: `scripts/test.sh`, `swiftlint lint --quiet Sources Tests` and `swift format lint -r Sources Tests` (both must print nothing), `shellcheck -x local-ci-*.sh scripts/*.sh`. |
| 89 | +- Mac, when the host runner is up: `tools/host-runner/host.sh test . razorbill` (a 502 means it is down: ask the user to start it, or leave it to `local-ci-01` on the Mac). | ||
| 90 | +- The quality gate: `python3 .claude/skills/quality/scripts/quality_report.py --workspace .`. | ||
| 91 | +- `LOCAL_CI_SKIP_GIT_CHECK=1 LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` needs `release/$TAG/SHA256SUMS`, which only step 02 makes: skip it before the build, or point it at a throwaway `LOCAL_CI_ENV_FILE`. | ||
| 86 | 92 | ||
| 87 | -## 7. Hand over | 93 | +## 9. Hand over |
| 88 | 94 | ||
| 89 | -1. Run the checks the project relies on, and report the results honestly: `bash -l -c "go test ./... -count=1"`, `gofmt -l`, `go vet ./...`. | 95 | +1. Show the user what changed (`git status --short`) and summarise the notes in a few lines. |
| 90 | -2. Show the user what changed (`git status --short`) and summarise the notes in a few lines. | 96 | +2. Ask the user to commit and push `main` (from the Mac: `origin` is SSH), then to run, **on the Mac, from the repository root, with kDrive sync paused during step 02**: |
| 91 | -3. Ask the user to commit and push, then to run in order: `./local-ci-01-check.sh`, `./local-ci-02-build.sh`, `./local-ci-03-create-draft.sh` (it creates the tag and uses `release-notes/<TAG>.en.md`), `./local-ci-04-upload.sh` and `./local-ci-05-publish.sh`, which asks them to type the tag because a published prerelease becomes `/releases/latest`. Optionally, `./local-ci-06-promote.sh` then removes the pre-release label (asks for the tag too). | 97 | + 1. once, or after an MLX / macOS upgrade: `scripts/check-hardened-runtime.sh`; |
| 92 | -4. After the user has run it: the index row can get its date (the tag date) in the next release, as step 4 does. | 98 | + 2. `./local-ci-01-check.sh`; |
| 99 | + 3. `./local-ci-02-build.sh` (signs and notarizes when `RZB_SIGN_IDENTITY` is set); | ||
| 100 | + 4. `./local-ci-03-create-draft.sh` (creates the tag `$TAG` on Rickub and a draft prerelease); | ||
| 101 | + 5. `./local-ci-04-upload.sh`; | ||
| 102 | + 6. `./local-ci-05-publish.sh`, which asks them to type the tag because a published prerelease becomes `/releases/latest`; | ||
| 103 | + 7. optionally `./local-ci-06-promote.sh`, which removes the pre-release label (asks for the tag too). | ||
| 104 | +3. Then `git fetch --tags` locally: the tag is created on Rickub by step 03, not in the local repository. | ||
| 93 | 105 | ||
| 94 | -## 8. The project memory | 106 | +## 10. The project memory |
| 95 | 107 | ||
| 96 | -As `CLAUDE.md` requires, append one entry to `.memory/history.md` (the version, the milestone, the notes written, what is left to the user) and update today's handoff. Do not touch `summary.md` unless the release changes how the project is built or released. | 108 | +As `CLAUDE.md` requires, append one entry to `.memory/history.md` (the version, the milestone, the notes written, the checks, what is left to the user) and update today's handoff. Update `summary.md` only for what the release changes in how the project is built or released. |
modified
.gitignore +5 -0 | @@ -5,3 +5,8 @@ DerivedData/ | ||
| 5 | 5 | __pycache__/ |
| 6 | 6 | *.profraw |
| 7 | 7 | dist/ |
| 8 | + | |
| 9 | +# local CI (local-ci-*.sh): secrets, per-release settings, build output | |
| 10 | +.ci.cd.token.env | |
| 11 | +.release.env | |
| 12 | +/release/ | |
| @@ -5,3 +5,8 @@ DerivedData/ | |||
| 5 | __pycache__/ | 5 | __pycache__/ |
| 6 | *.profraw | 6 | *.profraw |
| 7 | dist/ | 7 | dist/ |
| 8 | + | ||
| 9 | +# local CI (local-ci-*.sh): secrets, per-release settings, build output | ||
| 10 | +.ci.cd.token.env | ||
| 11 | +.release.env | ||
| 12 | +/release/ | ||
added
.memory/handoffs/2026-11-27-v1-0-0-local-ci.md +16 -0 | new file mode 100644 | ||
| @@ -0,0 +1,16 @@ | ||
| 1 | +# Handoff — 2026-11-27 — local CI + 1.0.0 prepared (not released) | |
| 2 | + | |
| 3 | +## State | |
| 4 | +- Everything for 1.0.0 is written but **uncommitted** (the user commits and pushes from the Mac; `sbxenv.yaml` is also modified by the user — not part of the release, ask before including it: step 02/03 refuse a dirty tree). | |
| 5 | +- Version 1.0.0 in code/tests/docs, notes `release-notes/v1.0.0*.md`, `.release.env` TAG=v1.0.0 (git-ignored), `.ci.cd.token.env` present (git-ignored, never print it). | |
| 6 | +- #52: tasks 1/3/4 closed, task 2 (MLX under the hardened runtime) open; milestone v1.0.0 open. | |
| 7 | + | |
| 8 | +## Next steps (user, on the Mac, kDrive sync paused during 02) | |
| 9 | +1. `scripts/check-hardened-runtime.sh` (needs Qwen3-4B-4bit + bge-small-en-v1.5 pulled, uv). If it fails while `scripts/compat.sh` passes: an entitlement is needed (add a plist + `--entitlements` in 02 and the check). | |
| 10 | +2. `./local-ci-01-check.sh` → `02` → `03` → `04` → `05` (→ `06`). Then `git fetch --tags` (the tag is created on Rickub). | |
| 11 | +3. After success: close #52 task 2 + #52 + milestone v1.0.0, history entry. | |
| 12 | + | |
| 13 | +## Watch out for | |
| 14 | +- Unverified: Rickub Actions for the razorbill repo (step 04 needs a CI job), CI_TOKEN rights on razorbill, notarization of the folder (bundles signed without runtime). | |
| 15 | +- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty; `swift format lint` prints 10 warnings on untouched files — 01 may fail on them on the Mac if they are real there. | |
| 16 | +- Never `git stash` here (sbxenv.yaml busy mount). | |
| new file mode 100644 | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | +# Handoff — 2026-11-27 — local CI + 1.0.0 prepared (not released) | ||
| 2 | + | ||
| 3 | +## State | ||
| 4 | +- Everything for 1.0.0 is written but **uncommitted** (the user commits and pushes from the Mac; `sbxenv.yaml` is also modified by the user — not part of the release, ask before including it: step 02/03 refuse a dirty tree). | ||
| 5 | +- Version 1.0.0 in code/tests/docs, notes `release-notes/v1.0.0*.md`, `.release.env` TAG=v1.0.0 (git-ignored), `.ci.cd.token.env` present (git-ignored, never print it). | ||
| 6 | +- #52: tasks 1/3/4 closed, task 2 (MLX under the hardened runtime) open; milestone v1.0.0 open. | ||
| 7 | + | ||
| 8 | +## Next steps (user, on the Mac, kDrive sync paused during 02) | ||
| 9 | +1. `scripts/check-hardened-runtime.sh` (needs Qwen3-4B-4bit + bge-small-en-v1.5 pulled, uv). If it fails while `scripts/compat.sh` passes: an entitlement is needed (add a plist + `--entitlements` in 02 and the check). | ||
| 10 | +2. `./local-ci-01-check.sh` → `02` → `03` → `04` → `05` (→ `06`). Then `git fetch --tags` (the tag is created on Rickub). | ||
| 11 | +3. After success: close #52 task 2 + #52 + milestone v1.0.0, history entry. | ||
| 12 | + | ||
| 13 | +## Watch out for | ||
| 14 | +- Unverified: Rickub Actions for the razorbill repo (step 04 needs a CI job), CI_TOKEN rights on razorbill, notarization of the folder (bundles signed without runtime). | ||
| 15 | +- Sandbox: Swift toolchain broken (libxml2.so.16), no swiftlint/qlty; `swift format lint` prints 10 warnings on untouched files — 01 may fail on them on the Mac if they are real there. | ||
| 16 | +- Never `git stash` here (sbxenv.yaml busy mount). | ||
modified
.memory/history.md +8 -0 | @@ -563,3 +563,11 @@ open, a comment on each. main fast-forwarded. | ||
| 563 | 563 | - **Next**: the user runs `scripts/release.sh` on the Mac (clean tree, Release build, archive + sha256 in dist/), then tag `v0.3.0` and push main + tag from the Mac. |
| 564 | 564 | - 2026-11-27, end: user ran scripts/release.sh on the Mac ("c'est bon"); annotated tag v0.3.0 created on main (c1b63b5), local; the user pushes main + tag from the Mac. |
| 565 | 565 | - Restart handoff written: handoffs/2026-11-27-v0-3-released.md (state after the 0.3.0 tag, open tickets, how to work). |
| 566 | + | |
| 567 | +## 2026-11-27 — local CI like mini-me, release skill, install guide, MIT, 1.0.0 prepared | |
| 568 | +- **Asked**: the same local CI as mini-me (build, sign, notarize, publish/upload the release on Rickub) for rzb, as v1.0.0; adapt the `release` skill; an install guide like mini-me's INSTALL.MACOS.md. During the session: `.ci.cd.token.env` (copied by the user) into .gitignore; `default.profraw` (stray, untracked, Nov 26) deleted at the user's question; MIT license. | |
| 569 | +- **Changes**: `local-ci-00…06.sh` + `.shellcheckrc` at the root (03–06 copied from mini-me; 02 rewritten: Mac Release build, signs bundles + rzb with hardened runtime, notarizes a zip of the folder, packages through `scripts/release.sh --products --out`, re-checks signatures and `rzb --version` on the unpacked archive); `scripts/release.sh` `--out`, LICENSE in the archive, INSTALL.txt depends on the signature; `scripts/check-hardened-runtime.sh`; `INSTALL.MACOS.md` / `.fr.md`; how-to package-a-release / preparer-une-release rewritten; README (status v1.0, Install section, layout, license); `.gitignore` (+ `.ci.cd.token.env`, `.release.env`, `/release/`); `.release.env` (TAG v1.0.0, RZB_* from SIDEKICKS_*); version 1.0.0 in Core, VersionCommand doc, CLI test, README, docs, diagram title; release notes `release-notes/v1.0.0.md` / `.fr.md`; skill `release` rewritten for razorbill; #52 tasks 1, 3, 4 closed + comment 1, task 2 open. | |
| 570 | +- **Decisions**: keep the tar.gz (no pkg/Homebrew), notarize as zip, no staple possible; bundles signed too; no entitlements until the hardened-runtime check says otherwise; scripts at the root like mini-me; release notes keep razorbill's naming (`vX.Y.Z.md`, not `.en.md`); Xcode version recorded by step 02 in build-info.txt so 03 can run on Linux. | |
| 571 | +- **Checks**: shellcheck clean on all scripts; doc links OK; dry runs: 03 notes (LOCAL_CI_PRINT_NOTES), 01 refuses a mismatched TAG, 02 refuses Linux. NOT run: unit tests (Swift toolchain broken in the sandbox: libxml2.so.16), swiftlint, quality gate (qlty absent), anything on the Mac (host runner down). | |
| 572 | +- **Trap**: `git stash` breaks here — `sbxenv.yaml` is a busy mount, stash saved but reset half-failed and reverted tracked files; recovered with `git checkout stash@{0} -- <files but sbxenv.yaml>`. Do not use stash in this sandbox. | |
| 573 | +- **Next**: user commits + pushes from the Mac, then `scripts/check-hardened-runtime.sh`, `local-ci-01…05` (06 optional). Milestone v1.0.0 stays open until #52 task 2 is confirmed. | |
| @@ -563,3 +563,11 @@ open, a comment on each. main fast-forwarded. | |||
| 563 | - **Next**: the user runs `scripts/release.sh` on the Mac (clean tree, Release build, archive + sha256 in dist/), then tag `v0.3.0` and push main + tag from the Mac. | 563 | - **Next**: the user runs `scripts/release.sh` on the Mac (clean tree, Release build, archive + sha256 in dist/), then tag `v0.3.0` and push main + tag from the Mac. |
| 564 | - 2026-11-27, end: user ran scripts/release.sh on the Mac ("c'est bon"); annotated tag v0.3.0 created on main (c1b63b5), local; the user pushes main + tag from the Mac. | 564 | - 2026-11-27, end: user ran scripts/release.sh on the Mac ("c'est bon"); annotated tag v0.3.0 created on main (c1b63b5), local; the user pushes main + tag from the Mac. |
| 565 | - Restart handoff written: handoffs/2026-11-27-v0-3-released.md (state after the 0.3.0 tag, open tickets, how to work). | 565 | - Restart handoff written: handoffs/2026-11-27-v0-3-released.md (state after the 0.3.0 tag, open tickets, how to work). |
| 566 | + | ||
| 567 | +## 2026-11-27 — local CI like mini-me, release skill, install guide, MIT, 1.0.0 prepared | ||
| 568 | +- **Asked**: the same local CI as mini-me (build, sign, notarize, publish/upload the release on Rickub) for rzb, as v1.0.0; adapt the `release` skill; an install guide like mini-me's INSTALL.MACOS.md. During the session: `.ci.cd.token.env` (copied by the user) into .gitignore; `default.profraw` (stray, untracked, Nov 26) deleted at the user's question; MIT license. | ||
| 569 | +- **Changes**: `local-ci-00…06.sh` + `.shellcheckrc` at the root (03–06 copied from mini-me; 02 rewritten: Mac Release build, signs bundles + rzb with hardened runtime, notarizes a zip of the folder, packages through `scripts/release.sh --products --out`, re-checks signatures and `rzb --version` on the unpacked archive); `scripts/release.sh` `--out`, LICENSE in the archive, INSTALL.txt depends on the signature; `scripts/check-hardened-runtime.sh`; `INSTALL.MACOS.md` / `.fr.md`; how-to package-a-release / preparer-une-release rewritten; README (status v1.0, Install section, layout, license); `.gitignore` (+ `.ci.cd.token.env`, `.release.env`, `/release/`); `.release.env` (TAG v1.0.0, RZB_* from SIDEKICKS_*); version 1.0.0 in Core, VersionCommand doc, CLI test, README, docs, diagram title; release notes `release-notes/v1.0.0.md` / `.fr.md`; skill `release` rewritten for razorbill; #52 tasks 1, 3, 4 closed + comment 1, task 2 open. | ||
| 570 | +- **Decisions**: keep the tar.gz (no pkg/Homebrew), notarize as zip, no staple possible; bundles signed too; no entitlements until the hardened-runtime check says otherwise; scripts at the root like mini-me; release notes keep razorbill's naming (`vX.Y.Z.md`, not `.en.md`); Xcode version recorded by step 02 in build-info.txt so 03 can run on Linux. | ||
| 571 | +- **Checks**: shellcheck clean on all scripts; doc links OK; dry runs: 03 notes (LOCAL_CI_PRINT_NOTES), 01 refuses a mismatched TAG, 02 refuses Linux. NOT run: unit tests (Swift toolchain broken in the sandbox: libxml2.so.16), swiftlint, quality gate (qlty absent), anything on the Mac (host runner down). | ||
| 572 | +- **Trap**: `git stash` breaks here — `sbxenv.yaml` is a busy mount, stash saved but reset half-failed and reverted tracked files; recovered with `git checkout stash@{0} -- <files but sbxenv.yaml>`. Do not use stash in this sandbox. | ||
| 573 | +- **Next**: user commits + pushes from the Mac, then `scripts/check-hardened-runtime.sh`, `local-ci-01…05` (06 optional). Milestone v1.0.0 stays open until #52 task 2 is confirmed. | ||
modified
.memory/summary.md +24 -0 | @@ -276,6 +276,21 @@ everything but MLX; Mac: `xcodebuild test -scheme razorbill`). Xcode scheme is ` | ||
| 276 | 276 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then |
| 277 | 277 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a |
| 278 | 278 | dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). |
| 279 | +**Published release chain (2026-11-27, for 1.0.0, copied from mini-me)**: `local-ci-00-common.sh` … | |
| 280 | +`local-ci-06-promote.sh` at the root. 01 = version check (TAG in `.release.env` must equal | |
| 281 | +`Razorbill.version`), swiftlint, `swift format lint -r Sources Tests`, `scripts/test.sh`; 02 (Mac only) = | |
| 282 | +Release build in `.build/release`, copy rzb + bundles to a temp folder, sign bundles then rzb | |
| 283 | +(hardened runtime, timestamp, identifier `com.bots-garden.rzb`, no entitlements) when | |
| 284 | +`RZB_SIGN_IDENTITY`/`RZB_NOTARY_PROFILE` are set, notarize a zip of the folder, then | |
| 285 | +`scripts/release.sh --products <folder> --out release/<TAG>`; output `release/<TAG>/` (git-ignored): | |
| 286 | +tar.gz, `SHA256SUMS`, README.md, build-info.txt, macos-signature.txt. 03–06 talk to the Rickub API | |
| 287 | +(`rickub.com/api/v1/repos/bots-garden/razorbill`) with `CI_TOKEN` from `.ci.cd.token.env` | |
| 288 | +(git-ignored, the user copied it): draft prerelease + tag, upload through a temporary branch whose | |
| 289 | +CI job uploads, publish (type the tag), promote. Notes text from `release-notes/<TAG>.md`. | |
| 290 | +`scripts/check-hardened-runtime.sh`: compat suite against an rzb signed with the hardened runtime. | |
| 291 | +User install guide: `INSTALL.MACOS.md` / `.fr.md` (folder in `/usr/local/lib/razorbill` + the | |
| 292 | +install.sh launcher). The `release` skill (.claude/skills/release) is now razorbill's. | |
| 293 | +License: MIT (`LICENSE`, 2026-11-27), shipped in the archive. | |
| 279 | 294 | **Install on the Mac**: `scripts/install.sh` (incremental Release build in `.build/xcode`, copies rzb + |
| 280 | 295 | bundles to `<prefix>/lib/razorbill`, writes a launcher `<prefix>/bin/rzb` that execs it — a copy of |
| 281 | 296 | rzb alone would not find its bundles; prefix `/usr/local`, sudo only if not writable; `--no-build`, |
| @@ -328,6 +343,15 @@ bump must be verified with the Mac smoke tests (real Qwen3): Linux cannot compil | ||
| 328 | 343 | |
| 329 | 344 | ## Not yet established |
| 330 | 345 | |
| 346 | +- The whole local-ci chain has not run yet (written 2026-11-27 in the sandbox; only shellcheck and | |
| 347 | + dry runs of 01's version check and 03's notes on Linux). Unknown: whether MLX works under the | |
| 348 | + hardened runtime (`scripts/check-hardened-runtime.sh`), whether notarization accepts the folder, | |
| 349 | + whether Rickub Actions runs the upload job for the razorbill repo, whether `CI_TOKEN` (copied from | |
| 350 | + mini-me) has rights on razorbill. | |
| 351 | +- 2026-11-27: in this sandbox `swift build`/`swift test` fail (`libxml2.so.16` missing; the image has | |
| 352 | + `.so.2`), swiftlint and qlty are not installed, and `swift format lint -r Sources Tests` prints 10 | |
| 353 | + warnings on files untouched since 0.3.0 (possibly another swift-format version than before). | |
| 354 | + | |
| 331 | 355 | - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through |
| 332 | 356 | `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6 |
| 333 | 357 | tok/s, instrumented build) is gone with the uninstrumented build (user: `test_qwen.py --runs 3 |
| @@ -276,6 +276,21 @@ everything but MLX; Mac: `xcodebuild test -scheme razorbill`). Xcode scheme is ` | |||
| 276 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then | 276 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then |
| 277 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a | 277 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a |
| 278 | dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). | 278 | dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). |
| 279 | +**Published release chain (2026-11-27, for 1.0.0, copied from mini-me)**: `local-ci-00-common.sh` … | ||
| 280 | +`local-ci-06-promote.sh` at the root. 01 = version check (TAG in `.release.env` must equal | ||
| 281 | +`Razorbill.version`), swiftlint, `swift format lint -r Sources Tests`, `scripts/test.sh`; 02 (Mac only) = | ||
| 282 | +Release build in `.build/release`, copy rzb + bundles to a temp folder, sign bundles then rzb | ||
| 283 | +(hardened runtime, timestamp, identifier `com.bots-garden.rzb`, no entitlements) when | ||
| 284 | +`RZB_SIGN_IDENTITY`/`RZB_NOTARY_PROFILE` are set, notarize a zip of the folder, then | ||
| 285 | +`scripts/release.sh --products <folder> --out release/<TAG>`; output `release/<TAG>/` (git-ignored): | ||
| 286 | +tar.gz, `SHA256SUMS`, README.md, build-info.txt, macos-signature.txt. 03–06 talk to the Rickub API | ||
| 287 | +(`rickub.com/api/v1/repos/bots-garden/razorbill`) with `CI_TOKEN` from `.ci.cd.token.env` | ||
| 288 | +(git-ignored, the user copied it): draft prerelease + tag, upload through a temporary branch whose | ||
| 289 | +CI job uploads, publish (type the tag), promote. Notes text from `release-notes/<TAG>.md`. | ||
| 290 | +`scripts/check-hardened-runtime.sh`: compat suite against an rzb signed with the hardened runtime. | ||
| 291 | +User install guide: `INSTALL.MACOS.md` / `.fr.md` (folder in `/usr/local/lib/razorbill` + the | ||
| 292 | +install.sh launcher). The `release` skill (.claude/skills/release) is now razorbill's. | ||
| 293 | +License: MIT (`LICENSE`, 2026-11-27), shipped in the archive. | ||
| 279 | **Install on the Mac**: `scripts/install.sh` (incremental Release build in `.build/xcode`, copies rzb + | 294 | **Install on the Mac**: `scripts/install.sh` (incremental Release build in `.build/xcode`, copies rzb + |
| 280 | bundles to `<prefix>/lib/razorbill`, writes a launcher `<prefix>/bin/rzb` that execs it — a copy of | 295 | bundles to `<prefix>/lib/razorbill`, writes a launcher `<prefix>/bin/rzb` that execs it — a copy of |
| 281 | rzb alone would not find its bundles; prefix `/usr/local`, sudo only if not writable; `--no-build`, | 296 | rzb alone would not find its bundles; prefix `/usr/local`, sudo only if not writable; `--no-build`, |
| @@ -328,6 +343,15 @@ bump must be verified with the Mac smoke tests (real Qwen3): Linux cannot compil | |||
| 328 | 343 | ||
| 329 | ## Not yet established | 344 | ## Not yet established |
| 330 | 345 | ||
| 346 | +- The whole local-ci chain has not run yet (written 2026-11-27 in the sandbox; only shellcheck and | ||
| 347 | + dry runs of 01's version check and 03's notes on Linux). Unknown: whether MLX works under the | ||
| 348 | + hardened runtime (`scripts/check-hardened-runtime.sh`), whether notarization accepts the folder, | ||
| 349 | + whether Rickub Actions runs the upload job for the razorbill repo, whether `CI_TOKEN` (copied from | ||
| 350 | + mini-me) has rights on razorbill. | ||
| 351 | +- 2026-11-27: in this sandbox `swift build`/`swift test` fail (`libxml2.so.16` missing; the image has | ||
| 352 | + `.so.2`), swiftlint and qlty are not installed, and `swift format lint -r Sources Tests` prints 10 | ||
| 353 | + warnings on files untouched since 0.3.0 (possibly another swift-format version than before). | ||
| 354 | + | ||
| 331 | - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through | 355 | - `rzb serve` on the Mac answers over HTTP (user, 2026-11-26: Qwen3.5-9B-MLX-4bit streamed through |
| 332 | `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6 | 356 | `demos/test-qwen`, ~15–20 tok/s, reasoning ok). The speed drop across runs (20.1 → 18.3 → 14.6 |
| 333 | tok/s, instrumented build) is gone with the uninstrumented build (user: `test_qwen.py --runs 3 | 357 | tok/s, instrumented build) is gone with the uninstrumented build (user: `test_qwen.py --runs 3 |
added
.shellcheckrc +3 -0 | new file mode 100644 | ||
| @@ -0,0 +1,3 @@ | ||
| 1 | +# Follow sourced files (release.env) instead of reporting SC1091 for them. | |
| 2 | +external-sources=true | |
| 3 | +source-path=SCRIPTDIR | |
| new file mode 100644 | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | +# Follow sourced files (release.env) instead of reporting SC1091 for them. | ||
| 2 | +external-sources=true | ||
| 3 | +source-path=SCRIPTDIR | ||
modified
.tickets/issues/0052-sign-and-notarize-the-rzb-release.yaml +19 -5 | @@ -6,7 +6,7 @@ author: | ||
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-26T06:00:00.000Z |
| 9 | -updatedAt: 2026-11-26T06:00:00.000Z | |
| 9 | +updatedAt: 2026-11-27T12:00:00.000Z | |
| 10 | 10 | labels: |
| 11 | 11 | - "kind::feature" |
| 12 | 12 | - "area::build" |
| @@ -31,7 +31,8 @@ body: | | ||
| 31 | 31 | tasks: |
| 32 | 32 | - id: 1 |
| 33 | 33 | title: "Decide the distribution format (zip, pkg, Homebrew)" |
| 34 | - state: open | |
| 34 | + state: closed | |
| 35 | + closedAt: 2026-11-27T12:00:00.000Z | |
| 35 | 36 | priority: high |
| 36 | 37 | author: |
| 37 | 38 | name: k33g |
| @@ -47,7 +48,8 @@ tasks: | ||
| 47 | 48 | createdAt: 2026-11-26T06:00:00.000Z |
| 48 | 49 | - id: 3 |
| 49 | 50 | title: "Notarize (and staple if the format allows) from scripts/release.sh" |
| 50 | - state: open | |
| 51 | + state: closed | |
| 52 | + closedAt: 2026-11-27T12:00:00.000Z | |
| 51 | 53 | priority: medium |
| 52 | 54 | author: |
| 53 | 55 | name: k33g |
| @@ -55,10 +57,22 @@ tasks: | ||
| 55 | 57 | createdAt: 2026-11-26T06:00:00.000Z |
| 56 | 58 | - id: 4 |
| 57 | 59 | title: "Update the install and release docs (EN + FR)" |
| 58 | - state: open | |
| 60 | + state: closed | |
| 61 | + closedAt: 2026-11-27T12:00:00.000Z | |
| 59 | 62 | priority: medium |
| 60 | 63 | author: |
| 61 | 64 | name: k33g |
| 62 | 65 | email: ph.charriere@gmail.com |
| 63 | 66 | createdAt: 2026-11-26T06:00:00.000Z |
| 64 | -comments: [] | |
| 67 | +comments: | |
| 68 | + - id: 1 | |
| 69 | + author: | |
| 70 | + name: k33g | |
| 71 | + email: ph.charriere@gmail.com | |
| 72 | + createdAt: 2026-11-27T12:00:00.000Z | |
| 73 | + body: | | |
| 74 | + Done in the sandbox (not run on the Mac yet), after the user asked for "the same local CI as mini-me" for 1.0.0: | |
| 75 | + - Format (task 1): the same tar.gz as before (`razorbill-<version>-macos-arm64.tar.gz` + `SHA256SUMS`), published on Rickub like mini-me's binaries. No pkg / Homebrew. The folder is notarized as a zip (notarytool refuses tar.gz); nothing can be stapled, so Gatekeeper checks online on first run. | |
| 76 | + - Signing + notarization (task 3): `local-ci-02-build.sh` (not `scripts/release.sh --sign`): Release build, copy of rzb + bundles in a temp folder, bundles signed (resources only, no runtime), rzb signed `--options runtime --timestamp --identifier com.bots-garden.rzb`, checks, `notarytool submit --wait`, then `scripts/release.sh --products <signed folder> --out release/<TAG>`, signatures re-checked on the unpacked archive. RZB_SIGN_IDENTITY / RZB_NOTARY_PROFILE in `.release.env` (default: the SIDEKICKS_* variables). Steps 03–06 copied from mini-me (draft, upload through a temporary branch + CI job, publish, promote). | |
| 77 | + - Docs (task 4): INSTALL.MACOS.md / .fr.md, docs how-to package-a-release / preparer-une-release rewritten. | |
| 78 | + - Task 2 stays open: `scripts/check-hardened-runtime.sh` (compat suite against an rzb signed with the hardened runtime) has not run on the Mac. No entitlement was added; add one only if that check fails. | |
| @@ -6,7 +6,7 @@ author: | |||
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-26T06:00:00.000Z | 8 | createdAt: 2026-11-26T06:00:00.000Z |
| 9 | -updatedAt: 2026-11-26T06:00:00.000Z | 9 | +updatedAt: 2026-11-27T12:00:00.000Z |
| 10 | labels: | 10 | labels: |
| 11 | - "kind::feature" | 11 | - "kind::feature" |
| 12 | - "area::build" | 12 | - "area::build" |
| @@ -31,7 +31,8 @@ body: | | |||
| 31 | tasks: | 31 | tasks: |
| 32 | - id: 1 | 32 | - id: 1 |
| 33 | title: "Decide the distribution format (zip, pkg, Homebrew)" | 33 | title: "Decide the distribution format (zip, pkg, Homebrew)" |
| 34 | - state: open | 34 | + state: closed |
| 35 | + closedAt: 2026-11-27T12:00:00.000Z | ||
| 35 | priority: high | 36 | priority: high |
| 36 | author: | 37 | author: |
| 37 | name: k33g | 38 | name: k33g |
| @@ -47,7 +48,8 @@ tasks: | |||
| 47 | createdAt: 2026-11-26T06:00:00.000Z | 48 | createdAt: 2026-11-26T06:00:00.000Z |
| 48 | - id: 3 | 49 | - id: 3 |
| 49 | title: "Notarize (and staple if the format allows) from scripts/release.sh" | 50 | title: "Notarize (and staple if the format allows) from scripts/release.sh" |
| 50 | - state: open | 51 | + state: closed |
| 52 | + closedAt: 2026-11-27T12:00:00.000Z | ||
| 51 | priority: medium | 53 | priority: medium |
| 52 | author: | 54 | author: |
| 53 | name: k33g | 55 | name: k33g |
| @@ -55,10 +57,22 @@ tasks: | |||
| 55 | createdAt: 2026-11-26T06:00:00.000Z | 57 | createdAt: 2026-11-26T06:00:00.000Z |
| 56 | - id: 4 | 58 | - id: 4 |
| 57 | title: "Update the install and release docs (EN + FR)" | 59 | title: "Update the install and release docs (EN + FR)" |
| 58 | - state: open | 60 | + state: closed |
| 61 | + closedAt: 2026-11-27T12:00:00.000Z | ||
| 59 | priority: medium | 62 | priority: medium |
| 60 | author: | 63 | author: |
| 61 | name: k33g | 64 | name: k33g |
| 62 | email: ph.charriere@gmail.com | 65 | email: ph.charriere@gmail.com |
| 63 | createdAt: 2026-11-26T06:00:00.000Z | 66 | createdAt: 2026-11-26T06:00:00.000Z |
| 64 | -comments: [] | 67 | +comments: |
| 68 | + - id: 1 | ||
| 69 | + author: | ||
| 70 | + name: k33g | ||
| 71 | + email: ph.charriere@gmail.com | ||
| 72 | + createdAt: 2026-11-27T12:00:00.000Z | ||
| 73 | + body: | | ||
| 74 | + Done in the sandbox (not run on the Mac yet), after the user asked for "the same local CI as mini-me" for 1.0.0: | ||
| 75 | + - Format (task 1): the same tar.gz as before (`razorbill-<version>-macos-arm64.tar.gz` + `SHA256SUMS`), published on Rickub like mini-me's binaries. No pkg / Homebrew. The folder is notarized as a zip (notarytool refuses tar.gz); nothing can be stapled, so Gatekeeper checks online on first run. | ||
| 76 | + - Signing + notarization (task 3): `local-ci-02-build.sh` (not `scripts/release.sh --sign`): Release build, copy of rzb + bundles in a temp folder, bundles signed (resources only, no runtime), rzb signed `--options runtime --timestamp --identifier com.bots-garden.rzb`, checks, `notarytool submit --wait`, then `scripts/release.sh --products <signed folder> --out release/<TAG>`, signatures re-checked on the unpacked archive. RZB_SIGN_IDENTITY / RZB_NOTARY_PROFILE in `.release.env` (default: the SIDEKICKS_* variables). Steps 03–06 copied from mini-me (draft, upload through a temporary branch + CI job, publish, promote). | ||
| 77 | + - Docs (task 4): INSTALL.MACOS.md / .fr.md, docs how-to package-a-release / preparer-une-release rewritten. | ||
| 78 | + - Task 2 stays open: `scripts/check-hardened-runtime.sh` (compat suite against an rzb signed with the hardened runtime) has not run on the Mac. No entitlement was added; add one only if that check fails. | ||
added
INSTALL.MACOS.fr.md +99 -0 | new file mode 100644 | ||
| @@ -0,0 +1,99 @@ | ||
| 1 | +# Installer `rzb` sur macOS | |
| 2 | + | |
| 3 | +*[English version](INSTALL.MACOS.md)* | |
| 4 | + | |
| 5 | +razorbill fonctionne uniquement sur **macOS 14 ou plus récent, sur Apple Silicon** (M1 ou plus récent) : il fait tourner ses modèles sur le GPU avec MLX. | |
| 6 | + | |
| 7 | +Version courte : | |
| 8 | + | |
| 9 | +```bash | |
| 10 | +VERSION=1.0.0 | |
| 11 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | |
| 12 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | |
| 13 | +sudo mkdir -p /usr/local/lib /usr/local/bin | |
| 14 | +sudo rm -rf /usr/local/lib/razorbill | |
| 15 | +sudo mv razorbill-${VERSION}-macos-arm64 /usr/local/lib/razorbill | |
| 16 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | |
| 17 | +sudo chmod 755 /usr/local/bin/rzb | |
| 18 | +rzb version | |
| 19 | +``` | |
| 20 | + | |
| 21 | +## Pourquoi un dossier et un lanceur | |
| 22 | + | |
| 23 | +L'archive contient un dossier, pas un binaire seul : `rzb` et les bundles de ressources qu'il charge à l'exécution depuis son propre dossier (`mlx-swift_Cmlx.bundle` est la bibliothèque Metal de MLX ; sans lui, aucun modèle ne se charge). Le dossier va donc entier dans `/usr/local/lib/razorbill`, et `/usr/local/bin/rzb` est un script de deux lignes qui lance `rzb` depuis là. Copier `rzb` seul dans `/usr/local/bin` ne fonctionne pas. | |
| 24 | + | |
| 25 | +Le lanceur est le même que celui qu'écrit `scripts/install.sh` depuis les sources, avec la même ligne repère : `scripts/install.sh --uninstall` retire l'une ou l'autre installation. | |
| 26 | + | |
| 27 | +## Vérifier le téléchargement d'abord | |
| 28 | + | |
| 29 | +Depuis la 1.0.0, `rzb` est signé avec un Developer ID et notarisé par Apple, et ses bundles sont signés eux aussi. Vous pouvez vérifier le téléchargement et son signataire avant de l'installer : | |
| 30 | + | |
| 31 | +```bash | |
| 32 | +VERSION=1.0.0 | |
| 33 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | |
| 34 | + | |
| 35 | +# l'empreinte publiée avec la release | |
| 36 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/SHA256SUMS" | |
| 37 | +shasum -a 256 -c SHA256SUMS | |
| 38 | + | |
| 39 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | |
| 40 | +cd razorbill-${VERSION}-macos-arm64 | |
| 41 | + | |
| 42 | +# la signature : valide, et faite par le Developer ID de bots-garden | |
| 43 | +codesign --verify --strict --verbose=2 ./rzb | |
| 44 | +codesign -dv --verbose=4 ./rzb 2>&1 | grep -E "^Identifier|^Authority=Developer ID Application|^TeamIdentifier" | |
| 45 | +for bundle in *.bundle; do codesign --verify --strict "$bundle" && echo "$bundle: sealed"; done | |
| 46 | + | |
| 47 | +./rzb --version | |
| 48 | +cd .. | |
| 49 | +``` | |
| 50 | + | |
| 51 | +Installez ensuite le dossier comme dans la version courte (à partir de `sudo mkdir`). | |
| 52 | + | |
| 53 | +La vérification de la signature doit afficher : | |
| 54 | + | |
| 55 | +``` | |
| 56 | +./rzb: valid on disk | |
| 57 | +./rzb: satisfies its Designated Requirement | |
| 58 | +Identifier=com.bots-garden.rzb | |
| 59 | +Authority=Developer ID Application: Philippe Charriere (SNLLBZP9V9) | |
| 60 | +TeamIdentifier=SNLLBZP9V9 | |
| 61 | +``` | |
| 62 | + | |
| 63 | +Téléchargée **avec un navigateur** plutôt qu'avec `curl`, l'archive porte l'attribut de quarantaine, et les fichiers décompressés peuvent le porter aussi : macOS vérifie la notarisation en ligne au premier lancement de `rzb` (ce premier lancement demande donc le réseau), puis le lance sans rien demander. Pas besoin de `xattr`. | |
| 64 | + | |
| 65 | +## Sans sudo | |
| 66 | + | |
| 67 | +N'importe quel dossier qui vous appartient convient. Par exemple, dans votre dossier personnel : | |
| 68 | + | |
| 69 | +```bash | |
| 70 | +mkdir -p ~/.local/lib ~/.local/bin | |
| 71 | +rm -rf ~/.local/lib/razorbill | |
| 72 | +mv razorbill-${VERSION}-macos-arm64 ~/.local/lib/razorbill | |
| 73 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "%s/rzb" "$@"\n' "$HOME/.local/lib/razorbill" > ~/.local/bin/rzb | |
| 74 | +chmod 755 ~/.local/bin/rzb | |
| 75 | +``` | |
| 76 | + | |
| 77 | +`~/.local/bin` doit alors être dans votre `PATH` (ajoutez `export PATH="$HOME/.local/bin:$PATH"` à `~/.zshrc`). | |
| 78 | + | |
| 79 | +## Mettre à jour et désinstaller | |
| 80 | + | |
| 81 | +- **Mettre à jour** : relancez la version courte avec la nouvelle `VERSION`. Elle remplace le dossier entier : aucun bundle de l'ancienne version ne reste. Vos modèles (`~/.cache/huggingface`) et réglages (`~/.config/razorbill`) ne sont pas touchés. | |
| 82 | +- **Désinstaller** : `sudo rm -rf /usr/local/lib/razorbill /usr/local/bin/rzb`. Les modèles restent dans le cache Hugging Face : retirez-les d'abord avec `rzb models rm <modèle>` pour récupérer la place. | |
| 83 | + | |
| 84 | +## Ensuite | |
| 85 | + | |
| 86 | +```bash | |
| 87 | +rzb models pull mlx-community/Qwen3-0.6B-4bit | |
| 88 | +rzb serve | |
| 89 | +``` | |
| 90 | + | |
| 91 | +Puis suivez [Premiers pas](docs/fr/tutorials/premiers-pas.md). | |
| 92 | + | |
| 93 | +## Archives d'avant la 1.0.0 (non signées) | |
| 94 | + | |
| 95 | +Les archives 0.2.0 et 0.3.0 n'avaient que la signature ad hoc que l'éditeur de liens donne à tout binaire Apple Silicon. Une copie mise en quarantaine par macOS (un téléchargement par navigateur, par exemple) était bloquée au premier lancement. Levez la quarantaine d'un tel dossier avant de le lancer : | |
| 96 | + | |
| 97 | +```bash | |
| 98 | +xattr -dr com.apple.quarantine /usr/local/lib/razorbill | |
| 99 | +``` | |
| new file mode 100644 | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | +# Installer `rzb` sur macOS | ||
| 2 | + | ||
| 3 | +*[English version](INSTALL.MACOS.md)* | ||
| 4 | + | ||
| 5 | +razorbill fonctionne uniquement sur **macOS 14 ou plus récent, sur Apple Silicon** (M1 ou plus récent) : il fait tourner ses modèles sur le GPU avec MLX. | ||
| 6 | + | ||
| 7 | +Version courte : | ||
| 8 | + | ||
| 9 | +```bash | ||
| 10 | +VERSION=1.0.0 | ||
| 11 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | ||
| 12 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | ||
| 13 | +sudo mkdir -p /usr/local/lib /usr/local/bin | ||
| 14 | +sudo rm -rf /usr/local/lib/razorbill | ||
| 15 | +sudo mv razorbill-${VERSION}-macos-arm64 /usr/local/lib/razorbill | ||
| 16 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | ||
| 17 | +sudo chmod 755 /usr/local/bin/rzb | ||
| 18 | +rzb version | ||
| 19 | +``` | ||
| 20 | + | ||
| 21 | +## Pourquoi un dossier et un lanceur | ||
| 22 | + | ||
| 23 | +L'archive contient un dossier, pas un binaire seul : `rzb` et les bundles de ressources qu'il charge à l'exécution depuis son propre dossier (`mlx-swift_Cmlx.bundle` est la bibliothèque Metal de MLX ; sans lui, aucun modèle ne se charge). Le dossier va donc entier dans `/usr/local/lib/razorbill`, et `/usr/local/bin/rzb` est un script de deux lignes qui lance `rzb` depuis là. Copier `rzb` seul dans `/usr/local/bin` ne fonctionne pas. | ||
| 24 | + | ||
| 25 | +Le lanceur est le même que celui qu'écrit `scripts/install.sh` depuis les sources, avec la même ligne repère : `scripts/install.sh --uninstall` retire l'une ou l'autre installation. | ||
| 26 | + | ||
| 27 | +## Vérifier le téléchargement d'abord | ||
| 28 | + | ||
| 29 | +Depuis la 1.0.0, `rzb` est signé avec un Developer ID et notarisé par Apple, et ses bundles sont signés eux aussi. Vous pouvez vérifier le téléchargement et son signataire avant de l'installer : | ||
| 30 | + | ||
| 31 | +```bash | ||
| 32 | +VERSION=1.0.0 | ||
| 33 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | ||
| 34 | + | ||
| 35 | +# l'empreinte publiée avec la release | ||
| 36 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/SHA256SUMS" | ||
| 37 | +shasum -a 256 -c SHA256SUMS | ||
| 38 | + | ||
| 39 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | ||
| 40 | +cd razorbill-${VERSION}-macos-arm64 | ||
| 41 | + | ||
| 42 | +# la signature : valide, et faite par le Developer ID de bots-garden | ||
| 43 | +codesign --verify --strict --verbose=2 ./rzb | ||
| 44 | +codesign -dv --verbose=4 ./rzb 2>&1 | grep -E "^Identifier|^Authority=Developer ID Application|^TeamIdentifier" | ||
| 45 | +for bundle in *.bundle; do codesign --verify --strict "$bundle" && echo "$bundle: sealed"; done | ||
| 46 | + | ||
| 47 | +./rzb --version | ||
| 48 | +cd .. | ||
| 49 | +``` | ||
| 50 | + | ||
| 51 | +Installez ensuite le dossier comme dans la version courte (à partir de `sudo mkdir`). | ||
| 52 | + | ||
| 53 | +La vérification de la signature doit afficher : | ||
| 54 | + | ||
| 55 | +``` | ||
| 56 | +./rzb: valid on disk | ||
| 57 | +./rzb: satisfies its Designated Requirement | ||
| 58 | +Identifier=com.bots-garden.rzb | ||
| 59 | +Authority=Developer ID Application: Philippe Charriere (SNLLBZP9V9) | ||
| 60 | +TeamIdentifier=SNLLBZP9V9 | ||
| 61 | +``` | ||
| 62 | + | ||
| 63 | +Téléchargée **avec un navigateur** plutôt qu'avec `curl`, l'archive porte l'attribut de quarantaine, et les fichiers décompressés peuvent le porter aussi : macOS vérifie la notarisation en ligne au premier lancement de `rzb` (ce premier lancement demande donc le réseau), puis le lance sans rien demander. Pas besoin de `xattr`. | ||
| 64 | + | ||
| 65 | +## Sans sudo | ||
| 66 | + | ||
| 67 | +N'importe quel dossier qui vous appartient convient. Par exemple, dans votre dossier personnel : | ||
| 68 | + | ||
| 69 | +```bash | ||
| 70 | +mkdir -p ~/.local/lib ~/.local/bin | ||
| 71 | +rm -rf ~/.local/lib/razorbill | ||
| 72 | +mv razorbill-${VERSION}-macos-arm64 ~/.local/lib/razorbill | ||
| 73 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "%s/rzb" "$@"\n' "$HOME/.local/lib/razorbill" > ~/.local/bin/rzb | ||
| 74 | +chmod 755 ~/.local/bin/rzb | ||
| 75 | +``` | ||
| 76 | + | ||
| 77 | +`~/.local/bin` doit alors être dans votre `PATH` (ajoutez `export PATH="$HOME/.local/bin:$PATH"` à `~/.zshrc`). | ||
| 78 | + | ||
| 79 | +## Mettre à jour et désinstaller | ||
| 80 | + | ||
| 81 | +- **Mettre à jour** : relancez la version courte avec la nouvelle `VERSION`. Elle remplace le dossier entier : aucun bundle de l'ancienne version ne reste. Vos modèles (`~/.cache/huggingface`) et réglages (`~/.config/razorbill`) ne sont pas touchés. | ||
| 82 | +- **Désinstaller** : `sudo rm -rf /usr/local/lib/razorbill /usr/local/bin/rzb`. Les modèles restent dans le cache Hugging Face : retirez-les d'abord avec `rzb models rm <modèle>` pour récupérer la place. | ||
| 83 | + | ||
| 84 | +## Ensuite | ||
| 85 | + | ||
| 86 | +```bash | ||
| 87 | +rzb models pull mlx-community/Qwen3-0.6B-4bit | ||
| 88 | +rzb serve | ||
| 89 | +``` | ||
| 90 | + | ||
| 91 | +Puis suivez [Premiers pas](docs/fr/tutorials/premiers-pas.md). | ||
| 92 | + | ||
| 93 | +## Archives d'avant la 1.0.0 (non signées) | ||
| 94 | + | ||
| 95 | +Les archives 0.2.0 et 0.3.0 n'avaient que la signature ad hoc que l'éditeur de liens donne à tout binaire Apple Silicon. Une copie mise en quarantaine par macOS (un téléchargement par navigateur, par exemple) était bloquée au premier lancement. Levez la quarantaine d'un tel dossier avant de le lancer : | ||
| 96 | + | ||
| 97 | +```bash | ||
| 98 | +xattr -dr com.apple.quarantine /usr/local/lib/razorbill | ||
| 99 | +``` | ||
added
INSTALL.MACOS.md +99 -0 | new file mode 100644 | ||
| @@ -0,0 +1,99 @@ | ||
| 1 | +# Install `rzb` on macOS | |
| 2 | + | |
| 3 | +*[Version française](INSTALL.MACOS.fr.md)* | |
| 4 | + | |
| 5 | +razorbill runs on **macOS 14 or later, on Apple Silicon** (M1 or newer) only: it runs its models on the GPU with MLX. | |
| 6 | + | |
| 7 | +Short version: | |
| 8 | + | |
| 9 | +```bash | |
| 10 | +VERSION=1.0.0 | |
| 11 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | |
| 12 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | |
| 13 | +sudo mkdir -p /usr/local/lib /usr/local/bin | |
| 14 | +sudo rm -rf /usr/local/lib/razorbill | |
| 15 | +sudo mv razorbill-${VERSION}-macos-arm64 /usr/local/lib/razorbill | |
| 16 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | |
| 17 | +sudo chmod 755 /usr/local/bin/rzb | |
| 18 | +rzb version | |
| 19 | +``` | |
| 20 | + | |
| 21 | +## Why a folder and a launcher | |
| 22 | + | |
| 23 | +The archive holds a folder, not a lone binary: `rzb` and the resource bundles it loads at run time from its own folder (`mlx-swift_Cmlx.bundle` is the MLX Metal library; without it no model loads). So the folder goes to `/usr/local/lib/razorbill` as a whole, and `/usr/local/bin/rzb` is a two-line script that runs `rzb` from there. Copying `rzb` alone into `/usr/local/bin` does not work. | |
| 24 | + | |
| 25 | +The launcher is the same as the one `scripts/install.sh` writes from the sources, with the same marker line: `scripts/install.sh --uninstall` removes either install. | |
| 26 | + | |
| 27 | +## Checking the download first | |
| 28 | + | |
| 29 | +From 1.0.0, `rzb` is signed with a Developer ID and notarized by Apple, and its bundles are signed too. You can check the download and who signed it before you install it: | |
| 30 | + | |
| 31 | +```bash | |
| 32 | +VERSION=1.0.0 | |
| 33 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | |
| 34 | + | |
| 35 | +# the checksum published with the release | |
| 36 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/SHA256SUMS" | |
| 37 | +shasum -a 256 -c SHA256SUMS | |
| 38 | + | |
| 39 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | |
| 40 | +cd razorbill-${VERSION}-macos-arm64 | |
| 41 | + | |
| 42 | +# the signature: valid, and made by the bots-garden Developer ID | |
| 43 | +codesign --verify --strict --verbose=2 ./rzb | |
| 44 | +codesign -dv --verbose=4 ./rzb 2>&1 | grep -E "^Identifier|^Authority=Developer ID Application|^TeamIdentifier" | |
| 45 | +for bundle in *.bundle; do codesign --verify --strict "$bundle" && echo "$bundle: sealed"; done | |
| 46 | + | |
| 47 | +./rzb --version | |
| 48 | +cd .. | |
| 49 | +``` | |
| 50 | + | |
| 51 | +Then install the folder as in the short version (from `sudo mkdir` on). | |
| 52 | + | |
| 53 | +The signature check should print: | |
| 54 | + | |
| 55 | +``` | |
| 56 | +./rzb: valid on disk | |
| 57 | +./rzb: satisfies its Designated Requirement | |
| 58 | +Identifier=com.bots-garden.rzb | |
| 59 | +Authority=Developer ID Application: Philippe Charriere (SNLLBZP9V9) | |
| 60 | +TeamIdentifier=SNLLBZP9V9 | |
| 61 | +``` | |
| 62 | + | |
| 63 | +Downloaded **with a browser** instead of `curl`, the archive carries the quarantine attribute, and so may the unpacked files: macOS checks the notarization online the first time `rzb` runs (that first run needs the network), then runs it without asking. There is no need for `xattr`. | |
| 64 | + | |
| 65 | +## Without sudo | |
| 66 | + | |
| 67 | +Any folder you own works. For example, in your home folder: | |
| 68 | + | |
| 69 | +```bash | |
| 70 | +mkdir -p ~/.local/lib ~/.local/bin | |
| 71 | +rm -rf ~/.local/lib/razorbill | |
| 72 | +mv razorbill-${VERSION}-macos-arm64 ~/.local/lib/razorbill | |
| 73 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "%s/rzb" "$@"\n' "$HOME/.local/lib/razorbill" > ~/.local/bin/rzb | |
| 74 | +chmod 755 ~/.local/bin/rzb | |
| 75 | +``` | |
| 76 | + | |
| 77 | +`~/.local/bin` must then be on your `PATH` (add `export PATH="$HOME/.local/bin:$PATH"` to `~/.zshrc`). | |
| 78 | + | |
| 79 | +## Upgrading and uninstalling | |
| 80 | + | |
| 81 | +- **Upgrade**: run the short version again with the new `VERSION`. It replaces the whole folder, so no bundle of the old version stays behind. Your models (`~/.cache/huggingface`) and settings (`~/.config/razorbill`) are not touched. | |
| 82 | +- **Uninstall**: `sudo rm -rf /usr/local/lib/razorbill /usr/local/bin/rzb`. The models stay in the Hugging Face cache: remove them first with `rzb models rm <model>` if you want the disk space back. | |
| 83 | + | |
| 84 | +## Next | |
| 85 | + | |
| 86 | +```bash | |
| 87 | +rzb models pull mlx-community/Qwen3-0.6B-4bit | |
| 88 | +rzb serve | |
| 89 | +``` | |
| 90 | + | |
| 91 | +Then follow [Getting started](docs/en/tutorials/getting-started.md). | |
| 92 | + | |
| 93 | +## Archives before 1.0.0 (not signed) | |
| 94 | + | |
| 95 | +The 0.2.0 and 0.3.0 archives only had the ad hoc signature the linker gives every Apple Silicon binary. A copy that macOS had put in quarantine (a browser download, for example) was blocked at its first run. Clear the quarantine of such a folder before running it: | |
| 96 | + | |
| 97 | +```bash | |
| 98 | +xattr -dr com.apple.quarantine /usr/local/lib/razorbill | |
| 99 | +``` | |
| new file mode 100644 | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | +# Install `rzb` on macOS | ||
| 2 | + | ||
| 3 | +*[Version française](INSTALL.MACOS.fr.md)* | ||
| 4 | + | ||
| 5 | +razorbill runs on **macOS 14 or later, on Apple Silicon** (M1 or newer) only: it runs its models on the GPU with MLX. | ||
| 6 | + | ||
| 7 | +Short version: | ||
| 8 | + | ||
| 9 | +```bash | ||
| 10 | +VERSION=1.0.0 | ||
| 11 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | ||
| 12 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | ||
| 13 | +sudo mkdir -p /usr/local/lib /usr/local/bin | ||
| 14 | +sudo rm -rf /usr/local/lib/razorbill | ||
| 15 | +sudo mv razorbill-${VERSION}-macos-arm64 /usr/local/lib/razorbill | ||
| 16 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | ||
| 17 | +sudo chmod 755 /usr/local/bin/rzb | ||
| 18 | +rzb version | ||
| 19 | +``` | ||
| 20 | + | ||
| 21 | +## Why a folder and a launcher | ||
| 22 | + | ||
| 23 | +The archive holds a folder, not a lone binary: `rzb` and the resource bundles it loads at run time from its own folder (`mlx-swift_Cmlx.bundle` is the MLX Metal library; without it no model loads). So the folder goes to `/usr/local/lib/razorbill` as a whole, and `/usr/local/bin/rzb` is a two-line script that runs `rzb` from there. Copying `rzb` alone into `/usr/local/bin` does not work. | ||
| 24 | + | ||
| 25 | +The launcher is the same as the one `scripts/install.sh` writes from the sources, with the same marker line: `scripts/install.sh --uninstall` removes either install. | ||
| 26 | + | ||
| 27 | +## Checking the download first | ||
| 28 | + | ||
| 29 | +From 1.0.0, `rzb` is signed with a Developer ID and notarized by Apple, and its bundles are signed too. You can check the download and who signed it before you install it: | ||
| 30 | + | ||
| 31 | +```bash | ||
| 32 | +VERSION=1.0.0 | ||
| 33 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/razorbill-${VERSION}-macos-arm64.tar.gz" | ||
| 34 | + | ||
| 35 | +# the checksum published with the release | ||
| 36 | +curl -fsSLO "https://rickub.com/bots-garden/razorbill/releases/download/v${VERSION}/SHA256SUMS" | ||
| 37 | +shasum -a 256 -c SHA256SUMS | ||
| 38 | + | ||
| 39 | +tar -xzf razorbill-${VERSION}-macos-arm64.tar.gz | ||
| 40 | +cd razorbill-${VERSION}-macos-arm64 | ||
| 41 | + | ||
| 42 | +# the signature: valid, and made by the bots-garden Developer ID | ||
| 43 | +codesign --verify --strict --verbose=2 ./rzb | ||
| 44 | +codesign -dv --verbose=4 ./rzb 2>&1 | grep -E "^Identifier|^Authority=Developer ID Application|^TeamIdentifier" | ||
| 45 | +for bundle in *.bundle; do codesign --verify --strict "$bundle" && echo "$bundle: sealed"; done | ||
| 46 | + | ||
| 47 | +./rzb --version | ||
| 48 | +cd .. | ||
| 49 | +``` | ||
| 50 | + | ||
| 51 | +Then install the folder as in the short version (from `sudo mkdir` on). | ||
| 52 | + | ||
| 53 | +The signature check should print: | ||
| 54 | + | ||
| 55 | +``` | ||
| 56 | +./rzb: valid on disk | ||
| 57 | +./rzb: satisfies its Designated Requirement | ||
| 58 | +Identifier=com.bots-garden.rzb | ||
| 59 | +Authority=Developer ID Application: Philippe Charriere (SNLLBZP9V9) | ||
| 60 | +TeamIdentifier=SNLLBZP9V9 | ||
| 61 | +``` | ||
| 62 | + | ||
| 63 | +Downloaded **with a browser** instead of `curl`, the archive carries the quarantine attribute, and so may the unpacked files: macOS checks the notarization online the first time `rzb` runs (that first run needs the network), then runs it without asking. There is no need for `xattr`. | ||
| 64 | + | ||
| 65 | +## Without sudo | ||
| 66 | + | ||
| 67 | +Any folder you own works. For example, in your home folder: | ||
| 68 | + | ||
| 69 | +```bash | ||
| 70 | +mkdir -p ~/.local/lib ~/.local/bin | ||
| 71 | +rm -rf ~/.local/lib/razorbill | ||
| 72 | +mv razorbill-${VERSION}-macos-arm64 ~/.local/lib/razorbill | ||
| 73 | +printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "%s/rzb" "$@"\n' "$HOME/.local/lib/razorbill" > ~/.local/bin/rzb | ||
| 74 | +chmod 755 ~/.local/bin/rzb | ||
| 75 | +``` | ||
| 76 | + | ||
| 77 | +`~/.local/bin` must then be on your `PATH` (add `export PATH="$HOME/.local/bin:$PATH"` to `~/.zshrc`). | ||
| 78 | + | ||
| 79 | +## Upgrading and uninstalling | ||
| 80 | + | ||
| 81 | +- **Upgrade**: run the short version again with the new `VERSION`. It replaces the whole folder, so no bundle of the old version stays behind. Your models (`~/.cache/huggingface`) and settings (`~/.config/razorbill`) are not touched. | ||
| 82 | +- **Uninstall**: `sudo rm -rf /usr/local/lib/razorbill /usr/local/bin/rzb`. The models stay in the Hugging Face cache: remove them first with `rzb models rm <model>` if you want the disk space back. | ||
| 83 | + | ||
| 84 | +## Next | ||
| 85 | + | ||
| 86 | +```bash | ||
| 87 | +rzb models pull mlx-community/Qwen3-0.6B-4bit | ||
| 88 | +rzb serve | ||
| 89 | +``` | ||
| 90 | + | ||
| 91 | +Then follow [Getting started](docs/en/tutorials/getting-started.md). | ||
| 92 | + | ||
| 93 | +## Archives before 1.0.0 (not signed) | ||
| 94 | + | ||
| 95 | +The 0.2.0 and 0.3.0 archives only had the ad hoc signature the linker gives every Apple Silicon binary. A copy that macOS had put in quarantine (a browser download, for example) was blocked at its first run. Clear the quarantine of such a folder before running it: | ||
| 96 | + | ||
| 97 | +```bash | ||
| 98 | +xattr -dr com.apple.quarantine /usr/local/lib/razorbill | ||
| 99 | +``` | ||
added
LICENSE +23 -0 | new file mode 100644 | ||
| @@ -0,0 +1,23 @@ | ||
| 1 | +MIT License | |
| 2 | + | |
| 3 | +razorbill — https://rickub.com/bots-garden/razorbill | |
| 4 | + | |
| 5 | +Copyright (c) 2026 k33g (Philippe Charrière) and the bots-garden organization | |
| 6 | + | |
| 7 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 8 | +of this software and associated documentation files (the "Software"), to deal | |
| 9 | +in the Software without restriction, including without limitation the rights | |
| 10 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 11 | +copies of the Software, and to permit persons to whom the Software is | |
| 12 | +furnished to do so, subject to the following conditions: | |
| 13 | + | |
| 14 | +The above copyright notice and this permission notice shall be included in all | |
| 15 | +copies or substantial portions of the Software. | |
| 16 | + | |
| 17 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 18 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 19 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 20 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 21 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 22 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 23 | +SOFTWARE. | |
| new file mode 100644 | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | +MIT License | ||
| 2 | + | ||
| 3 | +razorbill — https://rickub.com/bots-garden/razorbill | ||
| 4 | + | ||
| 5 | +Copyright (c) 2026 k33g (Philippe Charrière) and the bots-garden organization | ||
| 6 | + | ||
| 7 | +Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 8 | +of this software and associated documentation files (the "Software"), to deal | ||
| 9 | +in the Software without restriction, including without limitation the rights | ||
| 10 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 11 | +copies of the Software, and to permit persons to whom the Software is | ||
| 12 | +furnished to do so, subject to the following conditions: | ||
| 13 | + | ||
| 14 | +The above copyright notice and this permission notice shall be included in all | ||
| 15 | +copies or substantial portions of the Software. | ||
| 16 | + | ||
| 17 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 18 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 19 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 20 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 21 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 22 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 23 | +SOFTWARE. | ||
modified
README.md +10 -4 | @@ -2,10 +2,14 @@ | ||
| 2 | 2 | |
| 3 | 3 | razorbill is a model server for the Mac. Its command is **`rzb`**. It runs language and embedding models on the GPU (Apple Metal) with [MLX](https://github.com/ml-explore/mlx-swift-lm) and exposes them through an **OpenAI-compatible HTTP API**, so existing OpenAI clients, frameworks and chat UIs use local models by changing their base URL. |
| 4 | 4 | |
| 5 | -> **Status: v0.2.** Chat completions (streaming, structured output with constrained decoding, function calling, reasoning), legacy text completions, embeddings, model management with queues and memory limits, a YAML server configuration, and an OpenAI compatibility suite are implemented and tested. Single native binary, no Python. | |
| 5 | +> **Status: v1.0.** Chat completions (streaming, structured output with constrained decoding, function calling, reasoning), legacy text completions, embeddings, model management with queues and memory limits, a YAML server configuration, a terminal UI (`rzb tui`), and an OpenAI compatibility suite are implemented and tested. Native, no Python; signed and notarized for macOS. | |
| 6 | 6 | |
| 7 | 7 | **Documentation:** [docs/en](docs/en/README.md) · [docs/fr](docs/fr/README.md) — tutorial, how-to guides, reference and explanations. |
| 8 | 8 | |
| 9 | +## Install | |
| 10 | + | |
| 11 | +Download the archive of the [latest release](https://rickub.com/bots-garden/razorbill/releases/latest) and follow [INSTALL.MACOS.md](INSTALL.MACOS.md) ([en français](INSTALL.MACOS.fr.md)). From the sources: `scripts/install.sh` ([Build on the Mac](#build-on-the-mac)). | |
| 12 | + | |
| 9 | 13 | ## Quick start |
| 10 | 14 | |
| 11 | 15 | ```bash |
| @@ -85,14 +89,14 @@ xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration | ||
| 85 | 89 | CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO |
| 86 | 90 | |
| 87 | 91 | .build/xcode/Build/Products/Release/rzb version |
| 88 | -# rzb 0.3.0 (engines: fake, mlx) | |
| 92 | +# rzb 1.0.0 (engines: fake, mlx) | |
| 89 | 93 | ``` |
| 90 | 94 | |
| 91 | 95 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. |
| 92 | 96 | |
| 93 | 97 | `scripts/install.sh` builds and installs `rzb` under `/usr/local` (launcher in `/usr/local/bin`), so it runs from any folder: see [Build rzb on the Mac](docs/en/how-to/build-on-the-mac.md#install). |
| 94 | 98 | |
| 95 | -`scripts/release.sh` builds and packages a release archive (`dist/razorbill-<version>-macos-arm64.tar.gz`): see [Package a release](docs/en/how-to/package-a-release.md). | |
| 99 | +The `local-ci-*.sh` scripts at the root build the release archive (`razorbill-<version>-macos-arm64.tar.gz`), sign and notarize `rzb`, and publish it on Rickub; `scripts/release.sh` alone builds an unsigned archive: see [Package and publish a release](docs/en/how-to/package-a-release.md). | |
| 96 | 100 | |
| 97 | 101 | ## Run the tests |
| 98 | 102 | |
| @@ -133,10 +137,12 @@ Step by step: [Develop from a Linux sandbox](docs/en/how-to/develop-from-a-sandb | ||
| 133 | 137 | | `experiments/01-query-model` | Development experiment, standalone package: sends one prompt to one MLX model with mlx-swift-lm, no server; first check of MLX on the Mac (#1). | |
| 134 | 138 | | `experiments/02-kv-cache-reuse` | Development experiment, standalone package: measures KV-cache reuse between stateless requests (#47), which led to the server's prompt cache (#48). | |
| 135 | 139 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | |
| 140 | +| `local-ci-*.sh` | The release chain: checks, build + signature + notarization, draft, upload, publication on Rickub. | | |
| 141 | +| `scripts/` | `test.sh`, `compat.sh`, `install.sh`, `release.sh`, `check-hardened-runtime.sh`. | | |
| 136 | 142 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | |
| 137 | 143 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | |
| 138 | 144 | | `.memory/` | Project record for whoever continues the work. | |
| 139 | 145 | |
| 140 | 146 | ## License |
| 141 | 147 | |
| 142 | -Not decided yet. | |
| 148 | +[MIT](LICENSE). | |
| @@ -2,10 +2,14 @@ | |||
| 2 | 2 | ||
| 3 | razorbill is a model server for the Mac. Its command is **`rzb`**. It runs language and embedding models on the GPU (Apple Metal) with [MLX](https://github.com/ml-explore/mlx-swift-lm) and exposes them through an **OpenAI-compatible HTTP API**, so existing OpenAI clients, frameworks and chat UIs use local models by changing their base URL. | 3 | razorbill is a model server for the Mac. Its command is **`rzb`**. It runs language and embedding models on the GPU (Apple Metal) with [MLX](https://github.com/ml-explore/mlx-swift-lm) and exposes them through an **OpenAI-compatible HTTP API**, so existing OpenAI clients, frameworks and chat UIs use local models by changing their base URL. |
| 4 | 4 | ||
| 5 | -> **Status: v0.2.** Chat completions (streaming, structured output with constrained decoding, function calling, reasoning), legacy text completions, embeddings, model management with queues and memory limits, a YAML server configuration, and an OpenAI compatibility suite are implemented and tested. Single native binary, no Python. | 5 | +> **Status: v1.0.** Chat completions (streaming, structured output with constrained decoding, function calling, reasoning), legacy text completions, embeddings, model management with queues and memory limits, a YAML server configuration, a terminal UI (`rzb tui`), and an OpenAI compatibility suite are implemented and tested. Native, no Python; signed and notarized for macOS. |
| 6 | 6 | ||
| 7 | **Documentation:** [docs/en](docs/en/README.md) · [docs/fr](docs/fr/README.md) — tutorial, how-to guides, reference and explanations. | 7 | **Documentation:** [docs/en](docs/en/README.md) · [docs/fr](docs/fr/README.md) — tutorial, how-to guides, reference and explanations. |
| 8 | 8 | ||
| 9 | +## Install | ||
| 10 | + | ||
| 11 | +Download the archive of the [latest release](https://rickub.com/bots-garden/razorbill/releases/latest) and follow [INSTALL.MACOS.md](INSTALL.MACOS.md) ([en français](INSTALL.MACOS.fr.md)). From the sources: `scripts/install.sh` ([Build on the Mac](#build-on-the-mac)). | ||
| 12 | + | ||
| 9 | ## Quick start | 13 | ## Quick start |
| 10 | 14 | ||
| 11 | ```bash | 15 | ```bash |
| @@ -85,14 +89,14 @@ xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration | |||
| 85 | CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO | 89 | CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO |
| 86 | 90 | ||
| 87 | .build/xcode/Build/Products/Release/rzb version | 91 | .build/xcode/Build/Products/Release/rzb version |
| 88 | -# rzb 0.3.0 (engines: fake, mlx) | 92 | +# rzb 1.0.0 (engines: fake, mlx) |
| 89 | ``` | 93 | ``` |
| 90 | 94 | ||
| 91 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. | 95 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. |
| 92 | 96 | ||
| 93 | `scripts/install.sh` builds and installs `rzb` under `/usr/local` (launcher in `/usr/local/bin`), so it runs from any folder: see [Build rzb on the Mac](docs/en/how-to/build-on-the-mac.md#install). | 97 | `scripts/install.sh` builds and installs `rzb` under `/usr/local` (launcher in `/usr/local/bin`), so it runs from any folder: see [Build rzb on the Mac](docs/en/how-to/build-on-the-mac.md#install). |
| 94 | 98 | ||
| 95 | -`scripts/release.sh` builds and packages a release archive (`dist/razorbill-<version>-macos-arm64.tar.gz`): see [Package a release](docs/en/how-to/package-a-release.md). | 99 | +The `local-ci-*.sh` scripts at the root build the release archive (`razorbill-<version>-macos-arm64.tar.gz`), sign and notarize `rzb`, and publish it on Rickub; `scripts/release.sh` alone builds an unsigned archive: see [Package and publish a release](docs/en/how-to/package-a-release.md). |
| 96 | 100 | ||
| 97 | ## Run the tests | 101 | ## Run the tests |
| 98 | 102 | ||
| @@ -133,10 +137,12 @@ Step by step: [Develop from a Linux sandbox](docs/en/how-to/develop-from-a-sandb | |||
| 133 | | `experiments/01-query-model` | Development experiment, standalone package: sends one prompt to one MLX model with mlx-swift-lm, no server; first check of MLX on the Mac (#1). | | 137 | | `experiments/01-query-model` | Development experiment, standalone package: sends one prompt to one MLX model with mlx-swift-lm, no server; first check of MLX on the Mac (#1). | |
| 134 | | `experiments/02-kv-cache-reuse` | Development experiment, standalone package: measures KV-cache reuse between stateless requests (#47), which led to the server's prompt cache (#48). | | 138 | | `experiments/02-kv-cache-reuse` | Development experiment, standalone package: measures KV-cache reuse between stateless requests (#47), which led to the server's prompt cache (#48). | |
| 135 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | | 139 | | `tools/host-runner` | Build, test and run on the Mac from the sandbox. | |
| 140 | +| `local-ci-*.sh` | The release chain: checks, build + signature + notarization, draft, upload, publication on Rickub. | | ||
| 141 | +| `scripts/` | `test.sh`, `compat.sh`, `install.sh`, `release.sh`, `check-hardened-runtime.sh`. | | ||
| 136 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | | 142 | | `.tickets/` | Issues, epics and milestones (IssueSpec YAML format). | |
| 137 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | | 143 | | `docs/` | User documentation, English and French ([diagram of the modules](docs/diagrams/packages.drawio)). | |
| 138 | | `.memory/` | Project record for whoever continues the work. | | 144 | | `.memory/` | Project record for whoever continues the work. | |
| 139 | 145 | ||
| 140 | ## License | 146 | ## License |
| 141 | 147 | ||
| 142 | -Not decided yet. | 148 | +[MIT](LICENSE). |
modified
Sources/RazorbillCLI/Commands/VersionCommand.swift +1 -1 | @@ -11,7 +11,7 @@ struct VersionCommand: AsyncParsableCommand { | ||
| 11 | 11 | environment.console.write(Self.line(engines: environment.engines.names) + "\n") |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - /// `rzb 0.3.0 (engines: fake, mlx)` | |
| 14 | + /// `rzb 1.0.0 (engines: fake, mlx)` | |
| 15 | 15 | static func line(engines: [String]) -> String { |
| 16 | 16 | let list = engines.isEmpty ? "none" : engines.joined(separator: ", ") |
| 17 | 17 | return "\(Razorbill.commandName) \(Razorbill.version) (engines: \(list))" |
| @@ -11,7 +11,7 @@ struct VersionCommand: AsyncParsableCommand { | |||
| 11 | environment.console.write(Self.line(engines: environment.engines.names) + "\n") | 11 | environment.console.write(Self.line(engines: environment.engines.names) + "\n") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | - /// `rzb 0.3.0 (engines: fake, mlx)` | 14 | + /// `rzb 1.0.0 (engines: fake, mlx)` |
| 15 | static func line(engines: [String]) -> String { | 15 | static func line(engines: [String]) -> String { |
| 16 | let list = engines.isEmpty ? "none" : engines.joined(separator: ", ") | 16 | let list = engines.isEmpty ? "none" : engines.joined(separator: ", ") |
| 17 | return "\(Razorbill.commandName) \(Razorbill.version) (engines: \(list))" | 17 | return "\(Razorbill.commandName) \(Razorbill.version) (engines: \(list))" |
modified
Sources/RazorbillCore/Razorbill.swift +2 -2 | @@ -1,11 +1,11 @@ | ||
| 1 | 1 | /// Identity of razorbill. |
| 2 | 2 | /// |
| 3 | 3 | /// ```swift |
| 4 | -/// print("\(Razorbill.commandName) \(Razorbill.version)") // "rzb 0.3.0" | |
| 4 | +/// print("\(Razorbill.commandName) \(Razorbill.version)") // "rzb 1.0.0" | |
| 5 | 5 | /// ``` |
| 6 | 6 | public enum Razorbill { |
| 7 | 7 | /// Semantic version of razorbill. |
| 8 | - public static let version = "0.3.0" | |
| 8 | + public static let version = "1.0.0" | |
| 9 | 9 | |
| 10 | 10 | /// Name of the command-line executable. |
| 11 | 11 | public static let commandName = "rzb" |
| @@ -1,11 +1,11 @@ | |||
| 1 | /// Identity of razorbill. | 1 | /// Identity of razorbill. |
| 2 | /// | 2 | /// |
| 3 | /// ```swift | 3 | /// ```swift |
| 4 | -/// print("\(Razorbill.commandName) \(Razorbill.version)") // "rzb 0.3.0" | 4 | +/// print("\(Razorbill.commandName) \(Razorbill.version)") // "rzb 1.0.0" |
| 5 | /// ``` | 5 | /// ``` |
| 6 | public enum Razorbill { | 6 | public enum Razorbill { |
| 7 | /// Semantic version of razorbill. | 7 | /// Semantic version of razorbill. |
| 8 | - public static let version = "0.3.0" | 8 | + public static let version = "1.0.0" |
| 9 | 9 | ||
| 10 | /// Name of the command-line executable. | 10 | /// Name of the command-line executable. |
| 11 | public static let commandName = "rzb" | 11 | public static let commandName = "rzb" |
modified
Tests/RazorbillCLITests/OtherCommandsTests.swift +2 -2 | @@ -63,8 +63,8 @@ import Testing | ||
| 63 | 63 | |
| 64 | 64 | @Suite struct SmallPieces { |
| 65 | 65 | @Test func versionListsTheEngines() async throws { |
| 66 | - #expect(VersionCommand.line(engines: ["fake", "mlx"]) == "rzb 0.3.0 (engines: fake, mlx)") | |
| 67 | - #expect((await (try World()).rzb("version")).stdout == "rzb 0.3.0 (engines: fake)\n") | |
| 66 | + #expect(VersionCommand.line(engines: ["fake", "mlx"]) == "rzb 1.0.0 (engines: fake, mlx)") | |
| 67 | + #expect((await (try World()).rzb("version")).stdout == "rzb 1.0.0 (engines: fake)\n") | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | @Test func downloadProgressPrintsEveryTenPercentWithoutColours() { |
| @@ -63,8 +63,8 @@ import Testing | |||
| 63 | 63 | ||
| 64 | @Suite struct SmallPieces { | 64 | @Suite struct SmallPieces { |
| 65 | @Test func versionListsTheEngines() async throws { | 65 | @Test func versionListsTheEngines() async throws { |
| 66 | - #expect(VersionCommand.line(engines: ["fake", "mlx"]) == "rzb 0.3.0 (engines: fake, mlx)") | 66 | + #expect(VersionCommand.line(engines: ["fake", "mlx"]) == "rzb 1.0.0 (engines: fake, mlx)") |
| 67 | - #expect((await (try World()).rzb("version")).stdout == "rzb 0.3.0 (engines: fake)\n") | 67 | + #expect((await (try World()).rzb("version")).stdout == "rzb 1.0.0 (engines: fake)\n") |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | @Test func downloadProgressPrintsEveryTenPercentWithoutColours() { | 70 | @Test func downloadProgressPrintsEveryTenPercentWithoutColours() { |
modified
docs/diagrams/packages.drawio +1 -1 | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | <mxCell id="0" /> |
| 6 | 6 | <mxCell id="1" parent="0" /> |
| 7 | 7 | |
| 8 | - <mxCell id="title" value="<b>razorbill v0.3 — Swift modules and their dependencies</b><br>Arrows point from a module to what it imports. Dashed: linked on macOS only." style="text;html=1;align=left;verticalAlign=top;fontSize=14;" vertex="1" parent="1"> | |
| 8 | + <mxCell id="title" value="<b>razorbill v1.0 — Swift modules and their dependencies</b><br>Arrows point from a module to what it imports. Dashed: linked on macOS only." style="text;html=1;align=left;verticalAlign=top;fontSize=14;" vertex="1" parent="1"> | |
| 9 | 9 | <mxGeometry x="40" y="20" width="760" height="50" as="geometry" /> |
| 10 | 10 | </mxCell> |
| 11 | 11 | |
| @@ -5,7 +5,7 @@ | |||
| 5 | <mxCell id="0" /> | 5 | <mxCell id="0" /> |
| 6 | <mxCell id="1" parent="0" /> | 6 | <mxCell id="1" parent="0" /> |
| 7 | 7 | ||
| 8 | - <mxCell id="title" value="<b>razorbill v0.3 — Swift modules and their dependencies</b><br>Arrows point from a module to what it imports. Dashed: linked on macOS only." style="text;html=1;align=left;verticalAlign=top;fontSize=14;" vertex="1" parent="1"> | 8 | + <mxCell id="title" value="<b>razorbill v1.0 — Swift modules and their dependencies</b><br>Arrows point from a module to what it imports. Dashed: linked on macOS only." style="text;html=1;align=left;verticalAlign=top;fontSize=14;" vertex="1" parent="1"> |
| 9 | <mxGeometry x="40" y="20" width="760" height="50" as="geometry" /> | 9 | <mxGeometry x="40" y="20" width="760" height="50" as="geometry" /> |
| 10 | </mxCell> | 10 | </mxCell> |
| 11 | 11 | ||
modified
docs/en/README.md +1 -1 | @@ -12,7 +12,7 @@ This documentation follows [Diátaxis](https://diataxis.fr): pick the section th | ||
| 12 | 12 | ## Do — how-to guides |
| 13 | 13 | |
| 14 | 14 | - [Build rzb on the Mac](how-to/build-on-the-mac.md) |
| 15 | -- [Package a release](how-to/package-a-release.md): the `.tar.gz` archive and its checksum. | |
| 15 | +- [Package and publish a release](how-to/package-a-release.md): the local CI, Developer ID signing and notarization, publication on Rickub. | |
| 16 | 16 | - [Manage models](how-to/manage-models.md) |
| 17 | 17 | - [Configure the server](how-to/configure-the-server.md): model names, defaults, locks, limits, network access. |
| 18 | 18 | - [Watch and steer a running server](how-to/watch-and-steer-a-running-server.md): status, freeing a model, reloading the configuration. |
| @@ -12,7 +12,7 @@ This documentation follows [Diátaxis](https://diataxis.fr): pick the section th | |||
| 12 | ## Do — how-to guides | 12 | ## Do — how-to guides |
| 13 | 13 | ||
| 14 | - [Build rzb on the Mac](how-to/build-on-the-mac.md) | 14 | - [Build rzb on the Mac](how-to/build-on-the-mac.md) |
| 15 | -- [Package a release](how-to/package-a-release.md): the `.tar.gz` archive and its checksum. | 15 | +- [Package and publish a release](how-to/package-a-release.md): the local CI, Developer ID signing and notarization, publication on Rickub. |
| 16 | - [Manage models](how-to/manage-models.md) | 16 | - [Manage models](how-to/manage-models.md) |
| 17 | - [Configure the server](how-to/configure-the-server.md): model names, defaults, locks, limits, network access. | 17 | - [Configure the server](how-to/configure-the-server.md): model names, defaults, locks, limits, network access. |
| 18 | - [Watch and steer a running server](how-to/watch-and-steer-a-running-server.md): status, freeing a model, reloading the configuration. | 18 | - [Watch and steer a running server](how-to/watch-and-steer-a-running-server.md): status, freeing a model, reloading the configuration. |
modified
docs/en/how-to/build-on-the-mac.md +2 -2 | @@ -26,7 +26,7 @@ The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that fol | ||
| 26 | 26 | |
| 27 | 27 | ```bash |
| 28 | 28 | .build/xcode/Build/Products/Release/rzb version |
| 29 | -# rzb 0.3.0 (engines: fake, mlx) | |
| 29 | +# rzb 1.0.0 (engines: fake, mlx) | |
| 30 | 30 | ``` |
| 31 | 31 | |
| 32 | 32 | ## Install |
| @@ -52,7 +52,7 @@ The script never overwrites or removes an `rzb` launcher it did not write. | ||
| 52 | 52 | |
| 53 | 53 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. |
| 54 | 54 | - **List the schemes**: `xcodebuild -list`. The package has a single scheme, `razorbill`; `rzb` and `razorbill-Package` do not exist. |
| 55 | -- **Archive to distribute**: see [Package a release](package-a-release.md). | |
| 55 | +- **Archive to distribute**: see [Package and publish a release](package-a-release.md). | |
| 56 | 56 | - **From a Linux sandbox**: see [Develop from a Linux sandbox](develop-from-a-sandbox.md). |
| 57 | 57 | |
| 58 | 58 | ## Troubleshooting |
| @@ -26,7 +26,7 @@ The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that fol | |||
| 26 | 26 | ||
| 27 | ```bash | 27 | ```bash |
| 28 | .build/xcode/Build/Products/Release/rzb version | 28 | .build/xcode/Build/Products/Release/rzb version |
| 29 | -# rzb 0.3.0 (engines: fake, mlx) | 29 | +# rzb 1.0.0 (engines: fake, mlx) |
| 30 | ``` | 30 | ``` |
| 31 | 31 | ||
| 32 | ## Install | 32 | ## Install |
| @@ -52,7 +52,7 @@ The script never overwrites or removes an `rzb` launcher it did not write. | |||
| 52 | 52 | ||
| 53 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. | 53 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. |
| 54 | - **List the schemes**: `xcodebuild -list`. The package has a single scheme, `razorbill`; `rzb` and `razorbill-Package` do not exist. | 54 | - **List the schemes**: `xcodebuild -list`. The package has a single scheme, `razorbill`; `rzb` and `razorbill-Package` do not exist. |
| 55 | -- **Archive to distribute**: see [Package a release](package-a-release.md). | 55 | +- **Archive to distribute**: see [Package and publish a release](package-a-release.md). |
| 56 | - **From a Linux sandbox**: see [Develop from a Linux sandbox](develop-from-a-sandbox.md). | 56 | - **From a Linux sandbox**: see [Develop from a Linux sandbox](develop-from-a-sandbox.md). |
| 57 | 57 | ||
| 58 | ## Troubleshooting | 58 | ## Troubleshooting |
modified
docs/en/how-to/package-a-release.md +88 -19 | @@ -1,44 +1,113 @@ | ||
| 1 | -# How to package a release | |
| 1 | +# How to package and publish a release | |
| 2 | 2 | |
| 3 | -This guide builds the release archive of razorbill: `rzb` and the resource bundles it needs, in one `.tar.gz` with its SHA-256. It assumes you can already [build rzb on the Mac](build-on-the-mac.md). | |
| 3 | +This guide builds the release of razorbill, signs and notarizes `rzb`, and publishes it on Rickub, with the `local-ci-*.sh` scripts at the root of the repository. It assumes you can already [build rzb on the Mac](build-on-the-mac.md). Users install the result with [`INSTALL.MACOS.md`](../../../INSTALL.MACOS.md). | |
| 4 | 4 | |
| 5 | -## Steps | |
| 5 | +| Step | Script | Where | | |
| 6 | +| --- | --- | --- | | |
| 7 | +| Checks | `./local-ci-01-check.sh` | the Mac (on Linux, MLX is not tested) | | |
| 8 | +| Build, sign, notarize | `./local-ci-02-build.sh` | the Mac | | |
| 9 | +| Tag and draft prerelease | `./local-ci-03-create-draft.sh` | the Mac or Linux | | |
| 10 | +| Upload | `./local-ci-04-upload.sh` | the Mac or Linux | | |
| 11 | +| Publish | `./local-ci-05-publish.sh` | the Mac or Linux; asks you to type the tag | | |
| 12 | +| Promote (optional) | `./local-ci-06-promote.sh` | the Mac or Linux; asks you to type the tag | | |
| 6 | 13 | |
| 7 | -1. Set the version in `Sources/RazorbillCore/Razorbill.swift` (`static let version = "…"`), update the version shown in the docs, and commit. The script refuses uncommitted changes. | |
| 8 | -2. From the repository root, on the Mac: | |
| 14 | +## Settings (once) | |
| 15 | + | |
| 16 | +1. **The Rickub token**: `.ci.cd.token.env` at the root, holding `CI_TOKEN=…`. It is git-ignored; never commit it. | |
| 17 | +2. **The release settings**: `.release.env` at the root, also git-ignored: | |
| 18 | + | |
| 19 | + ```bash | |
| 20 | + TAG="v1.0.0" | |
| 21 | + ABOUT="razorbill — MLX model server with an OpenAI-compatible API" | |
| 22 | + OWNER="bots-garden" | |
| 23 | + REPO="razorbill" | |
| 24 | + # macOS signature. Empty = rzb is not signed. | |
| 25 | + RZB_SIGN_IDENTITY="${SIDEKICKS_SIGN_IDENTITY:-}" | |
| 26 | + RZB_NOTARY_PROFILE="${SIDEKICKS_NOTARY_PROFILE:-}" | |
| 27 | + ``` | |
| 28 | + | |
| 29 | + `.release.env` is read by bash: it picks up the variables exported in your `~/.zshrc`. | |
| 30 | +3. **The signing identity**: `security find-identity -v -p codesigning` must list `"Developer ID Application: … (TEAMID)"`, exactly the value of `RZB_SIGN_IDENTITY`. The certificate belongs to the team, not to an application: the one that signs mini-me and Sidekicks signs rzb too. Nothing has to be registered at Apple for rzb; its identifier, `com.bots-garden.rzb`, is chosen by the script. | |
| 31 | +4. **The notarization profile**: `xcrun notarytool history --keychain-profile "$RZB_NOTARY_PROFILE"` must list submissions without an authentication error. If the profile is missing: create an app-specific password on [account.apple.com](https://account.apple.com), then `xcrun notarytool store-credentials <name> --apple-id <you@example.com> --team-id <TEAMID>`. | |
| 32 | +5. **The hardened runtime**: notarization requires it. Check that rzb still works under it, with the models of the compatibility suite pulled: | |
| 33 | + | |
| 34 | + ```bash | |
| 35 | + scripts/check-hardened-runtime.sh | |
| 36 | + ``` | |
| 37 | + | |
| 38 | + It signs a Release build like the release does (with `RZB_SIGN_IDENTITY` when set, otherwise ad hoc) and runs [`scripts/compat.sh`](run-the-tests.md) against that copy: real chat, streaming, structured output, tools and embeddings. Run it again after an MLX or macOS upgrade. If it fails while `scripts/compat.sh` alone passes, rzb needs an entitlement: do not publish a signed release before that is solved. | |
| 39 | + | |
| 40 | +## Every release | |
| 41 | + | |
| 42 | +1. Prepare the release (version in `Sources/RazorbillCore/Razorbill.swift` and the docs, release notes `release-notes/vX.Y.Z.md` and `.fr.md`, `TAG` in `.release.env`): the `release` skill does it. Commit and push `main`: step 03 refuses a tree that is not clean or a `HEAD` that is not the remote's `main`. | |
| 43 | +2. If the repository sits in a synced folder (kDrive, iCloud Drive…), pause the sync during step 02. | |
| 44 | +3. On the Mac: | |
| 9 | 45 | |
| 10 | 46 | ```bash |
| 11 | - scripts/release.sh | |
| 47 | + ./local-ci-01-check.sh | |
| 48 | + ./local-ci-02-build.sh | |
| 12 | 49 | ``` |
| 13 | 50 | |
| 14 | - It builds in Release into `.build/release` (a folder of its own, so the first run compiles everything again), packages the build, unpacks the archive in a temporary folder and checks that the unpacked `rzb --version` prints the version. It ends by printing the archive and its checksum: | |
| 51 | + With `RZB_SIGN_IDENTITY` set, step 02 checks the setup before building (identity in the keychain, working notarytool profile), builds in Release into `.build/release`, copies `rzb` and its bundles to a temporary folder, signs the bundles then `rzb` (`--options runtime --timestamp --identifier com.bots-garden.rzb`), checks the signature (Developer ID authority, `runtime` flag, timestamp), sends the folder to Apple in a `.zip` and waits for `Accepted`. Then `scripts/release.sh --products` makes the archive, step 02 unpacks it, checks the signatures again and runs the unpacked `rzb --version`. You should see: | |
| 15 | 52 | |
| 16 | 53 | ``` |
| 17 | - dist/razorbill-0.3.0-macos-arm64.tar.gz | |
| 18 | - <sha256> razorbill-0.3.0-macos-arm64.tar.gz | |
| 54 | + 🔏 Signing and notarizing rzb and its bundles... | |
| 55 | + ✅ rzb signed (Developer ID, hardened runtime, timestamp) and 6 bundles sealed | |
| 56 | + ⏳ waiting for Apple's notary service (a few minutes)... | |
| 57 | + ✅ notarized (submission 1a2b3c4d-…) | |
| 58 | + ✅ signatures intact in the unpacked archive | |
| 59 | + ✅ the archived rzb starts and reports 1.0.0 | |
| 60 | + ``` | |
| 61 | + | |
| 62 | + `release/<TAG>/` then holds the archive, `SHA256SUMS`, a `README.md` and `macos-signature.txt` (the signature and the notarization submission; not published). | |
| 63 | +4. Then: | |
| 64 | + | |
| 65 | + ```bash | |
| 66 | + ./local-ci-03-create-draft.sh # the tag v1.0.0 and a draft prerelease | |
| 67 | + ./local-ci-04-upload.sh # the archive and SHA256SUMS | |
| 68 | + ./local-ci-05-publish.sh # public; becomes /releases/latest | |
| 69 | + ./local-ci-06-promote.sh # optional: removes the pre-release label | |
| 19 | 70 | ``` |
| 20 | 71 | |
| 21 | -3. Check the server from the archive before publishing it, for example by unpacking it elsewhere and running `rzb serve` with a model. | |
| 22 | -4. Tag the commit (`git tag -a v0.3.0 -m "razorbill 0.3.0"`) and publish `dist/razorbill-<version>-macos-arm64.tar.gz` with its `.sha256` file. | |
| 72 | + Step 03 writes the release text from `ABOUT`, the summary sentence of `release-notes/<TAG>.md`, the commit, the Xcode version (recorded by step 02), a signature line when `macos-signature.txt` exists, links to the notes and the install guide, and the checksum. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` prints that text and creates nothing. | |
| 73 | + | |
| 74 | + Rickub only accepts uploads from a CI job's token, so step 04 pushes a temporary branch holding the archive and a one-job workflow, waits for the job and deletes the branch. Step 05 downloads what is public and compares it with `release/<TAG>/`. | |
| 75 | +5. Try it as a user would: download the archive **with a browser**, unpack it, and run `rzb --version` from the folder; no dialog must block it. | |
| 76 | + | |
| 77 | +A published release cannot take a new archive in place of the old one: Rickub refuses a file name that already exists. Publish a new version instead. | |
| 23 | 78 | |
| 24 | 79 | ## What the archive holds |
| 25 | 80 | |
| 26 | 81 | | Entry | Role | |
| 27 | 82 | | --- | --- | |
| 28 | -| `rzb` | The executable (Apple Silicon, macOS 14 or later). | | |
| 83 | +| `rzb` | The executable (Apple Silicon, macOS 14 or later), signed with the hardened runtime. | | |
| 29 | 84 | | `mlx-swift_Cmlx.bundle` | The MLX Metal library (`default.metallib`); without it no model loads. | |
| 30 | -| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. The script copies every `*.bundle` of the build. | | |
| 31 | -| `INSTALL.txt` | Where to put the folder, how to add it to `PATH`, how to clear the quarantine. | | |
| 85 | +| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. Every `*.bundle` of the build is copied, and sealed by the signature. | | |
| 86 | +| `INSTALL.txt` | Where to put the folder; says whether the archive is signed. | | |
| 87 | +| `LICENSE` | The MIT license. | | |
| 32 | 88 | |
| 33 | -The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. On a Mac with the sources, `scripts/install.sh` does this for you ([Build rzb on the Mac](build-on-the-mac.md#install)). | |
| 89 | +The bundles must stay next to `rzb`: the folder is installed whole, with a launcher in `bin/` ([`INSTALL.MACOS.md`](../../../INSTALL.MACOS.md)). | |
| 34 | 90 | |
| 35 | 91 | ## Variants |
| 36 | 92 | |
| 37 | -- **Package a build you already have**: `scripts/release.sh --products .build/xcode/Build/Products/Release` skips the build. This also works from Linux, where the final `rzb --version` check is skipped. | |
| 38 | -- **Test archive from uncommitted work**: add `--allow-dirty`. Do not publish such an archive. | |
| 39 | -- **Downloaded with a browser**: macOS quarantines the archive and refuses to run `rzb`, which is signed ad hoc only. Clear it with `xattr -dr com.apple.quarantine <folder>`. Developer ID signing and notarization are planned for 1.0.0. | |
| 93 | +- **Unsigned archive**: leave `RZB_SIGN_IDENTITY` empty. Step 02 warns `rzb is not signed` and `INSTALL.txt` gives the `xattr` command. | |
| 94 | +- **Archive without the CI**: `scripts/release.sh` builds and packages into `dist/` (unsigned). `--products <dir>` packages an existing build (also from Linux, without the final `rzb --version` check), `--out <dir>` writes elsewhere, `--allow-dirty` accepts uncommitted work (never publish such an archive). | |
| 95 | + | |
| 96 | +## Troubleshooting | |
| 97 | + | |
| 98 | +| Symptom | What to do | | |
| 99 | +| --- | --- | | |
| 100 | +| `TAG is v… but Sources/RazorbillCore/Razorbill.swift says …` | The tag and the compiled version differ: fix one of them (the `release` skill sets both). | | |
| 101 | +| `RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not` | Add the profile to `.release.env`. A signed binary that is not notarized is still blocked by Gatekeeper. | | |
| 102 | +| `no valid identity "…" in the keychain` | `security find-identity -v -p codesigning`, copy the exact value. If it shows `CSSMERR_TP_NOT_TRUSTED`, install the Developer ID G2 intermediate certificate from [apple.com/certificateauthority](https://www.apple.com/certificateauthority/). | | |
| 103 | +| `the notarytool profile "…" does not work` | `xcrun notarytool history --keychain-profile "…"` gives the error; a revoked app-specific password is made again. | | |
| 104 | +| `notarization …: Invalid` | `xcrun notarytool log <id> --keychain-profile "$RZB_NOTARY_PROFILE"` (the command is printed) gives the reason. | | |
| 105 | +| `codesign` refuses ("resource fork, Finder information, or similar detritus") | Metadata from a synced folder. The script clears it with `xattr -cr`; pause the sync and run step 02 again. | | |
| 106 | +| `is not writable (left by a run with sudo?)` | `sudo chown -R "$(whoami)" release dist .build`, and never run these scripts with sudo. | | |
| 107 | +| `HEAD (…) is not the remote's main` | Push `main` first. | | |
| 40 | 108 | |
| 41 | 109 | ## See also |
| 42 | 110 | |
| 43 | 111 | - [Build rzb on the Mac](build-on-the-mac.md) |
| 44 | -- [Run the tests](run-the-tests.md), to run before a release. | |
| 112 | +- [Run the tests](run-the-tests.md), which step 01 runs. | |
| 113 | +- Apple: [Notarizing macOS software before distribution](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution) | |
| @@ -1,44 +1,113 @@ | |||
| 1 | -# How to package a release | 1 | +# How to package and publish a release |
| 2 | 2 | ||
| 3 | -This guide builds the release archive of razorbill: `rzb` and the resource bundles it needs, in one `.tar.gz` with its SHA-256. It assumes you can already [build rzb on the Mac](build-on-the-mac.md). | 3 | +This guide builds the release of razorbill, signs and notarizes `rzb`, and publishes it on Rickub, with the `local-ci-*.sh` scripts at the root of the repository. It assumes you can already [build rzb on the Mac](build-on-the-mac.md). Users install the result with [`INSTALL.MACOS.md`](../../../INSTALL.MACOS.md). |
| 4 | 4 | ||
| 5 | -## Steps | 5 | +| Step | Script | Where | |
| 6 | +| --- | --- | --- | | ||
| 7 | +| Checks | `./local-ci-01-check.sh` | the Mac (on Linux, MLX is not tested) | | ||
| 8 | +| Build, sign, notarize | `./local-ci-02-build.sh` | the Mac | | ||
| 9 | +| Tag and draft prerelease | `./local-ci-03-create-draft.sh` | the Mac or Linux | | ||
| 10 | +| Upload | `./local-ci-04-upload.sh` | the Mac or Linux | | ||
| 11 | +| Publish | `./local-ci-05-publish.sh` | the Mac or Linux; asks you to type the tag | | ||
| 12 | +| Promote (optional) | `./local-ci-06-promote.sh` | the Mac or Linux; asks you to type the tag | | ||
| 6 | 13 | ||
| 7 | -1. Set the version in `Sources/RazorbillCore/Razorbill.swift` (`static let version = "…"`), update the version shown in the docs, and commit. The script refuses uncommitted changes. | 14 | +## Settings (once) |
| 8 | -2. From the repository root, on the Mac: | 15 | + |
| 16 | +1. **The Rickub token**: `.ci.cd.token.env` at the root, holding `CI_TOKEN=…`. It is git-ignored; never commit it. | ||
| 17 | +2. **The release settings**: `.release.env` at the root, also git-ignored: | ||
| 18 | + | ||
| 19 | + ```bash | ||
| 20 | + TAG="v1.0.0" | ||
| 21 | + ABOUT="razorbill — MLX model server with an OpenAI-compatible API" | ||
| 22 | + OWNER="bots-garden" | ||
| 23 | + REPO="razorbill" | ||
| 24 | + # macOS signature. Empty = rzb is not signed. | ||
| 25 | + RZB_SIGN_IDENTITY="${SIDEKICKS_SIGN_IDENTITY:-}" | ||
| 26 | + RZB_NOTARY_PROFILE="${SIDEKICKS_NOTARY_PROFILE:-}" | ||
| 27 | + ``` | ||
| 28 | + | ||
| 29 | + `.release.env` is read by bash: it picks up the variables exported in your `~/.zshrc`. | ||
| 30 | +3. **The signing identity**: `security find-identity -v -p codesigning` must list `"Developer ID Application: … (TEAMID)"`, exactly the value of `RZB_SIGN_IDENTITY`. The certificate belongs to the team, not to an application: the one that signs mini-me and Sidekicks signs rzb too. Nothing has to be registered at Apple for rzb; its identifier, `com.bots-garden.rzb`, is chosen by the script. | ||
| 31 | +4. **The notarization profile**: `xcrun notarytool history --keychain-profile "$RZB_NOTARY_PROFILE"` must list submissions without an authentication error. If the profile is missing: create an app-specific password on [account.apple.com](https://account.apple.com), then `xcrun notarytool store-credentials <name> --apple-id <you@example.com> --team-id <TEAMID>`. | ||
| 32 | +5. **The hardened runtime**: notarization requires it. Check that rzb still works under it, with the models of the compatibility suite pulled: | ||
| 33 | + | ||
| 34 | + ```bash | ||
| 35 | + scripts/check-hardened-runtime.sh | ||
| 36 | + ``` | ||
| 37 | + | ||
| 38 | + It signs a Release build like the release does (with `RZB_SIGN_IDENTITY` when set, otherwise ad hoc) and runs [`scripts/compat.sh`](run-the-tests.md) against that copy: real chat, streaming, structured output, tools and embeddings. Run it again after an MLX or macOS upgrade. If it fails while `scripts/compat.sh` alone passes, rzb needs an entitlement: do not publish a signed release before that is solved. | ||
| 39 | + | ||
| 40 | +## Every release | ||
| 41 | + | ||
| 42 | +1. Prepare the release (version in `Sources/RazorbillCore/Razorbill.swift` and the docs, release notes `release-notes/vX.Y.Z.md` and `.fr.md`, `TAG` in `.release.env`): the `release` skill does it. Commit and push `main`: step 03 refuses a tree that is not clean or a `HEAD` that is not the remote's `main`. | ||
| 43 | +2. If the repository sits in a synced folder (kDrive, iCloud Drive…), pause the sync during step 02. | ||
| 44 | +3. On the Mac: | ||
| 9 | 45 | ||
| 10 | ```bash | 46 | ```bash |
| 11 | - scripts/release.sh | 47 | + ./local-ci-01-check.sh |
| 48 | + ./local-ci-02-build.sh | ||
| 12 | ``` | 49 | ``` |
| 13 | 50 | ||
| 14 | - It builds in Release into `.build/release` (a folder of its own, so the first run compiles everything again), packages the build, unpacks the archive in a temporary folder and checks that the unpacked `rzb --version` prints the version. It ends by printing the archive and its checksum: | 51 | + With `RZB_SIGN_IDENTITY` set, step 02 checks the setup before building (identity in the keychain, working notarytool profile), builds in Release into `.build/release`, copies `rzb` and its bundles to a temporary folder, signs the bundles then `rzb` (`--options runtime --timestamp --identifier com.bots-garden.rzb`), checks the signature (Developer ID authority, `runtime` flag, timestamp), sends the folder to Apple in a `.zip` and waits for `Accepted`. Then `scripts/release.sh --products` makes the archive, step 02 unpacks it, checks the signatures again and runs the unpacked `rzb --version`. You should see: |
| 15 | 52 | ||
| 16 | ``` | 53 | ``` |
| 17 | - dist/razorbill-0.3.0-macos-arm64.tar.gz | 54 | + 🔏 Signing and notarizing rzb and its bundles... |
| 18 | - <sha256> razorbill-0.3.0-macos-arm64.tar.gz | 55 | + ✅ rzb signed (Developer ID, hardened runtime, timestamp) and 6 bundles sealed |
| 56 | + ⏳ waiting for Apple's notary service (a few minutes)... | ||
| 57 | + ✅ notarized (submission 1a2b3c4d-…) | ||
| 58 | + ✅ signatures intact in the unpacked archive | ||
| 59 | + ✅ the archived rzb starts and reports 1.0.0 | ||
| 60 | + ``` | ||
| 61 | + | ||
| 62 | + `release/<TAG>/` then holds the archive, `SHA256SUMS`, a `README.md` and `macos-signature.txt` (the signature and the notarization submission; not published). | ||
| 63 | +4. Then: | ||
| 64 | + | ||
| 65 | + ```bash | ||
| 66 | + ./local-ci-03-create-draft.sh # the tag v1.0.0 and a draft prerelease | ||
| 67 | + ./local-ci-04-upload.sh # the archive and SHA256SUMS | ||
| 68 | + ./local-ci-05-publish.sh # public; becomes /releases/latest | ||
| 69 | + ./local-ci-06-promote.sh # optional: removes the pre-release label | ||
| 19 | ``` | 70 | ``` |
| 20 | 71 | ||
| 21 | -3. Check the server from the archive before publishing it, for example by unpacking it elsewhere and running `rzb serve` with a model. | 72 | + Step 03 writes the release text from `ABOUT`, the summary sentence of `release-notes/<TAG>.md`, the commit, the Xcode version (recorded by step 02), a signature line when `macos-signature.txt` exists, links to the notes and the install guide, and the checksum. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` prints that text and creates nothing. |
| 22 | -4. Tag the commit (`git tag -a v0.3.0 -m "razorbill 0.3.0"`) and publish `dist/razorbill-<version>-macos-arm64.tar.gz` with its `.sha256` file. | 73 | + |
| 74 | + Rickub only accepts uploads from a CI job's token, so step 04 pushes a temporary branch holding the archive and a one-job workflow, waits for the job and deletes the branch. Step 05 downloads what is public and compares it with `release/<TAG>/`. | ||
| 75 | +5. Try it as a user would: download the archive **with a browser**, unpack it, and run `rzb --version` from the folder; no dialog must block it. | ||
| 76 | + | ||
| 77 | +A published release cannot take a new archive in place of the old one: Rickub refuses a file name that already exists. Publish a new version instead. | ||
| 23 | 78 | ||
| 24 | ## What the archive holds | 79 | ## What the archive holds |
| 25 | 80 | ||
| 26 | | Entry | Role | | 81 | | Entry | Role | |
| 27 | | --- | --- | | 82 | | --- | --- | |
| 28 | -| `rzb` | The executable (Apple Silicon, macOS 14 or later). | | 83 | +| `rzb` | The executable (Apple Silicon, macOS 14 or later), signed with the hardened runtime. | |
| 29 | | `mlx-swift_Cmlx.bundle` | The MLX Metal library (`default.metallib`); without it no model loads. | | 84 | | `mlx-swift_Cmlx.bundle` | The MLX Metal library (`default.metallib`); without it no model loads. | |
| 30 | -| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. The script copies every `*.bundle` of the build. | | 85 | +| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. Every `*.bundle` of the build is copied, and sealed by the signature. | |
| 31 | -| `INSTALL.txt` | Where to put the folder, how to add it to `PATH`, how to clear the quarantine. | | 86 | +| `INSTALL.txt` | Where to put the folder; says whether the archive is signed. | |
| 87 | +| `LICENSE` | The MIT license. | | ||
| 32 | 88 | ||
| 33 | -The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. On a Mac with the sources, `scripts/install.sh` does this for you ([Build rzb on the Mac](build-on-the-mac.md#install)). | 89 | +The bundles must stay next to `rzb`: the folder is installed whole, with a launcher in `bin/` ([`INSTALL.MACOS.md`](../../../INSTALL.MACOS.md)). |
| 34 | 90 | ||
| 35 | ## Variants | 91 | ## Variants |
| 36 | 92 | ||
| 37 | -- **Package a build you already have**: `scripts/release.sh --products .build/xcode/Build/Products/Release` skips the build. This also works from Linux, where the final `rzb --version` check is skipped. | 93 | +- **Unsigned archive**: leave `RZB_SIGN_IDENTITY` empty. Step 02 warns `rzb is not signed` and `INSTALL.txt` gives the `xattr` command. |
| 38 | -- **Test archive from uncommitted work**: add `--allow-dirty`. Do not publish such an archive. | 94 | +- **Archive without the CI**: `scripts/release.sh` builds and packages into `dist/` (unsigned). `--products <dir>` packages an existing build (also from Linux, without the final `rzb --version` check), `--out <dir>` writes elsewhere, `--allow-dirty` accepts uncommitted work (never publish such an archive). |
| 39 | -- **Downloaded with a browser**: macOS quarantines the archive and refuses to run `rzb`, which is signed ad hoc only. Clear it with `xattr -dr com.apple.quarantine <folder>`. Developer ID signing and notarization are planned for 1.0.0. | 95 | + |
| 96 | +## Troubleshooting | ||
| 97 | + | ||
| 98 | +| Symptom | What to do | | ||
| 99 | +| --- | --- | | ||
| 100 | +| `TAG is v… but Sources/RazorbillCore/Razorbill.swift says …` | The tag and the compiled version differ: fix one of them (the `release` skill sets both). | | ||
| 101 | +| `RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not` | Add the profile to `.release.env`. A signed binary that is not notarized is still blocked by Gatekeeper. | | ||
| 102 | +| `no valid identity "…" in the keychain` | `security find-identity -v -p codesigning`, copy the exact value. If it shows `CSSMERR_TP_NOT_TRUSTED`, install the Developer ID G2 intermediate certificate from [apple.com/certificateauthority](https://www.apple.com/certificateauthority/). | | ||
| 103 | +| `the notarytool profile "…" does not work` | `xcrun notarytool history --keychain-profile "…"` gives the error; a revoked app-specific password is made again. | | ||
| 104 | +| `notarization …: Invalid` | `xcrun notarytool log <id> --keychain-profile "$RZB_NOTARY_PROFILE"` (the command is printed) gives the reason. | | ||
| 105 | +| `codesign` refuses ("resource fork, Finder information, or similar detritus") | Metadata from a synced folder. The script clears it with `xattr -cr`; pause the sync and run step 02 again. | | ||
| 106 | +| `is not writable (left by a run with sudo?)` | `sudo chown -R "$(whoami)" release dist .build`, and never run these scripts with sudo. | | ||
| 107 | +| `HEAD (…) is not the remote's main` | Push `main` first. | | ||
| 40 | 108 | ||
| 41 | ## See also | 109 | ## See also |
| 42 | 110 | ||
| 43 | - [Build rzb on the Mac](build-on-the-mac.md) | 111 | - [Build rzb on the Mac](build-on-the-mac.md) |
| 44 | -- [Run the tests](run-the-tests.md), to run before a release. | 112 | +- [Run the tests](run-the-tests.md), which step 01 runs. |
| 113 | +- Apple: [Notarizing macOS software before distribution](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution) | ||
modified
docs/en/reference/cli.md +3 -3 | @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Reference: command line |
| 2 | 2 | |
| 3 | -> Every `rzb` command, option and exit code of razorbill 0.3.0. | |
| 3 | +> Every `rzb` command, option and exit code of razorbill 1.0.0. | |
| 4 | 4 | |
| 5 | 5 | ``` |
| 6 | 6 | rzb <command> [options] |
| @@ -36,7 +36,7 @@ Options win over the `server:` section of the file. On start it prints, on stand | ||
| 36 | 36 | |
| 37 | 37 | ``` |
| 38 | 38 | config: server.yaml (2 declared models) |
| 39 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | |
| 39 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | |
| 40 | 40 | ``` |
| 41 | 41 | |
| 42 | 42 | The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged. |
| @@ -83,7 +83,7 @@ The cache is `$HF_HUB_CACHE`, else `$HF_HOME/hub`, else `~/.cache/huggingface/hu | ||
| 83 | 83 | |
| 84 | 84 | ## rzb version |
| 85 | 85 | |
| 86 | -Prints `rzb 0.3.0 (engines: fake, mlx)` (the engines of this build, sorted). `rzb --version` prints `0.3.0`. | |
| 86 | +Prints `rzb 1.0.0 (engines: fake, mlx)` (the engines of this build, sorted). `rzb --version` prints `1.0.0`. | |
| 87 | 87 | |
| 88 | 88 | ## Exit codes |
| 89 | 89 | |
| @@ -1,6 +1,6 @@ | |||
| 1 | # Reference: command line | 1 | # Reference: command line |
| 2 | 2 | ||
| 3 | -> Every `rzb` command, option and exit code of razorbill 0.3.0. | 3 | +> Every `rzb` command, option and exit code of razorbill 1.0.0. |
| 4 | 4 | ||
| 5 | ``` | 5 | ``` |
| 6 | rzb <command> [options] | 6 | rzb <command> [options] |
| @@ -36,7 +36,7 @@ Options win over the `server:` section of the file. On start it prints, on stand | |||
| 36 | 36 | ||
| 37 | ``` | 37 | ``` |
| 38 | config: server.yaml (2 declared models) | 38 | config: server.yaml (2 declared models) |
| 39 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | 39 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop |
| 40 | ``` | 40 | ``` |
| 41 | 41 | ||
| 42 | The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged. | 42 | The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged. |
| @@ -83,7 +83,7 @@ The cache is `$HF_HUB_CACHE`, else `$HF_HOME/hub`, else `~/.cache/huggingface/hu | |||
| 83 | 83 | ||
| 84 | ## rzb version | 84 | ## rzb version |
| 85 | 85 | ||
| 86 | -Prints `rzb 0.3.0 (engines: fake, mlx)` (the engines of this build, sorted). `rzb --version` prints `0.3.0`. | 86 | +Prints `rzb 1.0.0 (engines: fake, mlx)` (the engines of this build, sorted). `rzb --version` prints `1.0.0`. |
| 87 | 87 | ||
| 88 | ## Exit codes | 88 | ## Exit codes |
| 89 | 89 | ||
modified
docs/en/reference/http-api.md +1 -1 | @@ -375,7 +375,7 @@ curl -s http://127.0.0.1:7920/rzb/status | ||
| 375 | 375 | Example, after one chat request: |
| 376 | 376 | |
| 377 | 377 | ```json |
| 378 | -{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "0.3.0", | |
| 378 | +{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "1.0.0", | |
| 379 | 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, |
| 380 | 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, |
| 381 | 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, |
| @@ -375,7 +375,7 @@ curl -s http://127.0.0.1:7920/rzb/status | |||
| 375 | Example, after one chat request: | 375 | Example, after one chat request: |
| 376 | 376 | ||
| 377 | ```json | 377 | ```json |
| 378 | -{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "0.3.0", | 378 | +{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "1.0.0", |
| 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, | 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, |
| 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, | 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, |
| 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, | 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, |
modified
docs/en/tutorials/getting-started.md +1 -1 | @@ -43,7 +43,7 @@ rzb serve | ||
| 43 | 43 | You should see: |
| 44 | 44 | |
| 45 | 45 | ``` |
| 46 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | |
| 46 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | |
| 47 | 47 | ``` |
| 48 | 48 | |
| 49 | 49 | The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps. |
| @@ -43,7 +43,7 @@ rzb serve | |||
| 43 | You should see: | 43 | You should see: |
| 44 | 44 | ||
| 45 | ``` | 45 | ``` |
| 46 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | 46 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps. | 49 | The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps. |
modified
docs/fr/README.md +1 -1 | @@ -12,7 +12,7 @@ Cette documentation suit [Diátaxis](https://diataxis.fr) : choisissez la sectio | ||
| 12 | 12 | ## Faire — guides pratiques |
| 13 | 13 | |
| 14 | 14 | - [Compiler rzb sur le Mac](how-to/compiler-sur-le-mac.md) |
| 15 | -- [Préparer une archive de release](how-to/preparer-une-release.md) : l'archive `.tar.gz` et son empreinte. | |
| 15 | +- [Préparer et publier une release](how-to/preparer-une-release.md) : la CI locale, la signature Developer ID et la notarisation, la publication sur Rickub. | |
| 16 | 16 | - [Gérer les modèles](how-to/gerer-les-modeles.md) |
| 17 | 17 | - [Configurer le serveur](how-to/configurer-le-serveur.md) : noms de modèles, valeurs par défaut, verrous, limites, accès réseau. |
| 18 | 18 | - [Surveiller et piloter un serveur en marche](how-to/surveiller-et-piloter-le-serveur.md) : état, libération d'un modèle, rechargement de la configuration. |
| @@ -12,7 +12,7 @@ Cette documentation suit [Diátaxis](https://diataxis.fr) : choisissez la sectio | |||
| 12 | ## Faire — guides pratiques | 12 | ## Faire — guides pratiques |
| 13 | 13 | ||
| 14 | - [Compiler rzb sur le Mac](how-to/compiler-sur-le-mac.md) | 14 | - [Compiler rzb sur le Mac](how-to/compiler-sur-le-mac.md) |
| 15 | -- [Préparer une archive de release](how-to/preparer-une-release.md) : l'archive `.tar.gz` et son empreinte. | 15 | +- [Préparer et publier une release](how-to/preparer-une-release.md) : la CI locale, la signature Developer ID et la notarisation, la publication sur Rickub. |
| 16 | - [Gérer les modèles](how-to/gerer-les-modeles.md) | 16 | - [Gérer les modèles](how-to/gerer-les-modeles.md) |
| 17 | - [Configurer le serveur](how-to/configurer-le-serveur.md) : noms de modèles, valeurs par défaut, verrous, limites, accès réseau. | 17 | - [Configurer le serveur](how-to/configurer-le-serveur.md) : noms de modèles, valeurs par défaut, verrous, limites, accès réseau. |
| 18 | - [Surveiller et piloter un serveur en marche](how-to/surveiller-et-piloter-le-serveur.md) : état, libération d'un modèle, rechargement de la configuration. | 18 | - [Surveiller et piloter un serveur en marche](how-to/surveiller-et-piloter-le-serveur.md) : état, libération d'un modèle, rechargement de la configuration. |
modified
docs/fr/how-to/compiler-sur-le-mac.md +2 -2 | @@ -26,7 +26,7 @@ L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce | ||
| 26 | 26 | |
| 27 | 27 | ```bash |
| 28 | 28 | .build/xcode/Build/Products/Release/rzb version |
| 29 | -# rzb 0.3.0 (engines: fake, mlx) | |
| 29 | +# rzb 1.0.0 (engines: fake, mlx) | |
| 30 | 30 | ``` |
| 31 | 31 | |
| 32 | 32 | ## Installer |
| @@ -52,7 +52,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | ||
| 52 | 52 | |
| 53 | 53 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. |
| 54 | 54 | - **Lister les schemes** : `xcodebuild -list`. Le package n'a qu'un scheme, `razorbill` ; `rzb` et `razorbill-Package` n'existent pas. |
| 55 | -- **Archive à distribuer** : voir [Préparer une archive de release](preparer-une-release.md). | |
| 55 | +- **Archive à distribuer** : voir [Préparer et publier une release](preparer-une-release.md). | |
| 56 | 56 | - **Depuis une sandbox Linux** : voir [Développer depuis une sandbox Linux](developper-depuis-une-sandbox.md). |
| 57 | 57 | |
| 58 | 58 | ## En cas de problème |
| @@ -26,7 +26,7 @@ L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce | |||
| 26 | 26 | ||
| 27 | ```bash | 27 | ```bash |
| 28 | .build/xcode/Build/Products/Release/rzb version | 28 | .build/xcode/Build/Products/Release/rzb version |
| 29 | -# rzb 0.3.0 (engines: fake, mlx) | 29 | +# rzb 1.0.0 (engines: fake, mlx) |
| 30 | ``` | 30 | ``` |
| 31 | 31 | ||
| 32 | ## Installer | 32 | ## Installer |
| @@ -52,7 +52,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | |||
| 52 | 52 | ||
| 53 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. | 53 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. |
| 54 | - **Lister les schemes** : `xcodebuild -list`. Le package n'a qu'un scheme, `razorbill` ; `rzb` et `razorbill-Package` n'existent pas. | 54 | - **Lister les schemes** : `xcodebuild -list`. Le package n'a qu'un scheme, `razorbill` ; `rzb` et `razorbill-Package` n'existent pas. |
| 55 | -- **Archive à distribuer** : voir [Préparer une archive de release](preparer-une-release.md). | 55 | +- **Archive à distribuer** : voir [Préparer et publier une release](preparer-une-release.md). |
| 56 | - **Depuis une sandbox Linux** : voir [Développer depuis une sandbox Linux](developper-depuis-une-sandbox.md). | 56 | - **Depuis une sandbox Linux** : voir [Développer depuis une sandbox Linux](developper-depuis-une-sandbox.md). |
| 57 | 57 | ||
| 58 | ## En cas de problème | 58 | ## En cas de problème |
modified
docs/fr/how-to/preparer-une-release.md +88 -19 | @@ -1,44 +1,113 @@ | ||
| 1 | -# Préparer une archive de release | |
| 1 | +# Préparer et publier une release | |
| 2 | 2 | |
| 3 | -Ce guide fabrique l'archive de release de razorbill : `rzb` et les bundles de ressources dont il a besoin, dans un seul `.tar.gz` accompagné de son SHA-256. Il suppose que vous savez déjà [compiler rzb sur le Mac](compiler-sur-le-mac.md). | |
| 3 | +Ce guide fabrique la release de razorbill, signe et notarise `rzb`, et la publie sur Rickub, avec les scripts `local-ci-*.sh` à la racine du dépôt. Il suppose que vous savez déjà [compiler rzb sur le Mac](compiler-sur-le-mac.md). Les utilisateurs installent le résultat avec [`INSTALL.MACOS.fr.md`](../../../INSTALL.MACOS.fr.md). | |
| 4 | 4 | |
| 5 | -## Étapes | |
| 5 | +| Étape | Script | Où | | |
| 6 | +| --- | --- | --- | | |
| 7 | +| Vérifications | `./local-ci-01-check.sh` | le Mac (sous Linux, MLX n'est pas testé) | | |
| 8 | +| Compiler, signer, notariser | `./local-ci-02-build.sh` | le Mac | | |
| 9 | +| Étiquette et brouillon de prerelease | `./local-ci-03-create-draft.sh` | le Mac ou Linux | | |
| 10 | +| Envoi | `./local-ci-04-upload.sh` | le Mac ou Linux | | |
| 11 | +| Publication | `./local-ci-05-publish.sh` | le Mac ou Linux ; demande de taper l'étiquette | | |
| 12 | +| Promotion (facultatif) | `./local-ci-06-promote.sh` | le Mac ou Linux ; demande de taper l'étiquette | | |
| 6 | 13 | |
| 7 | -1. Fixez la version dans `Sources/RazorbillCore/Razorbill.swift` (`static let version = "…"`), mettez à jour la version affichée dans la documentation, puis committez. Le script refuse les modifications non committées. | |
| 8 | -2. Depuis la racine du dépôt, sur le Mac : | |
| 14 | +## Réglages (une fois) | |
| 15 | + | |
| 16 | +1. **Le jeton Rickub** : `.ci.cd.token.env` à la racine, avec `CI_TOKEN=…`. Il est ignoré par git ; ne le committez jamais. | |
| 17 | +2. **Les réglages de release** : `.release.env` à la racine, ignoré par git lui aussi : | |
| 18 | + | |
| 19 | + ```bash | |
| 20 | + TAG="v1.0.0" | |
| 21 | + ABOUT="razorbill — MLX model server with an OpenAI-compatible API" | |
| 22 | + OWNER="bots-garden" | |
| 23 | + REPO="razorbill" | |
| 24 | + # Signature macOS. Vide = rzb n'est pas signé. | |
| 25 | + RZB_SIGN_IDENTITY="${SIDEKICKS_SIGN_IDENTITY:-}" | |
| 26 | + RZB_NOTARY_PROFILE="${SIDEKICKS_NOTARY_PROFILE:-}" | |
| 27 | + ``` | |
| 28 | + | |
| 29 | + `.release.env` est lu par bash : il reprend les variables exportées dans votre `~/.zshrc`. | |
| 30 | +3. **L'identité de signature** : `security find-identity -v -p codesigning` doit lister `"Developer ID Application: … (TEAMID)"`, exactement la valeur de `RZB_SIGN_IDENTITY`. Le certificat appartient à l'équipe, pas à une application : celui qui signe mini-me et Sidekicks signe aussi rzb. Rien n'est à enregistrer chez Apple pour rzb ; son identifiant, `com.bots-garden.rzb`, est choisi par le script. | |
| 31 | +4. **Le profil de notarisation** : `xcrun notarytool history --keychain-profile "$RZB_NOTARY_PROFILE"` doit lister des soumissions sans erreur d'authentification. S'il manque : créez un mot de passe pour app sur [account.apple.com](https://account.apple.com), puis `xcrun notarytool store-credentials <nom> --apple-id <vous@example.com> --team-id <TEAMID>`. | |
| 32 | +5. **Le hardened runtime** : la notarisation l'exige. Vérifiez que rzb fonctionne toujours avec, les modèles de la suite de compatibilité téléchargés : | |
| 33 | + | |
| 34 | + ```bash | |
| 35 | + scripts/check-hardened-runtime.sh | |
| 36 | + ``` | |
| 37 | + | |
| 38 | + Il signe une compilation Release comme la release (avec `RZB_SIGN_IDENTITY` s'il est défini, sinon ad hoc) et lance [`scripts/compat.sh`](lancer-les-tests.md) sur cette copie : vrai chat, streaming, sortie structurée, outils et embeddings. Relancez-le après une mise à jour de MLX ou de macOS. S'il échoue alors que `scripts/compat.sh` seul passe, rzb a besoin d'un entitlement : ne publiez pas de release signée avant d'avoir réglé ce point. | |
| 39 | + | |
| 40 | +## À chaque release | |
| 41 | + | |
| 42 | +1. Préparez la release (version dans `Sources/RazorbillCore/Razorbill.swift` et la documentation, notes `release-notes/vX.Y.Z.md` et `.fr.md`, `TAG` dans `.release.env`) : la skill `release` s'en charge. Committez et poussez `main` : l'étape 03 refuse un arbre qui n'est pas propre ou un `HEAD` qui n'est pas le `main` distant. | |
| 43 | +2. Si le dépôt est dans un dossier synchronisé (kDrive, iCloud Drive…), mettez la synchronisation en pause pendant l'étape 02. | |
| 44 | +3. Sur le Mac : | |
| 9 | 45 | |
| 10 | 46 | ```bash |
| 11 | - scripts/release.sh | |
| 47 | + ./local-ci-01-check.sh | |
| 48 | + ./local-ci-02-build.sh | |
| 12 | 49 | ``` |
| 13 | 50 | |
| 14 | - Il compile en Release dans `.build/release` (un dossier à part : la première fois, tout est recompilé), assemble l'archive, la décompresse dans un dossier temporaire et vérifie que le `rzb --version` décompressé affiche la version. Il termine en affichant l'archive et son empreinte : | |
| 51 | + Avec `RZB_SIGN_IDENTITY` défini, l'étape 02 vérifie les réglages avant de compiler (identité dans le trousseau, profil notarytool qui fonctionne), compile en Release dans `.build/release`, copie `rzb` et ses bundles dans un dossier temporaire, signe les bundles puis `rzb` (`--options runtime --timestamp --identifier com.bots-garden.rzb`), contrôle la signature (autorité Developer ID, drapeau `runtime`, horodatage), envoie le dossier à Apple dans un `.zip` et attend `Accepted`. Ensuite `scripts/release.sh --products` fabrique l'archive ; l'étape 02 la décompresse, contrôle de nouveau les signatures et lance le `rzb --version` décompressé. Vous devez voir : | |
| 15 | 52 | |
| 16 | 53 | ``` |
| 17 | - dist/razorbill-0.3.0-macos-arm64.tar.gz | |
| 18 | - <sha256> razorbill-0.3.0-macos-arm64.tar.gz | |
| 54 | + 🔏 Signing and notarizing rzb and its bundles... | |
| 55 | + ✅ rzb signed (Developer ID, hardened runtime, timestamp) and 6 bundles sealed | |
| 56 | + ⏳ waiting for Apple's notary service (a few minutes)... | |
| 57 | + ✅ notarized (submission 1a2b3c4d-…) | |
| 58 | + ✅ signatures intact in the unpacked archive | |
| 59 | + ✅ the archived rzb starts and reports 1.0.0 | |
| 60 | + ``` | |
| 61 | + | |
| 62 | + `release/<TAG>/` contient alors l'archive, `SHA256SUMS`, un `README.md` et `macos-signature.txt` (la signature et la soumission de notarisation ; non publié). | |
| 63 | +4. Puis : | |
| 64 | + | |
| 65 | + ```bash | |
| 66 | + ./local-ci-03-create-draft.sh # l'étiquette v1.0.0 et un brouillon de prerelease | |
| 67 | + ./local-ci-04-upload.sh # l'archive et SHA256SUMS | |
| 68 | + ./local-ci-05-publish.sh # publique ; devient /releases/latest | |
| 69 | + ./local-ci-06-promote.sh # facultatif : retire l'étiquette pre-release | |
| 19 | 70 | ``` |
| 20 | 71 | |
| 21 | -3. Vérifiez le serveur depuis l'archive avant de la publier, par exemple en la décompressant ailleurs et en lançant `rzb serve` avec un modèle. | |
| 22 | -4. Étiquetez le commit (`git tag -a v0.3.0 -m "razorbill 0.3.0"`) et publiez `dist/razorbill-<version>-macos-arm64.tar.gz` avec son fichier `.sha256`. | |
| 72 | + L'étape 03 rédige le texte de la release à partir d'`ABOUT`, de la phrase de résumé de `release-notes/<TAG>.md`, du commit, de la version de Xcode (notée par l'étape 02), d'une ligne de signature quand `macos-signature.txt` existe, de liens vers les notes et le guide d'installation, et de l'empreinte. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` affiche ce texte sans rien créer. | |
| 73 | + | |
| 74 | + Rickub n'accepte d'envoi de fichiers qu'avec le jeton d'un job de CI : l'étape 04 pousse donc une branche temporaire avec l'archive et un workflow d'un seul job, attend le job et supprime la branche. L'étape 05 télécharge ce qui est public et le compare à `release/<TAG>/`. | |
| 75 | +5. Essayez comme un utilisateur : téléchargez l'archive **avec un navigateur**, décompressez-la et lancez `rzb --version` depuis le dossier ; aucune fenêtre ne doit le bloquer. | |
| 76 | + | |
| 77 | +Une release publiée ne peut pas recevoir une nouvelle archive à la place de l'ancienne : Rickub refuse un nom de fichier qui existe déjà. Publiez plutôt une nouvelle version. | |
| 23 | 78 | |
| 24 | 79 | ## Contenu de l'archive |
| 25 | 80 | |
| 26 | 81 | | Élément | Rôle | |
| 27 | 82 | | --- | --- | |
| 28 | -| `rzb` | L'exécutable (Apple Silicon, macOS 14 ou plus récent). | | |
| 83 | +| `rzb` | L'exécutable (Apple Silicon, macOS 14 ou plus récent), signé avec le hardened runtime. | | |
| 29 | 84 | | `mlx-swift_Cmlx.bundle` | La bibliothèque Metal de MLX (`default.metallib`) ; sans elle, aucun modèle ne se charge. | |
| 30 | -| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Le script copie tous les `*.bundle` de la compilation. | | |
| 31 | -| `INSTALL.txt` | Où placer le dossier, comment l'ajouter au `PATH`, comment lever la quarantaine. | | |
| 85 | +| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Tous les `*.bundle` de la compilation sont copiés, et scellés par la signature. | | |
| 86 | +| `INSTALL.txt` | Où placer le dossier ; indique si l'archive est signée. | | |
| 87 | +| `LICENSE` | La licence MIT. | | |
| 32 | 88 | |
| 33 | -Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. Sur un Mac avec les sources, `scripts/install.sh` le fait pour vous ([Compiler rzb sur le Mac](compiler-sur-le-mac.md#installer)). | |
| 89 | +Les bundles doivent rester à côté de `rzb` : le dossier s'installe entier, avec un lanceur dans `bin/` ([`INSTALL.MACOS.fr.md`](../../../INSTALL.MACOS.fr.md)). | |
| 34 | 90 | |
| 35 | 91 | ## Variantes |
| 36 | 92 | |
| 37 | -- **Assembler une compilation existante** : `scripts/release.sh --products .build/xcode/Build/Products/Release` saute la compilation. Cela fonctionne aussi depuis Linux, où la vérification finale `rzb --version` est sautée. | |
| 38 | -- **Archive de test avec des modifications non committées** : ajoutez `--allow-dirty`. Ne publiez pas une telle archive. | |
| 39 | -- **Archive téléchargée avec un navigateur** : macOS la met en quarantaine et refuse de lancer `rzb`, qui n'a qu'une signature ad hoc. Levez la quarantaine avec `xattr -dr com.apple.quarantine <dossier>`. La signature Developer ID et la notarisation sont prévues pour la 1.0.0. | |
| 93 | +- **Archive non signée** : laissez `RZB_SIGN_IDENTITY` vide. L'étape 02 avertit `rzb is not signed` et `INSTALL.txt` donne la commande `xattr`. | |
| 94 | +- **Archive sans la CI** : `scripts/release.sh` compile et assemble dans `dist/` (sans signature). `--products <dossier>` assemble une compilation existante (aussi depuis Linux, sans la vérification finale `rzb --version`), `--out <dossier>` écrit ailleurs, `--allow-dirty` accepte des modifications non committées (ne publiez jamais une telle archive). | |
| 95 | + | |
| 96 | +## Dépannage | |
| 97 | + | |
| 98 | +| Symptôme | Que faire | | |
| 99 | +| --- | --- | | |
| 100 | +| `TAG is v… but Sources/RazorbillCore/Razorbill.swift says …` | L'étiquette et la version compilée diffèrent : corrigez l'une des deux (la skill `release` règle les deux). | | |
| 101 | +| `RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not` | Ajoutez le profil à `.release.env`. Un binaire signé mais non notarisé reste bloqué par Gatekeeper. | | |
| 102 | +| `no valid identity "…" in the keychain` | `security find-identity -v -p codesigning`, copiez la valeur exacte. Si elle affiche `CSSMERR_TP_NOT_TRUSTED`, installez le certificat intermédiaire Developer ID G2 depuis [apple.com/certificateauthority](https://www.apple.com/certificateauthority/). | | |
| 103 | +| `the notarytool profile "…" does not work` | `xcrun notarytool history --keychain-profile "…"` donne l'erreur ; un mot de passe pour app révoqué se refait. | | |
| 104 | +| `notarization …: Invalid` | `xcrun notarytool log <id> --keychain-profile "$RZB_NOTARY_PROFILE"` (la commande est affichée) donne la raison. | | |
| 105 | +| `codesign` refuse (« resource fork, Finder information, or similar detritus ») | Des métadonnées d'un dossier synchronisé. Le script les efface avec `xattr -cr` ; mettez la synchronisation en pause et relancez l'étape 02. | | |
| 106 | +| `is not writable (left by a run with sudo?)` | `sudo chown -R "$(whoami)" release dist .build`, et ne lancez jamais ces scripts avec sudo. | | |
| 107 | +| `HEAD (…) is not the remote's main` | Poussez `main` d'abord. | | |
| 40 | 108 | |
| 41 | 109 | ## Voir aussi |
| 42 | 110 | |
| 43 | 111 | - [Compiler rzb sur le Mac](compiler-sur-le-mac.md) |
| 44 | -- [Lancer les tests](lancer-les-tests.md), à faire avant une release. | |
| 112 | +- [Lancer les tests](lancer-les-tests.md), que l'étape 01 lance. | |
| 113 | +- Apple : [Notarizing macOS software before distribution](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution) | |
| @@ -1,44 +1,113 @@ | |||
| 1 | -# Préparer une archive de release | 1 | +# Préparer et publier une release |
| 2 | 2 | ||
| 3 | -Ce guide fabrique l'archive de release de razorbill : `rzb` et les bundles de ressources dont il a besoin, dans un seul `.tar.gz` accompagné de son SHA-256. Il suppose que vous savez déjà [compiler rzb sur le Mac](compiler-sur-le-mac.md). | 3 | +Ce guide fabrique la release de razorbill, signe et notarise `rzb`, et la publie sur Rickub, avec les scripts `local-ci-*.sh` à la racine du dépôt. Il suppose que vous savez déjà [compiler rzb sur le Mac](compiler-sur-le-mac.md). Les utilisateurs installent le résultat avec [`INSTALL.MACOS.fr.md`](../../../INSTALL.MACOS.fr.md). |
| 4 | 4 | ||
| 5 | -## Étapes | 5 | +| Étape | Script | Où | |
| 6 | +| --- | --- | --- | | ||
| 7 | +| Vérifications | `./local-ci-01-check.sh` | le Mac (sous Linux, MLX n'est pas testé) | | ||
| 8 | +| Compiler, signer, notariser | `./local-ci-02-build.sh` | le Mac | | ||
| 9 | +| Étiquette et brouillon de prerelease | `./local-ci-03-create-draft.sh` | le Mac ou Linux | | ||
| 10 | +| Envoi | `./local-ci-04-upload.sh` | le Mac ou Linux | | ||
| 11 | +| Publication | `./local-ci-05-publish.sh` | le Mac ou Linux ; demande de taper l'étiquette | | ||
| 12 | +| Promotion (facultatif) | `./local-ci-06-promote.sh` | le Mac ou Linux ; demande de taper l'étiquette | | ||
| 6 | 13 | ||
| 7 | -1. Fixez la version dans `Sources/RazorbillCore/Razorbill.swift` (`static let version = "…"`), mettez à jour la version affichée dans la documentation, puis committez. Le script refuse les modifications non committées. | 14 | +## Réglages (une fois) |
| 8 | -2. Depuis la racine du dépôt, sur le Mac : | 15 | + |
| 16 | +1. **Le jeton Rickub** : `.ci.cd.token.env` à la racine, avec `CI_TOKEN=…`. Il est ignoré par git ; ne le committez jamais. | ||
| 17 | +2. **Les réglages de release** : `.release.env` à la racine, ignoré par git lui aussi : | ||
| 18 | + | ||
| 19 | + ```bash | ||
| 20 | + TAG="v1.0.0" | ||
| 21 | + ABOUT="razorbill — MLX model server with an OpenAI-compatible API" | ||
| 22 | + OWNER="bots-garden" | ||
| 23 | + REPO="razorbill" | ||
| 24 | + # Signature macOS. Vide = rzb n'est pas signé. | ||
| 25 | + RZB_SIGN_IDENTITY="${SIDEKICKS_SIGN_IDENTITY:-}" | ||
| 26 | + RZB_NOTARY_PROFILE="${SIDEKICKS_NOTARY_PROFILE:-}" | ||
| 27 | + ``` | ||
| 28 | + | ||
| 29 | + `.release.env` est lu par bash : il reprend les variables exportées dans votre `~/.zshrc`. | ||
| 30 | +3. **L'identité de signature** : `security find-identity -v -p codesigning` doit lister `"Developer ID Application: … (TEAMID)"`, exactement la valeur de `RZB_SIGN_IDENTITY`. Le certificat appartient à l'équipe, pas à une application : celui qui signe mini-me et Sidekicks signe aussi rzb. Rien n'est à enregistrer chez Apple pour rzb ; son identifiant, `com.bots-garden.rzb`, est choisi par le script. | ||
| 31 | +4. **Le profil de notarisation** : `xcrun notarytool history --keychain-profile "$RZB_NOTARY_PROFILE"` doit lister des soumissions sans erreur d'authentification. S'il manque : créez un mot de passe pour app sur [account.apple.com](https://account.apple.com), puis `xcrun notarytool store-credentials <nom> --apple-id <vous@example.com> --team-id <TEAMID>`. | ||
| 32 | +5. **Le hardened runtime** : la notarisation l'exige. Vérifiez que rzb fonctionne toujours avec, les modèles de la suite de compatibilité téléchargés : | ||
| 33 | + | ||
| 34 | + ```bash | ||
| 35 | + scripts/check-hardened-runtime.sh | ||
| 36 | + ``` | ||
| 37 | + | ||
| 38 | + Il signe une compilation Release comme la release (avec `RZB_SIGN_IDENTITY` s'il est défini, sinon ad hoc) et lance [`scripts/compat.sh`](lancer-les-tests.md) sur cette copie : vrai chat, streaming, sortie structurée, outils et embeddings. Relancez-le après une mise à jour de MLX ou de macOS. S'il échoue alors que `scripts/compat.sh` seul passe, rzb a besoin d'un entitlement : ne publiez pas de release signée avant d'avoir réglé ce point. | ||
| 39 | + | ||
| 40 | +## À chaque release | ||
| 41 | + | ||
| 42 | +1. Préparez la release (version dans `Sources/RazorbillCore/Razorbill.swift` et la documentation, notes `release-notes/vX.Y.Z.md` et `.fr.md`, `TAG` dans `.release.env`) : la skill `release` s'en charge. Committez et poussez `main` : l'étape 03 refuse un arbre qui n'est pas propre ou un `HEAD` qui n'est pas le `main` distant. | ||
| 43 | +2. Si le dépôt est dans un dossier synchronisé (kDrive, iCloud Drive…), mettez la synchronisation en pause pendant l'étape 02. | ||
| 44 | +3. Sur le Mac : | ||
| 9 | 45 | ||
| 10 | ```bash | 46 | ```bash |
| 11 | - scripts/release.sh | 47 | + ./local-ci-01-check.sh |
| 48 | + ./local-ci-02-build.sh | ||
| 12 | ``` | 49 | ``` |
| 13 | 50 | ||
| 14 | - Il compile en Release dans `.build/release` (un dossier à part : la première fois, tout est recompilé), assemble l'archive, la décompresse dans un dossier temporaire et vérifie que le `rzb --version` décompressé affiche la version. Il termine en affichant l'archive et son empreinte : | 51 | + Avec `RZB_SIGN_IDENTITY` défini, l'étape 02 vérifie les réglages avant de compiler (identité dans le trousseau, profil notarytool qui fonctionne), compile en Release dans `.build/release`, copie `rzb` et ses bundles dans un dossier temporaire, signe les bundles puis `rzb` (`--options runtime --timestamp --identifier com.bots-garden.rzb`), contrôle la signature (autorité Developer ID, drapeau `runtime`, horodatage), envoie le dossier à Apple dans un `.zip` et attend `Accepted`. Ensuite `scripts/release.sh --products` fabrique l'archive ; l'étape 02 la décompresse, contrôle de nouveau les signatures et lance le `rzb --version` décompressé. Vous devez voir : |
| 15 | 52 | ||
| 16 | ``` | 53 | ``` |
| 17 | - dist/razorbill-0.3.0-macos-arm64.tar.gz | 54 | + 🔏 Signing and notarizing rzb and its bundles... |
| 18 | - <sha256> razorbill-0.3.0-macos-arm64.tar.gz | 55 | + ✅ rzb signed (Developer ID, hardened runtime, timestamp) and 6 bundles sealed |
| 56 | + ⏳ waiting for Apple's notary service (a few minutes)... | ||
| 57 | + ✅ notarized (submission 1a2b3c4d-…) | ||
| 58 | + ✅ signatures intact in the unpacked archive | ||
| 59 | + ✅ the archived rzb starts and reports 1.0.0 | ||
| 60 | + ``` | ||
| 61 | + | ||
| 62 | + `release/<TAG>/` contient alors l'archive, `SHA256SUMS`, un `README.md` et `macos-signature.txt` (la signature et la soumission de notarisation ; non publié). | ||
| 63 | +4. Puis : | ||
| 64 | + | ||
| 65 | + ```bash | ||
| 66 | + ./local-ci-03-create-draft.sh # l'étiquette v1.0.0 et un brouillon de prerelease | ||
| 67 | + ./local-ci-04-upload.sh # l'archive et SHA256SUMS | ||
| 68 | + ./local-ci-05-publish.sh # publique ; devient /releases/latest | ||
| 69 | + ./local-ci-06-promote.sh # facultatif : retire l'étiquette pre-release | ||
| 19 | ``` | 70 | ``` |
| 20 | 71 | ||
| 21 | -3. Vérifiez le serveur depuis l'archive avant de la publier, par exemple en la décompressant ailleurs et en lançant `rzb serve` avec un modèle. | 72 | + L'étape 03 rédige le texte de la release à partir d'`ABOUT`, de la phrase de résumé de `release-notes/<TAG>.md`, du commit, de la version de Xcode (notée par l'étape 02), d'une ligne de signature quand `macos-signature.txt` existe, de liens vers les notes et le guide d'installation, et de l'empreinte. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` affiche ce texte sans rien créer. |
| 22 | -4. Étiquetez le commit (`git tag -a v0.3.0 -m "razorbill 0.3.0"`) et publiez `dist/razorbill-<version>-macos-arm64.tar.gz` avec son fichier `.sha256`. | 73 | + |
| 74 | + Rickub n'accepte d'envoi de fichiers qu'avec le jeton d'un job de CI : l'étape 04 pousse donc une branche temporaire avec l'archive et un workflow d'un seul job, attend le job et supprime la branche. L'étape 05 télécharge ce qui est public et le compare à `release/<TAG>/`. | ||
| 75 | +5. Essayez comme un utilisateur : téléchargez l'archive **avec un navigateur**, décompressez-la et lancez `rzb --version` depuis le dossier ; aucune fenêtre ne doit le bloquer. | ||
| 76 | + | ||
| 77 | +Une release publiée ne peut pas recevoir une nouvelle archive à la place de l'ancienne : Rickub refuse un nom de fichier qui existe déjà. Publiez plutôt une nouvelle version. | ||
| 23 | 78 | ||
| 24 | ## Contenu de l'archive | 79 | ## Contenu de l'archive |
| 25 | 80 | ||
| 26 | | Élément | Rôle | | 81 | | Élément | Rôle | |
| 27 | | --- | --- | | 82 | | --- | --- | |
| 28 | -| `rzb` | L'exécutable (Apple Silicon, macOS 14 ou plus récent). | | 83 | +| `rzb` | L'exécutable (Apple Silicon, macOS 14 ou plus récent), signé avec le hardened runtime. | |
| 29 | | `mlx-swift_Cmlx.bundle` | La bibliothèque Metal de MLX (`default.metallib`) ; sans elle, aucun modèle ne se charge. | | 84 | | `mlx-swift_Cmlx.bundle` | La bibliothèque Metal de MLX (`default.metallib`) ; sans elle, aucun modèle ne se charge. | |
| 30 | -| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Le script copie tous les `*.bundle` de la compilation. | | 85 | +| `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Tous les `*.bundle` de la compilation sont copiés, et scellés par la signature. | |
| 31 | -| `INSTALL.txt` | Où placer le dossier, comment l'ajouter au `PATH`, comment lever la quarantaine. | | 86 | +| `INSTALL.txt` | Où placer le dossier ; indique si l'archive est signée. | |
| 87 | +| `LICENSE` | La licence MIT. | | ||
| 32 | 88 | ||
| 33 | -Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. Sur un Mac avec les sources, `scripts/install.sh` le fait pour vous ([Compiler rzb sur le Mac](compiler-sur-le-mac.md#installer)). | 89 | +Les bundles doivent rester à côté de `rzb` : le dossier s'installe entier, avec un lanceur dans `bin/` ([`INSTALL.MACOS.fr.md`](../../../INSTALL.MACOS.fr.md)). |
| 34 | 90 | ||
| 35 | ## Variantes | 91 | ## Variantes |
| 36 | 92 | ||
| 37 | -- **Assembler une compilation existante** : `scripts/release.sh --products .build/xcode/Build/Products/Release` saute la compilation. Cela fonctionne aussi depuis Linux, où la vérification finale `rzb --version` est sautée. | 93 | +- **Archive non signée** : laissez `RZB_SIGN_IDENTITY` vide. L'étape 02 avertit `rzb is not signed` et `INSTALL.txt` donne la commande `xattr`. |
| 38 | -- **Archive de test avec des modifications non committées** : ajoutez `--allow-dirty`. Ne publiez pas une telle archive. | 94 | +- **Archive sans la CI** : `scripts/release.sh` compile et assemble dans `dist/` (sans signature). `--products <dossier>` assemble une compilation existante (aussi depuis Linux, sans la vérification finale `rzb --version`), `--out <dossier>` écrit ailleurs, `--allow-dirty` accepte des modifications non committées (ne publiez jamais une telle archive). |
| 39 | -- **Archive téléchargée avec un navigateur** : macOS la met en quarantaine et refuse de lancer `rzb`, qui n'a qu'une signature ad hoc. Levez la quarantaine avec `xattr -dr com.apple.quarantine <dossier>`. La signature Developer ID et la notarisation sont prévues pour la 1.0.0. | 95 | + |
| 96 | +## Dépannage | ||
| 97 | + | ||
| 98 | +| Symptôme | Que faire | | ||
| 99 | +| --- | --- | | ||
| 100 | +| `TAG is v… but Sources/RazorbillCore/Razorbill.swift says …` | L'étiquette et la version compilée diffèrent : corrigez l'une des deux (la skill `release` règle les deux). | | ||
| 101 | +| `RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not` | Ajoutez le profil à `.release.env`. Un binaire signé mais non notarisé reste bloqué par Gatekeeper. | | ||
| 102 | +| `no valid identity "…" in the keychain` | `security find-identity -v -p codesigning`, copiez la valeur exacte. Si elle affiche `CSSMERR_TP_NOT_TRUSTED`, installez le certificat intermédiaire Developer ID G2 depuis [apple.com/certificateauthority](https://www.apple.com/certificateauthority/). | | ||
| 103 | +| `the notarytool profile "…" does not work` | `xcrun notarytool history --keychain-profile "…"` donne l'erreur ; un mot de passe pour app révoqué se refait. | | ||
| 104 | +| `notarization …: Invalid` | `xcrun notarytool log <id> --keychain-profile "$RZB_NOTARY_PROFILE"` (la commande est affichée) donne la raison. | | ||
| 105 | +| `codesign` refuse (« resource fork, Finder information, or similar detritus ») | Des métadonnées d'un dossier synchronisé. Le script les efface avec `xattr -cr` ; mettez la synchronisation en pause et relancez l'étape 02. | | ||
| 106 | +| `is not writable (left by a run with sudo?)` | `sudo chown -R "$(whoami)" release dist .build`, et ne lancez jamais ces scripts avec sudo. | | ||
| 107 | +| `HEAD (…) is not the remote's main` | Poussez `main` d'abord. | | ||
| 40 | 108 | ||
| 41 | ## Voir aussi | 109 | ## Voir aussi |
| 42 | 110 | ||
| 43 | - [Compiler rzb sur le Mac](compiler-sur-le-mac.md) | 111 | - [Compiler rzb sur le Mac](compiler-sur-le-mac.md) |
| 44 | -- [Lancer les tests](lancer-les-tests.md), à faire avant une release. | 112 | +- [Lancer les tests](lancer-les-tests.md), que l'étape 01 lance. |
| 113 | +- Apple : [Notarizing macOS software before distribution](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution) | ||
modified
docs/fr/reference/api-http.md +1 -1 | @@ -375,7 +375,7 @@ curl -s http://127.0.0.1:7920/rzb/status | ||
| 375 | 375 | Exemple, après une requête de chat : |
| 376 | 376 | |
| 377 | 377 | ```json |
| 378 | -{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "0.3.0", | |
| 378 | +{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "1.0.0", | |
| 379 | 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, |
| 380 | 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, |
| 381 | 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, |
| @@ -375,7 +375,7 @@ curl -s http://127.0.0.1:7920/rzb/status | |||
| 375 | Exemple, après une requête de chat : | 375 | Exemple, après une requête de chat : |
| 376 | 376 | ||
| 377 | ```json | 377 | ```json |
| 378 | -{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "0.3.0", | 378 | +{"config_file": "/Users/me/server.yaml", "host": "127.0.0.1", "port": 7920, "uptime_seconds": 34, "version": "1.0.0", |
| 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, | 379 | "memory": {"active_bytes": 364743776, "cache_bytes": 23594047, "limit_bytes": 32641751449, "peak_bytes": 408882564}, |
| 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, | 380 | "system": {"available_bytes": 18200000000, "compressed_bytes": 1100000000, "gpu_utilization": 87, "physical_bytes": 34359738368, |
| 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, | 381 | "pressure": "normal", "process_bytes": 4400000000, "swap_used_bytes": 0}, |
modified
docs/fr/reference/ligne-de-commande.md +3 -3 | @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Référence : ligne de commande |
| 2 | 2 | |
| 3 | -> Chaque commande, option et code de sortie de `rzb`, pour razorbill 0.3.0. | |
| 3 | +> Chaque commande, option et code de sortie de `rzb`, pour razorbill 1.0.0. | |
| 4 | 4 | |
| 5 | 5 | ``` |
| 6 | 6 | rzb <commande> [options] |
| @@ -36,7 +36,7 @@ Les options l'emportent sur la section `server:` du fichier. Au démarrage, il a | ||
| 36 | 36 | |
| 37 | 37 | ``` |
| 38 | 38 | config: server.yaml (2 declared models) |
| 39 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | |
| 39 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | |
| 40 | 40 | ``` |
| 41 | 41 | |
| 42 | 42 | La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés. |
| @@ -83,7 +83,7 @@ Le cache est `$HF_HUB_CACHE`, sinon `$HF_HOME/hub`, sinon `~/.cache/huggingface/ | ||
| 83 | 83 | |
| 84 | 84 | ## rzb version |
| 85 | 85 | |
| 86 | -Affiche `rzb 0.3.0 (engines: fake, mlx)` (les moteurs de cette compilation, triés). `rzb --version` affiche `0.3.0`. | |
| 86 | +Affiche `rzb 1.0.0 (engines: fake, mlx)` (les moteurs de cette compilation, triés). `rzb --version` affiche `1.0.0`. | |
| 87 | 87 | |
| 88 | 88 | ## Codes de sortie |
| 89 | 89 | |
| @@ -1,6 +1,6 @@ | |||
| 1 | # Référence : ligne de commande | 1 | # Référence : ligne de commande |
| 2 | 2 | ||
| 3 | -> Chaque commande, option et code de sortie de `rzb`, pour razorbill 0.3.0. | 3 | +> Chaque commande, option et code de sortie de `rzb`, pour razorbill 1.0.0. |
| 4 | 4 | ||
| 5 | ``` | 5 | ``` |
| 6 | rzb <commande> [options] | 6 | rzb <commande> [options] |
| @@ -36,7 +36,7 @@ Les options l'emportent sur la section `server:` du fichier. Au démarrage, il a | |||
| 36 | 36 | ||
| 37 | ``` | 37 | ``` |
| 38 | config: server.yaml (2 declared models) | 38 | config: server.yaml (2 declared models) |
| 39 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop | 39 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop |
| 40 | ``` | 40 | ``` |
| 41 | 41 | ||
| 42 | La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés. | 42 | La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés. |
| @@ -83,7 +83,7 @@ Le cache est `$HF_HUB_CACHE`, sinon `$HF_HOME/hub`, sinon `~/.cache/huggingface/ | |||
| 83 | 83 | ||
| 84 | ## rzb version | 84 | ## rzb version |
| 85 | 85 | ||
| 86 | -Affiche `rzb 0.3.0 (engines: fake, mlx)` (les moteurs de cette compilation, triés). `rzb --version` affiche `0.3.0`. | 86 | +Affiche `rzb 1.0.0 (engines: fake, mlx)` (les moteurs de cette compilation, triés). `rzb --version` affiche `1.0.0`. |
| 87 | 87 | ||
| 88 | ## Codes de sortie | 88 | ## Codes de sortie |
| 89 | 89 | ||
modified
docs/fr/tutorials/premiers-pas.md +1 -1 | @@ -43,7 +43,7 @@ rzb serve | ||
| 43 | 43 | Vous devez voir : |
| 44 | 44 | |
| 45 | 45 | ``` |
| 46 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | |
| 46 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | |
| 47 | 47 | ``` |
| 48 | 48 | |
| 49 | 49 | Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite. |
| @@ -43,7 +43,7 @@ rzb serve | |||
| 43 | Vous devez voir : | 43 | Vous devez voir : |
| 44 | 44 | ||
| 45 | ``` | 45 | ``` |
| 46 | -rzb 0.3.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop | 46 | +rzb 1.0.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite. | 49 | Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite. |
added
local-ci-00-common.sh +103 -0 | new file mode 100644 | ||
| @@ -0,0 +1,103 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-00-common.sh — what the local-ci-*.sh steps share. Sourced, not run. | |
| 3 | +# | |
| 4 | +# The steps, in order (02 to 05 on the Mac): | |
| 5 | +# ./local-ci-01-check.sh swiftlint, swift-format, tests, the version | |
| 6 | +# ./local-ci-02-build.sh the archive, in release/<TAG>/; signs and notarizes rzb | |
| 7 | +# when RZB_SIGN_IDENTITY is set | |
| 8 | +# (docs/en/how-to/package-a-release.md) | |
| 9 | +# ./local-ci-03-create-draft.sh the tag and a draft prerelease on Rickub | |
| 10 | +# ./local-ci-04-upload.sh the archive and SHA256SUMS, through a temporary branch | |
| 11 | +# ./local-ci-05-publish.sh the draft becomes public; asks first | |
| 12 | +# ./local-ci-06-promote.sh optional: the prerelease becomes a release; asks first | |
| 13 | +# | |
| 14 | +# Reads TAG, ABOUT, OWNER, REPO, RZB_SIGN_IDENTITY and RZB_NOTARY_PROFILE from .release.env, | |
| 15 | +# and CI_TOKEN from .ci.cd.token.env (both git-ignored). The token never reaches argv: curl and | |
| 16 | +# git read it from files of mode 600 in a temporary folder. | |
| 17 | +set -euo pipefail | |
| 18 | +cd "$(dirname "${BASH_SOURCE[0]}")" | |
| 19 | + | |
| 20 | +# shellcheck disable=SC1090 | |
| 21 | +source "${LOCAL_CI_ENV_FILE:-./.release.env}" | |
| 22 | +: "${TAG:?TAG is not set in .release.env}" | |
| 23 | +OWNER="${OWNER:-bots-garden}" | |
| 24 | +REPO="${REPO:-razorbill}" | |
| 25 | + | |
| 26 | +# Used by the steps that source this file. | |
| 27 | +# shellcheck disable=SC2034 | |
| 28 | +{ | |
| 29 | + handle="${RICKUB_HANDLE:-k33g}" | |
| 30 | + web="https://rickub.com/${OWNER}/${REPO}" | |
| 31 | + api="https://rickub.com/api/v1/repos/${OWNER}/${REPO}" | |
| 32 | + git_url="https://${handle}@git.rickub.com/${OWNER}/${REPO}.git" | |
| 33 | + assets_dir="release/${TAG}" | |
| 34 | +} | |
| 35 | + | |
| 36 | +# The tag is "v1.0.0"; the version in the code and in the asset names is "1.0.0". | |
| 37 | +VERSION="${TAG#v}" | |
| 38 | +# shellcheck disable=SC2034 # used by the steps that source this file | |
| 39 | +ARCHIVE="razorbill-${VERSION}-macos-arm64.tar.gz" | |
| 40 | + | |
| 41 | +work="$(mktemp -d)" | |
| 42 | +cleanup_work() { rm -rf "${work}"; } | |
| 43 | +trap cleanup_work EXIT | |
| 44 | + | |
| 45 | +# check_tag fails when TAG is not vMAJOR.MINOR.PATCH[-prerelease] or does not match the version | |
| 46 | +# compiled into rzb (Sources/RazorbillCore/Razorbill.swift): the archive name, `rzb --version` | |
| 47 | +# and the tag must all say the same thing. | |
| 48 | +check_tag() { | |
| 49 | + if ! [[ "${TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then | |
| 50 | + echo "❌ TAG must look like v1.2.3 or v1.2.3-rc.1, got '${TAG}' (check .release.env)" | |
| 51 | + exit 1 | |
| 52 | + fi | |
| 53 | + local code_version | |
| 54 | + code_version="$(sed -n 's/.*static let version = "\([^"]*\)".*/\1/p' Sources/RazorbillCore/Razorbill.swift)" | |
| 55 | + if [ "${code_version}" != "${VERSION}" ]; then | |
| 56 | + echo "❌ TAG is ${TAG} but Sources/RazorbillCore/Razorbill.swift says ${code_version:-nothing}" | |
| 57 | + exit 1 | |
| 58 | + fi | |
| 59 | +} | |
| 60 | + | |
| 61 | +# checksum runs whichever of the two tools this machine has: sha256sum on Linux, shasum on macOS. | |
| 62 | +checksum() { | |
| 63 | + if command -v sha256sum >/dev/null 2>&1; then | |
| 64 | + sha256sum "$@" | |
| 65 | + else | |
| 66 | + shasum -a 256 "$@" | |
| 67 | + fi | |
| 68 | +} | |
| 69 | + | |
| 70 | +# load_token prepares the token for curl and git. | |
| 71 | +load_token() { | |
| 72 | + [ -f ./.ci.cd.token.env ] || { echo "❌ no .ci.cd.token.env (CI_TOKEN=…, git-ignored)"; exit 2; } | |
| 73 | + # shellcheck disable=SC1091 | |
| 74 | + source ./.ci.cd.token.env | |
| 75 | + [ -n "${CI_TOKEN:-}" ] || { echo "❌ CI_TOKEN is not set in .ci.cd.token.env"; exit 2; } | |
| 76 | + export CI_TOKEN | |
| 77 | + ( umask 077; printf 'header = "Authorization: Bearer %s"\n' "${CI_TOKEN}" > "${work}/curl.conf" ) | |
| 78 | + # shellcheck disable=SC2016 # $CI_TOKEN is expanded by the askpass script, not here | |
| 79 | + ( umask 077; printf '#!/bin/sh\nprintf "%%s" "$CI_TOKEN"\n' > "${work}/askpass.sh" ) | |
| 80 | + chmod 700 "${work}/askpass.sh" | |
| 81 | + export GIT_ASKPASS="${work}/askpass.sh" GIT_TERMINAL_PROMPT=0 | |
| 82 | +} | |
| 83 | + | |
| 84 | +# call METHOD PATH [curl args]: the body lands in ${work}/body, the status is printed. | |
| 85 | +call() { | |
| 86 | + local method="$1" path="$2" | |
| 87 | + shift 2 | |
| 88 | + curl -sS -m 60 -o "${work}/body" -w '%{http_code}' -K "${work}/curl.conf" -X "${method}" "$@" "${api}${path}" | |
| 89 | +} | |
| 90 | + | |
| 91 | +# release_field FIELD prints a field of the release of TAG, or nothing. | |
| 92 | +release_field() { | |
| 93 | + local status | |
| 94 | + status="$(call GET /releases)" | |
| 95 | + [ "${status}" = "200" ] || { echo "❌ HTTP ${status} listing the releases: $(cat "${work}/body")" >&2; exit 1; } | |
| 96 | + # Not `// empty`: jq's // also drops false, and "draft": false would read as nothing. | |
| 97 | + jq -r --arg tag "${TAG}" --arg field "$1" '[.[] | select(.tag == $tag)][0][$field] | if . == null then empty else tostring end' "${work}/body" | |
| 98 | +} | |
| 99 | + | |
| 100 | +# latest_location prints where /releases/latest redirects to. | |
| 101 | +latest_location() { | |
| 102 | + curl -sI -m 20 "${web}/releases/latest" | tr -d '\r' | awk 'tolower($1) == "location:" {print $2}' | |
| 103 | +} | |
| new file mode 100644 | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-00-common.sh — what the local-ci-*.sh steps share. Sourced, not run. | ||
| 3 | +# | ||
| 4 | +# The steps, in order (02 to 05 on the Mac): | ||
| 5 | +# ./local-ci-01-check.sh swiftlint, swift-format, tests, the version | ||
| 6 | +# ./local-ci-02-build.sh the archive, in release/<TAG>/; signs and notarizes rzb | ||
| 7 | +# when RZB_SIGN_IDENTITY is set | ||
| 8 | +# (docs/en/how-to/package-a-release.md) | ||
| 9 | +# ./local-ci-03-create-draft.sh the tag and a draft prerelease on Rickub | ||
| 10 | +# ./local-ci-04-upload.sh the archive and SHA256SUMS, through a temporary branch | ||
| 11 | +# ./local-ci-05-publish.sh the draft becomes public; asks first | ||
| 12 | +# ./local-ci-06-promote.sh optional: the prerelease becomes a release; asks first | ||
| 13 | +# | ||
| 14 | +# Reads TAG, ABOUT, OWNER, REPO, RZB_SIGN_IDENTITY and RZB_NOTARY_PROFILE from .release.env, | ||
| 15 | +# and CI_TOKEN from .ci.cd.token.env (both git-ignored). The token never reaches argv: curl and | ||
| 16 | +# git read it from files of mode 600 in a temporary folder. | ||
| 17 | +set -euo pipefail | ||
| 18 | +cd "$(dirname "${BASH_SOURCE[0]}")" | ||
| 19 | + | ||
| 20 | +# shellcheck disable=SC1090 | ||
| 21 | +source "${LOCAL_CI_ENV_FILE:-./.release.env}" | ||
| 22 | +: "${TAG:?TAG is not set in .release.env}" | ||
| 23 | +OWNER="${OWNER:-bots-garden}" | ||
| 24 | +REPO="${REPO:-razorbill}" | ||
| 25 | + | ||
| 26 | +# Used by the steps that source this file. | ||
| 27 | +# shellcheck disable=SC2034 | ||
| 28 | +{ | ||
| 29 | + handle="${RICKUB_HANDLE:-k33g}" | ||
| 30 | + web="https://rickub.com/${OWNER}/${REPO}" | ||
| 31 | + api="https://rickub.com/api/v1/repos/${OWNER}/${REPO}" | ||
| 32 | + git_url="https://${handle}@git.rickub.com/${OWNER}/${REPO}.git" | ||
| 33 | + assets_dir="release/${TAG}" | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +# The tag is "v1.0.0"; the version in the code and in the asset names is "1.0.0". | ||
| 37 | +VERSION="${TAG#v}" | ||
| 38 | +# shellcheck disable=SC2034 # used by the steps that source this file | ||
| 39 | +ARCHIVE="razorbill-${VERSION}-macos-arm64.tar.gz" | ||
| 40 | + | ||
| 41 | +work="$(mktemp -d)" | ||
| 42 | +cleanup_work() { rm -rf "${work}"; } | ||
| 43 | +trap cleanup_work EXIT | ||
| 44 | + | ||
| 45 | +# check_tag fails when TAG is not vMAJOR.MINOR.PATCH[-prerelease] or does not match the version | ||
| 46 | +# compiled into rzb (Sources/RazorbillCore/Razorbill.swift): the archive name, `rzb --version` | ||
| 47 | +# and the tag must all say the same thing. | ||
| 48 | +check_tag() { | ||
| 49 | + if ! [[ "${TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then | ||
| 50 | + echo "❌ TAG must look like v1.2.3 or v1.2.3-rc.1, got '${TAG}' (check .release.env)" | ||
| 51 | + exit 1 | ||
| 52 | + fi | ||
| 53 | + local code_version | ||
| 54 | + code_version="$(sed -n 's/.*static let version = "\([^"]*\)".*/\1/p' Sources/RazorbillCore/Razorbill.swift)" | ||
| 55 | + if [ "${code_version}" != "${VERSION}" ]; then | ||
| 56 | + echo "❌ TAG is ${TAG} but Sources/RazorbillCore/Razorbill.swift says ${code_version:-nothing}" | ||
| 57 | + exit 1 | ||
| 58 | + fi | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +# checksum runs whichever of the two tools this machine has: sha256sum on Linux, shasum on macOS. | ||
| 62 | +checksum() { | ||
| 63 | + if command -v sha256sum >/dev/null 2>&1; then | ||
| 64 | + sha256sum "$@" | ||
| 65 | + else | ||
| 66 | + shasum -a 256 "$@" | ||
| 67 | + fi | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +# load_token prepares the token for curl and git. | ||
| 71 | +load_token() { | ||
| 72 | + [ -f ./.ci.cd.token.env ] || { echo "❌ no .ci.cd.token.env (CI_TOKEN=…, git-ignored)"; exit 2; } | ||
| 73 | + # shellcheck disable=SC1091 | ||
| 74 | + source ./.ci.cd.token.env | ||
| 75 | + [ -n "${CI_TOKEN:-}" ] || { echo "❌ CI_TOKEN is not set in .ci.cd.token.env"; exit 2; } | ||
| 76 | + export CI_TOKEN | ||
| 77 | + ( umask 077; printf 'header = "Authorization: Bearer %s"\n' "${CI_TOKEN}" > "${work}/curl.conf" ) | ||
| 78 | + # shellcheck disable=SC2016 # $CI_TOKEN is expanded by the askpass script, not here | ||
| 79 | + ( umask 077; printf '#!/bin/sh\nprintf "%%s" "$CI_TOKEN"\n' > "${work}/askpass.sh" ) | ||
| 80 | + chmod 700 "${work}/askpass.sh" | ||
| 81 | + export GIT_ASKPASS="${work}/askpass.sh" GIT_TERMINAL_PROMPT=0 | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +# call METHOD PATH [curl args]: the body lands in ${work}/body, the status is printed. | ||
| 85 | +call() { | ||
| 86 | + local method="$1" path="$2" | ||
| 87 | + shift 2 | ||
| 88 | + curl -sS -m 60 -o "${work}/body" -w '%{http_code}' -K "${work}/curl.conf" -X "${method}" "$@" "${api}${path}" | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +# release_field FIELD prints a field of the release of TAG, or nothing. | ||
| 92 | +release_field() { | ||
| 93 | + local status | ||
| 94 | + status="$(call GET /releases)" | ||
| 95 | + [ "${status}" = "200" ] || { echo "❌ HTTP ${status} listing the releases: $(cat "${work}/body")" >&2; exit 1; } | ||
| 96 | + # Not `// empty`: jq's // also drops false, and "draft": false would read as nothing. | ||
| 97 | + jq -r --arg tag "${TAG}" --arg field "$1" '[.[] | select(.tag == $tag)][0][$field] | if . == null then empty else tostring end' "${work}/body" | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +# latest_location prints where /releases/latest redirects to. | ||
| 101 | +latest_location() { | ||
| 102 | + curl -sI -m 20 "${web}/releases/latest" | tr -d '\r' | awk 'tolower($1) == "location:" {print $2}' | ||
| 103 | +} | ||
added
local-ci-01-check.sh +35 -0 | new file mode 100755 | ||
| @@ -0,0 +1,35 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-01-check.sh — the version, swiftlint, swift-format and the tests. | |
| 3 | +# | |
| 4 | +# On the Mac the tests are the whole suite, MLX included (xcodebuild test); on Linux, everything | |
| 5 | +# but MLX (scripts/test.sh decides). A release is checked on the Mac. | |
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 7 | + | |
| 8 | +echo "==> version" | |
| 9 | +check_tag | |
| 10 | +echo " ${TAG} = Razorbill.version" | |
| 11 | + | |
| 12 | +echo "==> swiftlint" | |
| 13 | +command -v swiftlint >/dev/null 2>&1 || { echo "❌ swiftlint not found (brew install swiftlint)"; exit 2; } | |
| 14 | +lint="$(swiftlint lint --quiet Sources Tests)" | |
| 15 | +if [ -n "${lint}" ]; then | |
| 16 | + echo "${lint}" | |
| 17 | + echo "❌ swiftlint found issues" | |
| 18 | + exit 1 | |
| 19 | +fi | |
| 20 | + | |
| 21 | +echo "==> swift format lint" | |
| 22 | +format="$(swift format lint -r Sources Tests 2>&1)" | |
| 23 | +if [ -n "${format}" ]; then | |
| 24 | + echo "${format}" | |
| 25 | + echo "❌ swift format found issues" | |
| 26 | + exit 1 | |
| 27 | +fi | |
| 28 | + | |
| 29 | +echo "==> tests" | |
| 30 | +scripts/test.sh | |
| 31 | + | |
| 32 | +if [ "$(uname -s)" != "Darwin" ]; then | |
| 33 | + echo "⚠️ not a Mac: the MLX tests did not run" | |
| 34 | +fi | |
| 35 | +echo "✅ checks passed" | |
| new file mode 100755 | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-01-check.sh — the version, swiftlint, swift-format and the tests. | ||
| 3 | +# | ||
| 4 | +# On the Mac the tests are the whole suite, MLX included (xcodebuild test); on Linux, everything | ||
| 5 | +# but MLX (scripts/test.sh decides). A release is checked on the Mac. | ||
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 7 | + | ||
| 8 | +echo "==> version" | ||
| 9 | +check_tag | ||
| 10 | +echo " ${TAG} = Razorbill.version" | ||
| 11 | + | ||
| 12 | +echo "==> swiftlint" | ||
| 13 | +command -v swiftlint >/dev/null 2>&1 || { echo "❌ swiftlint not found (brew install swiftlint)"; exit 2; } | ||
| 14 | +lint="$(swiftlint lint --quiet Sources Tests)" | ||
| 15 | +if [ -n "${lint}" ]; then | ||
| 16 | + echo "${lint}" | ||
| 17 | + echo "❌ swiftlint found issues" | ||
| 18 | + exit 1 | ||
| 19 | +fi | ||
| 20 | + | ||
| 21 | +echo "==> swift format lint" | ||
| 22 | +format="$(swift format lint -r Sources Tests 2>&1)" | ||
| 23 | +if [ -n "${format}" ]; then | ||
| 24 | + echo "${format}" | ||
| 25 | + echo "❌ swift format found issues" | ||
| 26 | + exit 1 | ||
| 27 | +fi | ||
| 28 | + | ||
| 29 | +echo "==> tests" | ||
| 30 | +scripts/test.sh | ||
| 31 | + | ||
| 32 | +if [ "$(uname -s)" != "Darwin" ]; then | ||
| 33 | + echo "⚠️ not a Mac: the MLX tests did not run" | ||
| 34 | +fi | ||
| 35 | +echo "✅ checks passed" | ||
added
local-ci-02-build.sh +228 -0 | new file mode 100755 | ||
| @@ -0,0 +1,228 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-02-build.sh — the release archive, in release/<TAG>/. Mac with Apple Silicon only. | |
| 3 | +# | |
| 4 | +# What ends up in release/<TAG>/: | |
| 5 | +# razorbill-<version>-macos-arm64.tar.gz rzb + its resource bundles + INSTALL.txt + LICENSE | |
| 6 | +# SHA256SUMS checksum of the archive | |
| 7 | +# README.md what the release holds, how to install it | |
| 8 | +# build-info.txt the Xcode that built it, for local-ci-03 (not published) | |
| 9 | +# macos-signature.txt only when rzb was signed (not published) | |
| 10 | +# | |
| 11 | +# rzb is signed with a Developer ID and notarized when .release.env (or the environment) sets | |
| 12 | +# RZB_SIGN_IDENTITY and RZB_NOTARY_PROFILE: see docs/en/how-to/package-a-release.md. Without | |
| 13 | +# them, rzb keeps the linker's ad hoc signature and macOS quarantines a browser download. | |
| 14 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 15 | + | |
| 16 | +ABOUT="${ABOUT:-razorbill ${TAG}}" | |
| 17 | +check_tag | |
| 18 | + | |
| 19 | +if [ "$(uname -s)" != "Darwin" ] || [ "$(uname -m)" != "arm64" ]; then | |
| 20 | + echo "❌ the release is built on a Mac with Apple Silicon (MLX's Metal shaders)" | |
| 21 | + exit 1 | |
| 22 | +fi | |
| 23 | + | |
| 24 | +RZB_SIGN_IDENTITY="${RZB_SIGN_IDENTITY:-}" | |
| 25 | +RZB_NOTARY_PROFILE="${RZB_NOTARY_PROFILE:-}" | |
| 26 | +# The identifier macOS knows rzb by. Without it, codesign takes the file name. | |
| 27 | +RZB_SIGN_IDENTIFIER="com.bots-garden.rzb" | |
| 28 | +NAME="razorbill-${VERSION}-macos-arm64" | |
| 29 | +PRODUCTS=".build/release/Build/Products/Release" | |
| 30 | + | |
| 31 | +# checkSigningSetup fails now, before minutes of building, when the signature was asked for but | |
| 32 | +# cannot be done on this machine. | |
| 33 | +checkSigningSetup() { | |
| 34 | + if [ -z "${RZB_NOTARY_PROFILE}" ]; then | |
| 35 | + echo "❌ RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not: a signed binary that is not notarized is still blocked by Gatekeeper" | |
| 36 | + exit 1 | |
| 37 | + fi | |
| 38 | + # The whole output first: with pipefail, `security … | grep -q` fails when grep stops early | |
| 39 | + # and security dies of SIGPIPE. | |
| 40 | + local identities | |
| 41 | + identities="$(security find-identity -v -p codesigning)" | |
| 42 | + if ! grep -qF -- "\"${RZB_SIGN_IDENTITY}\"" <<<"${identities}"; then | |
| 43 | + echo "❌ no valid identity \"${RZB_SIGN_IDENTITY}\" in the keychain" | |
| 44 | + echo " 💡 security find-identity -v -p codesigning" | |
| 45 | + exit 1 | |
| 46 | + fi | |
| 47 | + if ! xcrun notarytool history --keychain-profile "${RZB_NOTARY_PROFILE}" >/dev/null 2>&1; then | |
| 48 | + echo "❌ the notarytool profile \"${RZB_NOTARY_PROFILE}\" does not work" | |
| 49 | + echo " 💡 xcrun notarytool history --keychain-profile \"${RZB_NOTARY_PROFILE}\"" | |
| 50 | + exit 1 | |
| 51 | + fi | |
| 52 | +} | |
| 53 | + | |
| 54 | +# signFolder signs the bundles, then rzb, in DIR, and has Apple notarize the whole folder. The | |
| 55 | +# work happens in the temporary folder: the repository may sit in a synced folder (kDrive, | |
| 56 | +# iCloud…) whose client writes metadata into files while codesign rewrites them. | |
| 57 | +# | |
| 58 | +# The bundles hold resources only (default.metallib, plists, JSON): they are signed so that | |
| 59 | +# their content is sealed, without the hardened runtime, which only applies to executables. | |
| 60 | +# rzb gets the hardened runtime (--options runtime) and a timestamp, which the notary service | |
| 61 | +# requires. A bare executable cannot be stapled: Gatekeeper fetches the ticket online the first | |
| 62 | +# time it runs from a quarantined download. | |
| 63 | +signFolder() { | |
| 64 | + local dir=$1 | |
| 65 | + xattr -cr "${dir}" 2>/dev/null || true | |
| 66 | + | |
| 67 | + local bundle | |
| 68 | + for bundle in "${dir}"/*.bundle; do | |
| 69 | + codesign --force --timestamp --sign "${RZB_SIGN_IDENTITY}" "${bundle}" | |
| 70 | + done | |
| 71 | + codesign --force --options runtime --timestamp \ | |
| 72 | + --identifier "${RZB_SIGN_IDENTIFIER}" \ | |
| 73 | + --sign "${RZB_SIGN_IDENTITY}" "${dir}/rzb" | |
| 74 | + | |
| 75 | + for bundle in "${dir}/rzb" "${dir}"/*.bundle; do | |
| 76 | + codesign --verify --strict --verbose=2 "${bundle}" | |
| 77 | + done | |
| 78 | + local details expected | |
| 79 | + details="$(codesign -dv --verbose=4 "${dir}/rzb" 2>&1)" | |
| 80 | + for expected in "Authority=Developer ID Application" "flags=.*runtime" "Timestamp="; do | |
| 81 | + if ! grep -q -- "${expected}" <<<"${details}"; then | |
| 82 | + echo " ❌ rzb: the signature has no ${expected}" | |
| 83 | + printf '%s\n' "${details}" | |
| 84 | + exit 1 | |
| 85 | + fi | |
| 86 | + done | |
| 87 | + echo " ✅ rzb signed (Developer ID, hardened runtime, timestamp) and $(find "${dir}" -maxdepth 1 -name '*.bundle' | wc -l | tr -d ' ') bundles sealed" | |
| 88 | + | |
| 89 | + # The notary service takes a zip, a dmg or a pkg, not a tar.gz. | |
| 90 | + ditto -c -k --keepParent "${dir}" "${work}/notarize.zip" | |
| 91 | + echo " ⏳ waiting for Apple's notary service (a few minutes)..." | |
| 92 | + if ! xcrun notarytool submit "${work}/notarize.zip" \ | |
| 93 | + --keychain-profile "${RZB_NOTARY_PROFILE}" --wait --output-format json >"${work}/notary.json"; then | |
| 94 | + echo " ❌ notarytool submit failed:" | |
| 95 | + cat "${work}/notary.json" | |
| 96 | + exit 1 | |
| 97 | + fi | |
| 98 | + local status submission | |
| 99 | + status="$(jq -r '.status // empty' "${work}/notary.json")" | |
| 100 | + submission="$(jq -r '.id // empty' "${work}/notary.json")" | |
| 101 | + if [ "${status}" != "Accepted" ]; then | |
| 102 | + echo " ❌ notarization ${submission}: ${status:-no status}" | |
| 103 | + echo " 💡 xcrun notarytool log ${submission} --keychain-profile \"${RZB_NOTARY_PROFILE}\"" | |
| 104 | + exit 1 | |
| 105 | + fi | |
| 106 | + echo " ✅ notarized (submission ${submission})" | |
| 107 | + | |
| 108 | + { | |
| 109 | + printf 'archive: %s\n' "${ARCHIVE}" | |
| 110 | + printf 'identifier: %s\n' "${RZB_SIGN_IDENTIFIER}" | |
| 111 | + grep '^Authority=Developer ID Application' <<<"${details}" | |
| 112 | + grep '^TeamIdentifier=' <<<"${details}" || true | |
| 113 | + printf 'notarization: %s %s\n' "${submission}" "${status}" | |
| 114 | + } >"${work}/macos-signature.txt" | |
| 115 | +} | |
| 116 | + | |
| 117 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | |
| 118 | + checkSigningSetup | |
| 119 | +fi | |
| 120 | +# scripts/release.sh refuses a dirty tree too, but only after the build: say it now. | |
| 121 | +if [ -n "$(git status --porcelain)" ]; then | |
| 122 | + echo "❌ the working tree is not clean: commit first" | |
| 123 | + git status --short | |
| 124 | + exit 1 | |
| 125 | +fi | |
| 126 | + | |
| 127 | +echo "🚀 Building razorbill ${TAG} — ${ABOUT}" | |
| 128 | +xcode="$(xcodebuild -version | head -1)" | |
| 129 | +echo "🔨 ${xcode}" | |
| 130 | +rm -rf "${assets_dir}" | |
| 131 | +mkdir -p "${assets_dir}" | |
| 132 | +printf '%s\n' "${xcode}" >"${assets_dir}/build-info.txt" | |
| 133 | + | |
| 134 | +# Own derived-data folder, never a Debug or half-updated development build; no coverage | |
| 135 | +# instrumentation (rzb would write default.profraw at every exit). | |
| 136 | +xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | |
| 137 | + -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation -quiet \ | |
| 138 | + CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO | |
| 139 | +echo " ✅ Release build" | |
| 140 | + | |
| 141 | +# rzb and every resource bundle, in a folder of their own: what gets signed is what ships. | |
| 142 | +stage="${work}/${NAME}" | |
| 143 | +mkdir -p "${stage}" | |
| 144 | +cp "${PRODUCTS}/rzb" "${stage}/" | |
| 145 | +for bundle in "${PRODUCTS}"/*.bundle; do | |
| 146 | + cp -R "${bundle}" "${stage}/" | |
| 147 | +done | |
| 148 | + | |
| 149 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | |
| 150 | + echo "" | |
| 151 | + echo "🔏 Signing and notarizing rzb and its bundles..." | |
| 152 | + signFolder "${stage}" | |
| 153 | +else | |
| 154 | + echo "" | |
| 155 | + echo "⚠️ rzb is not signed: RZB_SIGN_IDENTITY is not set (docs/en/how-to/package-a-release.md)" | |
| 156 | +fi | |
| 157 | + | |
| 158 | +# Packaging and its checks (bundles present, rzb --version from the unpacked archive) are | |
| 159 | +# scripts/release.sh's: one way to make the archive, signed or not. | |
| 160 | +echo "" | |
| 161 | +scripts/release.sh --products "${stage}" --out "${assets_dir}" | |
| 162 | +rm -f "${assets_dir}/${ARCHIVE}.sha256" | |
| 163 | + | |
| 164 | +# The signature must survive the trip through tar: check it on an unpacked copy. | |
| 165 | +unpacked="${work}/unpacked" | |
| 166 | +mkdir -p "${unpacked}" | |
| 167 | +tar -C "${unpacked}" -xzf "${assets_dir}/${ARCHIVE}" | |
| 168 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | |
| 169 | + codesign --verify --strict "${unpacked}/${NAME}/rzb" | |
| 170 | + for bundle in "${unpacked}/${NAME}"/*.bundle; do | |
| 171 | + codesign --verify --strict "${bundle}" | |
| 172 | + done | |
| 173 | + mv "${work}/macos-signature.txt" "${assets_dir}/" | |
| 174 | + echo " ✅ signatures intact in the unpacked archive" | |
| 175 | +fi | |
| 176 | +if ! "${unpacked}/${NAME}/rzb" --version | grep -qx -- "${VERSION}"; then | |
| 177 | + echo " ❌ the archived rzb does not report ${VERSION}" | |
| 178 | + exit 1 | |
| 179 | +fi | |
| 180 | +echo " ✅ the archived rzb starts and reports ${VERSION}" | |
| 181 | + | |
| 182 | +# Names only (no directory): what `shasum -a 256 -c` expects next to the downloaded files. | |
| 183 | +(cd "${assets_dir}" && checksum "${ARCHIVE}" >SHA256SUMS) | |
| 184 | +echo " ✅ SHA256SUMS" | |
| 185 | + | |
| 186 | +macosNote() { | |
| 187 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | |
| 188 | + printf 'rzb is signed with a Developer ID and notarized by Apple: no quarantine step.\n' | |
| 189 | + else | |
| 190 | + printf 'rzb is not signed: clear the quarantine of a browser download with\n\n xattr -dr com.apple.quarantine %s\n' "${NAME}" | |
| 191 | + fi | |
| 192 | +} | |
| 193 | + | |
| 194 | +cat >"${assets_dir}/README.md" <<EOM | |
| 195 | +# razorbill ${TAG} | |
| 196 | + | |
| 197 | +${ABOUT} | |
| 198 | + | |
| 199 | +MLX model server with an OpenAI-compatible API, for macOS 14 or later on Apple Silicon. | |
| 200 | + | |
| 201 | +| Platform | Download | | |
| 202 | +|---|---| | |
| 203 | +| macOS arm64 | \`${ARCHIVE}\` | | |
| 204 | + | |
| 205 | +## Installing it | |
| 206 | + | |
| 207 | + tar -xzf ${ARCHIVE} | |
| 208 | + sudo mkdir -p /usr/local/lib /usr/local/bin | |
| 209 | + sudo rm -rf /usr/local/lib/razorbill | |
| 210 | + sudo mv ${NAME} /usr/local/lib/razorbill | |
| 211 | + printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "\$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | |
| 212 | + sudo chmod 755 /usr/local/bin/rzb | |
| 213 | + rzb version | |
| 214 | + | |
| 215 | +rzb loads its .bundle folders from its own folder: keep them together, and start it through | |
| 216 | +the launcher rather than copying rzb alone. Details: ${web}/blob/main/INSTALL.MACOS.md | |
| 217 | + | |
| 218 | +$(macosNote) | |
| 219 | + | |
| 220 | +## Verifying the download | |
| 221 | + | |
| 222 | + shasum -a 256 -c SHA256SUMS | |
| 223 | +EOM | |
| 224 | +echo " ✅ README.md" | |
| 225 | + | |
| 226 | +echo "" | |
| 227 | +ls -lh "${assets_dir}" | |
| 228 | +echo "✅ ${assets_dir}/ is ready" | |
| new file mode 100755 | |||
| @@ -0,0 +1,228 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-02-build.sh — the release archive, in release/<TAG>/. Mac with Apple Silicon only. | ||
| 3 | +# | ||
| 4 | +# What ends up in release/<TAG>/: | ||
| 5 | +# razorbill-<version>-macos-arm64.tar.gz rzb + its resource bundles + INSTALL.txt + LICENSE | ||
| 6 | +# SHA256SUMS checksum of the archive | ||
| 7 | +# README.md what the release holds, how to install it | ||
| 8 | +# build-info.txt the Xcode that built it, for local-ci-03 (not published) | ||
| 9 | +# macos-signature.txt only when rzb was signed (not published) | ||
| 10 | +# | ||
| 11 | +# rzb is signed with a Developer ID and notarized when .release.env (or the environment) sets | ||
| 12 | +# RZB_SIGN_IDENTITY and RZB_NOTARY_PROFILE: see docs/en/how-to/package-a-release.md. Without | ||
| 13 | +# them, rzb keeps the linker's ad hoc signature and macOS quarantines a browser download. | ||
| 14 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 15 | + | ||
| 16 | +ABOUT="${ABOUT:-razorbill ${TAG}}" | ||
| 17 | +check_tag | ||
| 18 | + | ||
| 19 | +if [ "$(uname -s)" != "Darwin" ] || [ "$(uname -m)" != "arm64" ]; then | ||
| 20 | + echo "❌ the release is built on a Mac with Apple Silicon (MLX's Metal shaders)" | ||
| 21 | + exit 1 | ||
| 22 | +fi | ||
| 23 | + | ||
| 24 | +RZB_SIGN_IDENTITY="${RZB_SIGN_IDENTITY:-}" | ||
| 25 | +RZB_NOTARY_PROFILE="${RZB_NOTARY_PROFILE:-}" | ||
| 26 | +# The identifier macOS knows rzb by. Without it, codesign takes the file name. | ||
| 27 | +RZB_SIGN_IDENTIFIER="com.bots-garden.rzb" | ||
| 28 | +NAME="razorbill-${VERSION}-macos-arm64" | ||
| 29 | +PRODUCTS=".build/release/Build/Products/Release" | ||
| 30 | + | ||
| 31 | +# checkSigningSetup fails now, before minutes of building, when the signature was asked for but | ||
| 32 | +# cannot be done on this machine. | ||
| 33 | +checkSigningSetup() { | ||
| 34 | + if [ -z "${RZB_NOTARY_PROFILE}" ]; then | ||
| 35 | + echo "❌ RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not: a signed binary that is not notarized is still blocked by Gatekeeper" | ||
| 36 | + exit 1 | ||
| 37 | + fi | ||
| 38 | + # The whole output first: with pipefail, `security … | grep -q` fails when grep stops early | ||
| 39 | + # and security dies of SIGPIPE. | ||
| 40 | + local identities | ||
| 41 | + identities="$(security find-identity -v -p codesigning)" | ||
| 42 | + if ! grep -qF -- "\"${RZB_SIGN_IDENTITY}\"" <<<"${identities}"; then | ||
| 43 | + echo "❌ no valid identity \"${RZB_SIGN_IDENTITY}\" in the keychain" | ||
| 44 | + echo " 💡 security find-identity -v -p codesigning" | ||
| 45 | + exit 1 | ||
| 46 | + fi | ||
| 47 | + if ! xcrun notarytool history --keychain-profile "${RZB_NOTARY_PROFILE}" >/dev/null 2>&1; then | ||
| 48 | + echo "❌ the notarytool profile \"${RZB_NOTARY_PROFILE}\" does not work" | ||
| 49 | + echo " 💡 xcrun notarytool history --keychain-profile \"${RZB_NOTARY_PROFILE}\"" | ||
| 50 | + exit 1 | ||
| 51 | + fi | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | +# signFolder signs the bundles, then rzb, in DIR, and has Apple notarize the whole folder. The | ||
| 55 | +# work happens in the temporary folder: the repository may sit in a synced folder (kDrive, | ||
| 56 | +# iCloud…) whose client writes metadata into files while codesign rewrites them. | ||
| 57 | +# | ||
| 58 | +# The bundles hold resources only (default.metallib, plists, JSON): they are signed so that | ||
| 59 | +# their content is sealed, without the hardened runtime, which only applies to executables. | ||
| 60 | +# rzb gets the hardened runtime (--options runtime) and a timestamp, which the notary service | ||
| 61 | +# requires. A bare executable cannot be stapled: Gatekeeper fetches the ticket online the first | ||
| 62 | +# time it runs from a quarantined download. | ||
| 63 | +signFolder() { | ||
| 64 | + local dir=$1 | ||
| 65 | + xattr -cr "${dir}" 2>/dev/null || true | ||
| 66 | + | ||
| 67 | + local bundle | ||
| 68 | + for bundle in "${dir}"/*.bundle; do | ||
| 69 | + codesign --force --timestamp --sign "${RZB_SIGN_IDENTITY}" "${bundle}" | ||
| 70 | + done | ||
| 71 | + codesign --force --options runtime --timestamp \ | ||
| 72 | + --identifier "${RZB_SIGN_IDENTIFIER}" \ | ||
| 73 | + --sign "${RZB_SIGN_IDENTITY}" "${dir}/rzb" | ||
| 74 | + | ||
| 75 | + for bundle in "${dir}/rzb" "${dir}"/*.bundle; do | ||
| 76 | + codesign --verify --strict --verbose=2 "${bundle}" | ||
| 77 | + done | ||
| 78 | + local details expected | ||
| 79 | + details="$(codesign -dv --verbose=4 "${dir}/rzb" 2>&1)" | ||
| 80 | + for expected in "Authority=Developer ID Application" "flags=.*runtime" "Timestamp="; do | ||
| 81 | + if ! grep -q -- "${expected}" <<<"${details}"; then | ||
| 82 | + echo " ❌ rzb: the signature has no ${expected}" | ||
| 83 | + printf '%s\n' "${details}" | ||
| 84 | + exit 1 | ||
| 85 | + fi | ||
| 86 | + done | ||
| 87 | + echo " ✅ rzb signed (Developer ID, hardened runtime, timestamp) and $(find "${dir}" -maxdepth 1 -name '*.bundle' | wc -l | tr -d ' ') bundles sealed" | ||
| 88 | + | ||
| 89 | + # The notary service takes a zip, a dmg or a pkg, not a tar.gz. | ||
| 90 | + ditto -c -k --keepParent "${dir}" "${work}/notarize.zip" | ||
| 91 | + echo " ⏳ waiting for Apple's notary service (a few minutes)..." | ||
| 92 | + if ! xcrun notarytool submit "${work}/notarize.zip" \ | ||
| 93 | + --keychain-profile "${RZB_NOTARY_PROFILE}" --wait --output-format json >"${work}/notary.json"; then | ||
| 94 | + echo " ❌ notarytool submit failed:" | ||
| 95 | + cat "${work}/notary.json" | ||
| 96 | + exit 1 | ||
| 97 | + fi | ||
| 98 | + local status submission | ||
| 99 | + status="$(jq -r '.status // empty' "${work}/notary.json")" | ||
| 100 | + submission="$(jq -r '.id // empty' "${work}/notary.json")" | ||
| 101 | + if [ "${status}" != "Accepted" ]; then | ||
| 102 | + echo " ❌ notarization ${submission}: ${status:-no status}" | ||
| 103 | + echo " 💡 xcrun notarytool log ${submission} --keychain-profile \"${RZB_NOTARY_PROFILE}\"" | ||
| 104 | + exit 1 | ||
| 105 | + fi | ||
| 106 | + echo " ✅ notarized (submission ${submission})" | ||
| 107 | + | ||
| 108 | + { | ||
| 109 | + printf 'archive: %s\n' "${ARCHIVE}" | ||
| 110 | + printf 'identifier: %s\n' "${RZB_SIGN_IDENTIFIER}" | ||
| 111 | + grep '^Authority=Developer ID Application' <<<"${details}" | ||
| 112 | + grep '^TeamIdentifier=' <<<"${details}" || true | ||
| 113 | + printf 'notarization: %s %s\n' "${submission}" "${status}" | ||
| 114 | + } >"${work}/macos-signature.txt" | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | ||
| 118 | + checkSigningSetup | ||
| 119 | +fi | ||
| 120 | +# scripts/release.sh refuses a dirty tree too, but only after the build: say it now. | ||
| 121 | +if [ -n "$(git status --porcelain)" ]; then | ||
| 122 | + echo "❌ the working tree is not clean: commit first" | ||
| 123 | + git status --short | ||
| 124 | + exit 1 | ||
| 125 | +fi | ||
| 126 | + | ||
| 127 | +echo "🚀 Building razorbill ${TAG} — ${ABOUT}" | ||
| 128 | +xcode="$(xcodebuild -version | head -1)" | ||
| 129 | +echo "🔨 ${xcode}" | ||
| 130 | +rm -rf "${assets_dir}" | ||
| 131 | +mkdir -p "${assets_dir}" | ||
| 132 | +printf '%s\n' "${xcode}" >"${assets_dir}/build-info.txt" | ||
| 133 | + | ||
| 134 | +# Own derived-data folder, never a Debug or half-updated development build; no coverage | ||
| 135 | +# instrumentation (rzb would write default.profraw at every exit). | ||
| 136 | +xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | ||
| 137 | + -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation -quiet \ | ||
| 138 | + CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO | ||
| 139 | +echo " ✅ Release build" | ||
| 140 | + | ||
| 141 | +# rzb and every resource bundle, in a folder of their own: what gets signed is what ships. | ||
| 142 | +stage="${work}/${NAME}" | ||
| 143 | +mkdir -p "${stage}" | ||
| 144 | +cp "${PRODUCTS}/rzb" "${stage}/" | ||
| 145 | +for bundle in "${PRODUCTS}"/*.bundle; do | ||
| 146 | + cp -R "${bundle}" "${stage}/" | ||
| 147 | +done | ||
| 148 | + | ||
| 149 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | ||
| 150 | + echo "" | ||
| 151 | + echo "🔏 Signing and notarizing rzb and its bundles..." | ||
| 152 | + signFolder "${stage}" | ||
| 153 | +else | ||
| 154 | + echo "" | ||
| 155 | + echo "⚠️ rzb is not signed: RZB_SIGN_IDENTITY is not set (docs/en/how-to/package-a-release.md)" | ||
| 156 | +fi | ||
| 157 | + | ||
| 158 | +# Packaging and its checks (bundles present, rzb --version from the unpacked archive) are | ||
| 159 | +# scripts/release.sh's: one way to make the archive, signed or not. | ||
| 160 | +echo "" | ||
| 161 | +scripts/release.sh --products "${stage}" --out "${assets_dir}" | ||
| 162 | +rm -f "${assets_dir}/${ARCHIVE}.sha256" | ||
| 163 | + | ||
| 164 | +# The signature must survive the trip through tar: check it on an unpacked copy. | ||
| 165 | +unpacked="${work}/unpacked" | ||
| 166 | +mkdir -p "${unpacked}" | ||
| 167 | +tar -C "${unpacked}" -xzf "${assets_dir}/${ARCHIVE}" | ||
| 168 | +if [ -n "${RZB_SIGN_IDENTITY}" ]; then | ||
| 169 | + codesign --verify --strict "${unpacked}/${NAME}/rzb" | ||
| 170 | + for bundle in "${unpacked}/${NAME}"/*.bundle; do | ||
| 171 | + codesign --verify --strict "${bundle}" | ||
| 172 | + done | ||
| 173 | + mv "${work}/macos-signature.txt" "${assets_dir}/" | ||
| 174 | + echo " ✅ signatures intact in the unpacked archive" | ||
| 175 | +fi | ||
| 176 | +if ! "${unpacked}/${NAME}/rzb" --version | grep -qx -- "${VERSION}"; then | ||
| 177 | + echo " ❌ the archived rzb does not report ${VERSION}" | ||
| 178 | + exit 1 | ||
| 179 | +fi | ||
| 180 | +echo " ✅ the archived rzb starts and reports ${VERSION}" | ||
| 181 | + | ||
| 182 | +# Names only (no directory): what `shasum -a 256 -c` expects next to the downloaded files. | ||
| 183 | +(cd "${assets_dir}" && checksum "${ARCHIVE}" >SHA256SUMS) | ||
| 184 | +echo " ✅ SHA256SUMS" | ||
| 185 | + | ||
| 186 | +macosNote() { | ||
| 187 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | ||
| 188 | + printf 'rzb is signed with a Developer ID and notarized by Apple: no quarantine step.\n' | ||
| 189 | + else | ||
| 190 | + printf 'rzb is not signed: clear the quarantine of a browser download with\n\n xattr -dr com.apple.quarantine %s\n' "${NAME}" | ||
| 191 | + fi | ||
| 192 | +} | ||
| 193 | + | ||
| 194 | +cat >"${assets_dir}/README.md" <<EOM | ||
| 195 | +# razorbill ${TAG} | ||
| 196 | + | ||
| 197 | +${ABOUT} | ||
| 198 | + | ||
| 199 | +MLX model server with an OpenAI-compatible API, for macOS 14 or later on Apple Silicon. | ||
| 200 | + | ||
| 201 | +| Platform | Download | | ||
| 202 | +|---|---| | ||
| 203 | +| macOS arm64 | \`${ARCHIVE}\` | | ||
| 204 | + | ||
| 205 | +## Installing it | ||
| 206 | + | ||
| 207 | + tar -xzf ${ARCHIVE} | ||
| 208 | + sudo mkdir -p /usr/local/lib /usr/local/bin | ||
| 209 | + sudo rm -rf /usr/local/lib/razorbill | ||
| 210 | + sudo mv ${NAME} /usr/local/lib/razorbill | ||
| 211 | + printf '#!/bin/sh\n# razorbill launcher (scripts/install.sh)\nexec "/usr/local/lib/razorbill/rzb" "\$@"\n' | sudo tee /usr/local/bin/rzb >/dev/null | ||
| 212 | + sudo chmod 755 /usr/local/bin/rzb | ||
| 213 | + rzb version | ||
| 214 | + | ||
| 215 | +rzb loads its .bundle folders from its own folder: keep them together, and start it through | ||
| 216 | +the launcher rather than copying rzb alone. Details: ${web}/blob/main/INSTALL.MACOS.md | ||
| 217 | + | ||
| 218 | +$(macosNote) | ||
| 219 | + | ||
| 220 | +## Verifying the download | ||
| 221 | + | ||
| 222 | + shasum -a 256 -c SHA256SUMS | ||
| 223 | +EOM | ||
| 224 | +echo " ✅ README.md" | ||
| 225 | + | ||
| 226 | +echo "" | ||
| 227 | +ls -lh "${assets_dir}" | ||
| 228 | +echo "✅ ${assets_dir}/ is ready" | ||
added
local-ci-03-create-draft.sh +71 -0 | new file mode 100755 | ||
| @@ -0,0 +1,71 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-03-create-draft.sh — the tag and a draft prerelease on Rickub. | |
| 3 | +# | |
| 4 | +# Refuses when the archive would not be what the tag names: the working tree must be clean, HEAD | |
| 5 | +# must be the remote's main, and TAG must match the version compiled into rzb. | |
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 7 | +load_token | |
| 8 | +check_tag | |
| 9 | + | |
| 10 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 11 | + | |
| 12 | +head_sha="$(git rev-parse HEAD)" | |
| 13 | +if [ -z "${LOCAL_CI_SKIP_GIT_CHECK:-}" ]; then | |
| 14 | + if [ -n "$(git status --porcelain)" ]; then | |
| 15 | + echo "❌ the working tree is not clean: commit first" | |
| 16 | + git status --short | |
| 17 | + exit 1 | |
| 18 | + fi | |
| 19 | + remote_main="$(git ls-remote "${git_url}" refs/heads/main | cut -f1)" | |
| 20 | + if [ "${head_sha}" != "${remote_main}" ]; then | |
| 21 | + echo "❌ HEAD (${head_sha}) is not the remote's main (${remote_main}): push first" | |
| 22 | + exit 1 | |
| 23 | + fi | |
| 24 | +fi | |
| 25 | + | |
| 26 | +# The notes: ABOUT, the summary sentence of the release note, the commit, how it was built, a | |
| 27 | +# link to the release notes (EN and FR) and the checksums. | |
| 28 | +notes_file="release-notes/${TAG}.md" | |
| 29 | +notes_fr="release-notes/${TAG}.fr.md" | |
| 30 | +[ -f "${notes_file}" ] || { echo "❌ no ${notes_file}: write the release notes first"; exit 1; } | |
| 31 | +{ | |
| 32 | + printf '%s\n\n' "${ABOUT:-razorbill ${TAG}}" | |
| 33 | + # The first paragraph of the note after its title and language link: the summary sentence. | |
| 34 | + awk 'NR > 1 && /^[^#*[:space:]]/ { print; exit }' "${notes_file}" | |
| 35 | + printf '\n' | |
| 36 | + # shellcheck disable=SC2016 # Markdown backticks | |
| 37 | + printf -- '- Commit: `%s`\n' "${head_sha}" | |
| 38 | + # Written by local-ci-02-build.sh: this step may run on another machine. | |
| 39 | + if [ -f "${assets_dir}/build-info.txt" ]; then | |
| 40 | + printf -- '- Built on a local Mac with %s\n' "$(cat "${assets_dir}/build-info.txt")" | |
| 41 | + fi | |
| 42 | + printf -- '- macOS 14 or later, Apple Silicon\n' | |
| 43 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | |
| 44 | + printf -- '- rzb signed with a Developer ID and notarized by Apple\n' | |
| 45 | + fi | |
| 46 | + printf -- '- Install: https://rickub.com/%s/%s/blob/main/INSTALL.MACOS.md\n' "${OWNER}" "${REPO}" | |
| 47 | + printf '\nDetails: https://rickub.com/%s/%s/blob/main/%s' "${OWNER}" "${REPO}" "${notes_file}" | |
| 48 | + if [ -f "${notes_fr}" ]; then | |
| 49 | + printf ' (en français : https://rickub.com/%s/%s/blob/main/%s)' "${OWNER}" "${REPO}" "${notes_fr}" | |
| 50 | + fi | |
| 51 | + printf '\n' | |
| 52 | + printf '\n## Checksums\n\n```\n' | |
| 53 | + cat "${assets_dir}/SHA256SUMS" | |
| 54 | + printf '```\n' | |
| 55 | +} > "${work}/notes.md" | |
| 56 | + | |
| 57 | +# LOCAL_CI_PRINT_NOTES=1 shows the notes and stops: nothing is created. | |
| 58 | +if [ -n "${LOCAL_CI_PRINT_NOTES:-}" ]; then | |
| 59 | + cat "${work}/notes.md" | |
| 60 | + exit 0 | |
| 61 | +fi | |
| 62 | + | |
| 63 | +echo "==> creating the draft prerelease ${TAG} on ${head_sha}" | |
| 64 | +payload="$(jq -n --arg tag "${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ | |
| 65 | + '{tag: $tag, title: $tag, target: $target, body: $body, prerelease: true, draft: true}')" | |
| 66 | +status="$(call POST /releases -H 'Content-Type: application/json' -d "${payload}")" | |
| 67 | +case "${status}" in | |
| 68 | + 201) echo "✅ draft ${TAG} created" ;; | |
| 69 | + 409) echo "❌ the release ${TAG} already exists"; exit 1 ;; | |
| 70 | + *) echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1 ;; | |
| 71 | +esac | |
| new file mode 100755 | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-03-create-draft.sh — the tag and a draft prerelease on Rickub. | ||
| 3 | +# | ||
| 4 | +# Refuses when the archive would not be what the tag names: the working tree must be clean, HEAD | ||
| 5 | +# must be the remote's main, and TAG must match the version compiled into rzb. | ||
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 7 | +load_token | ||
| 8 | +check_tag | ||
| 9 | + | ||
| 10 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 11 | + | ||
| 12 | +head_sha="$(git rev-parse HEAD)" | ||
| 13 | +if [ -z "${LOCAL_CI_SKIP_GIT_CHECK:-}" ]; then | ||
| 14 | + if [ -n "$(git status --porcelain)" ]; then | ||
| 15 | + echo "❌ the working tree is not clean: commit first" | ||
| 16 | + git status --short | ||
| 17 | + exit 1 | ||
| 18 | + fi | ||
| 19 | + remote_main="$(git ls-remote "${git_url}" refs/heads/main | cut -f1)" | ||
| 20 | + if [ "${head_sha}" != "${remote_main}" ]; then | ||
| 21 | + echo "❌ HEAD (${head_sha}) is not the remote's main (${remote_main}): push first" | ||
| 22 | + exit 1 | ||
| 23 | + fi | ||
| 24 | +fi | ||
| 25 | + | ||
| 26 | +# The notes: ABOUT, the summary sentence of the release note, the commit, how it was built, a | ||
| 27 | +# link to the release notes (EN and FR) and the checksums. | ||
| 28 | +notes_file="release-notes/${TAG}.md" | ||
| 29 | +notes_fr="release-notes/${TAG}.fr.md" | ||
| 30 | +[ -f "${notes_file}" ] || { echo "❌ no ${notes_file}: write the release notes first"; exit 1; } | ||
| 31 | +{ | ||
| 32 | + printf '%s\n\n' "${ABOUT:-razorbill ${TAG}}" | ||
| 33 | + # The first paragraph of the note after its title and language link: the summary sentence. | ||
| 34 | + awk 'NR > 1 && /^[^#*[:space:]]/ { print; exit }' "${notes_file}" | ||
| 35 | + printf '\n' | ||
| 36 | + # shellcheck disable=SC2016 # Markdown backticks | ||
| 37 | + printf -- '- Commit: `%s`\n' "${head_sha}" | ||
| 38 | + # Written by local-ci-02-build.sh: this step may run on another machine. | ||
| 39 | + if [ -f "${assets_dir}/build-info.txt" ]; then | ||
| 40 | + printf -- '- Built on a local Mac with %s\n' "$(cat "${assets_dir}/build-info.txt")" | ||
| 41 | + fi | ||
| 42 | + printf -- '- macOS 14 or later, Apple Silicon\n' | ||
| 43 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | ||
| 44 | + printf -- '- rzb signed with a Developer ID and notarized by Apple\n' | ||
| 45 | + fi | ||
| 46 | + printf -- '- Install: https://rickub.com/%s/%s/blob/main/INSTALL.MACOS.md\n' "${OWNER}" "${REPO}" | ||
| 47 | + printf '\nDetails: https://rickub.com/%s/%s/blob/main/%s' "${OWNER}" "${REPO}" "${notes_file}" | ||
| 48 | + if [ -f "${notes_fr}" ]; then | ||
| 49 | + printf ' (en français : https://rickub.com/%s/%s/blob/main/%s)' "${OWNER}" "${REPO}" "${notes_fr}" | ||
| 50 | + fi | ||
| 51 | + printf '\n' | ||
| 52 | + printf '\n## Checksums\n\n```\n' | ||
| 53 | + cat "${assets_dir}/SHA256SUMS" | ||
| 54 | + printf '```\n' | ||
| 55 | +} > "${work}/notes.md" | ||
| 56 | + | ||
| 57 | +# LOCAL_CI_PRINT_NOTES=1 shows the notes and stops: nothing is created. | ||
| 58 | +if [ -n "${LOCAL_CI_PRINT_NOTES:-}" ]; then | ||
| 59 | + cat "${work}/notes.md" | ||
| 60 | + exit 0 | ||
| 61 | +fi | ||
| 62 | + | ||
| 63 | +echo "==> creating the draft prerelease ${TAG} on ${head_sha}" | ||
| 64 | +payload="$(jq -n --arg tag "${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ | ||
| 65 | + '{tag: $tag, title: $tag, target: $target, body: $body, prerelease: true, draft: true}')" | ||
| 66 | +status="$(call POST /releases -H 'Content-Type: application/json' -d "${payload}")" | ||
| 67 | +case "${status}" in | ||
| 68 | + 201) echo "✅ draft ${TAG} created" ;; | ||
| 69 | + 409) echo "❌ the release ${TAG} already exists"; exit 1 ;; | ||
| 70 | + *) echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1 ;; | ||
| 71 | +esac | ||
added
local-ci-04-upload.sh +109 -0 | new file mode 100755 | ||
| @@ -0,0 +1,109 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-04-upload.sh — the archive and SHA256SUMS of release/<TAG>/ onto the draft. | |
| 3 | +# | |
| 4 | +# Rickub only accepts uploads from the token of a CI job. So this pushes a | |
| 5 | +# temporary orphan branch holding the archive and a one-job workflow, waits for | |
| 6 | +# the job, and deletes the branch, whatever happened. The local checkout is | |
| 7 | +# never touched. | |
| 8 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 9 | +load_token | |
| 10 | + | |
| 11 | +branch="local-ci-publish-${TAG}" | |
| 12 | +run_timeout_seconds=900 | |
| 13 | +branch_pushed="" | |
| 14 | + | |
| 15 | +remove_branch() { | |
| 16 | + if [ -n "${branch_pushed}" ]; then | |
| 17 | + echo "==> deleting the branch ${branch}" | |
| 18 | + git -C "${work}/branch" push -q "${git_url}" --delete "${branch}" \ | |
| 19 | + || echo "⚠️ could not delete ${branch}: delete it by hand" | |
| 20 | + fi | |
| 21 | + cleanup_work | |
| 22 | +} | |
| 23 | +trap remove_branch EXIT | |
| 24 | + | |
| 25 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 26 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is not a draft: run local-ci-03-create-draft.sh"; exit 1; } | |
| 27 | + | |
| 28 | +echo "==> preparing the temporary branch" | |
| 29 | +git init -q -b "${branch}" "${work}/branch" | |
| 30 | +mkdir -p "${work}/branch/assets" "${work}/branch/.github/workflows" | |
| 31 | +[ -f "${assets_dir}/${ARCHIVE}" ] || { echo "❌ no ${assets_dir}/${ARCHIVE}: run local-ci-02-build.sh"; exit 2; } | |
| 32 | +cp "${assets_dir}/${ARCHIVE}" "${assets_dir}/SHA256SUMS" "${work}/branch/assets/" | |
| 33 | +printf '%s\n' "${TAG}" > "${work}/branch/TAG" | |
| 34 | +cat > "${work}/branch/.github/workflows/local-ci-publish.yml" <<'WORKFLOW' | |
| 35 | +name: local ci publish | |
| 36 | +on: | |
| 37 | + push: | |
| 38 | + branches: | |
| 39 | + - "local-ci-publish-*" | |
| 40 | +permissions: | |
| 41 | + contents: write | |
| 42 | +jobs: | |
| 43 | + upload: | |
| 44 | + runs-on: ubuntu-latest | |
| 45 | + steps: | |
| 46 | + - uses: actions/checkout@v4 | |
| 47 | + - name: Upload the archive to the release | |
| 48 | + env: | |
| 49 | + GITHUB_TOKEN: ${{ github.token }} | |
| 50 | + run: bash ./upload.sh | |
| 51 | +WORKFLOW | |
| 52 | +cat > "${work}/branch/upload.sh" <<'UPLOAD' | |
| 53 | +#!/usr/bin/env bash | |
| 54 | +set -euo pipefail | |
| 55 | +tag="$(cat TAG)" | |
| 56 | +api="${GITHUB_API_URL%/}/repos/${GITHUB_REPOSITORY}" | |
| 57 | +config="$(mktemp)" | |
| 58 | +printf 'header = "Authorization: Bearer %s"\n' "${GITHUB_TOKEN}" > "${config}" | |
| 59 | +curl -fsS -K "${config}" "${api}/releases?per_page=100" > releases.json | |
| 60 | +upload_url="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].upload_url // empty' releases.json | sed 's/{[^}]*}$//')" | |
| 61 | +[ -n "${upload_url}" ] || { echo "::error::no release ${tag} visible to the job"; exit 1; } | |
| 62 | +for file in assets/*; do | |
| 63 | + name="$(basename "${file}")" | |
| 64 | + status="$(curl -sS -o response.json -w '%{http_code}' -K "${config}" -X POST \ | |
| 65 | + -H 'Content-Type: application/octet-stream' --data-binary @"${file}" "${upload_url}?name=${name}")" | |
| 66 | + [ "${status}" = "201" ] || { echo "::error::HTTP ${status} uploading ${name}: $(cat response.json)"; exit 1; } | |
| 67 | + echo "uploaded ${name}" | |
| 68 | +done | |
| 69 | +release_id="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].id' releases.json)" | |
| 70 | +curl -fsS -K "${config}" "${api}/releases/${release_id}/assets" | jq -r '.[] | "asset \(.name) \(.size)"' | |
| 71 | +UPLOAD | |
| 72 | +git -C "${work}/branch" add -A | |
| 73 | +git -C "${work}/branch" -c user.name="${handle}" -c user.email="${handle}@users.noreply.rickub.com" commit -q -m "local ci: temporary branch to publish ${TAG}" | |
| 74 | +head_sha="$(git -C "${work}/branch" rev-parse HEAD)" | |
| 75 | +echo " $(du -sh "${work}/branch/assets" | cut -f1) of assets" | |
| 76 | + | |
| 77 | +echo "==> pushing ${branch}" | |
| 78 | +git -C "${work}/branch" push -q "${git_url}" "HEAD:refs/heads/${branch}" | |
| 79 | +branch_pushed="yes" | |
| 80 | + | |
| 81 | +echo "==> waiting for the CI job" | |
| 82 | +deadline=$(( SECONDS + run_timeout_seconds )) | |
| 83 | +run_number="" | |
| 84 | +run_status="" | |
| 85 | +while [ "${SECONDS}" -lt "${deadline}" ]; do | |
| 86 | + sleep 10 | |
| 87 | + status="$(call GET /actions/runs)" | |
| 88 | + [ "${status}" = "200" ] || continue | |
| 89 | + run="$(jq -c --arg sha "${head_sha}" '[.items[] | select(.head_sha == $sha)][0] // empty' "${work}/body")" | |
| 90 | + [ -n "${run}" ] || continue | |
| 91 | + run_number="$(jq -r '.number' <<<"${run}")" | |
| 92 | + run_status="$(jq -r '.status' <<<"${run}")" | |
| 93 | + echo " run ${run_number}: ${run_status}" | |
| 94 | + case "${run_status}" in | |
| 95 | + queued | pending | running | in_progress | waiting) ;; | |
| 96 | + *) break ;; | |
| 97 | + esac | |
| 98 | +done | |
| 99 | + | |
| 100 | +if [ -n "${run_number}" ] && [ "$(call GET "/actions/runs/${run_number}/logs")" = "200" ]; then | |
| 101 | + jq -r '.jobs[].log // empty' "${work}/body" > "${work}/run.log" | |
| 102 | + grep -E '(^| )(uploaded |asset |::error::)' "${work}/run.log" | cut -c1-160 || true | |
| 103 | +fi | |
| 104 | +[ "${run_status}" = "success" ] || { echo "❌ the job did not succeed (run ${run_number:-none}: ${run_status:-no run seen})"; exit 1; } | |
| 105 | + | |
| 106 | +expected="$(find "${work}/branch/assets" -type f | wc -l | tr -d ' ')" | |
| 107 | +uploaded="$(grep -cE '(^| )asset ' "${work}/run.log" || true)" | |
| 108 | +[ "${uploaded}" = "${expected}" ] || { echo "❌ ${uploaded} assets on the release, ${expected} expected"; exit 1; } | |
| 109 | +echo "✅ ${expected} files on the draft ${TAG}" | |
| new file mode 100755 | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-04-upload.sh — the archive and SHA256SUMS of release/<TAG>/ onto the draft. | ||
| 3 | +# | ||
| 4 | +# Rickub only accepts uploads from the token of a CI job. So this pushes a | ||
| 5 | +# temporary orphan branch holding the archive and a one-job workflow, waits for | ||
| 6 | +# the job, and deletes the branch, whatever happened. The local checkout is | ||
| 7 | +# never touched. | ||
| 8 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 9 | +load_token | ||
| 10 | + | ||
| 11 | +branch="local-ci-publish-${TAG}" | ||
| 12 | +run_timeout_seconds=900 | ||
| 13 | +branch_pushed="" | ||
| 14 | + | ||
| 15 | +remove_branch() { | ||
| 16 | + if [ -n "${branch_pushed}" ]; then | ||
| 17 | + echo "==> deleting the branch ${branch}" | ||
| 18 | + git -C "${work}/branch" push -q "${git_url}" --delete "${branch}" \ | ||
| 19 | + || echo "⚠️ could not delete ${branch}: delete it by hand" | ||
| 20 | + fi | ||
| 21 | + cleanup_work | ||
| 22 | +} | ||
| 23 | +trap remove_branch EXIT | ||
| 24 | + | ||
| 25 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 26 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is not a draft: run local-ci-03-create-draft.sh"; exit 1; } | ||
| 27 | + | ||
| 28 | +echo "==> preparing the temporary branch" | ||
| 29 | +git init -q -b "${branch}" "${work}/branch" | ||
| 30 | +mkdir -p "${work}/branch/assets" "${work}/branch/.github/workflows" | ||
| 31 | +[ -f "${assets_dir}/${ARCHIVE}" ] || { echo "❌ no ${assets_dir}/${ARCHIVE}: run local-ci-02-build.sh"; exit 2; } | ||
| 32 | +cp "${assets_dir}/${ARCHIVE}" "${assets_dir}/SHA256SUMS" "${work}/branch/assets/" | ||
| 33 | +printf '%s\n' "${TAG}" > "${work}/branch/TAG" | ||
| 34 | +cat > "${work}/branch/.github/workflows/local-ci-publish.yml" <<'WORKFLOW' | ||
| 35 | +name: local ci publish | ||
| 36 | +on: | ||
| 37 | + push: | ||
| 38 | + branches: | ||
| 39 | + - "local-ci-publish-*" | ||
| 40 | +permissions: | ||
| 41 | + contents: write | ||
| 42 | +jobs: | ||
| 43 | + upload: | ||
| 44 | + runs-on: ubuntu-latest | ||
| 45 | + steps: | ||
| 46 | + - uses: actions/checkout@v4 | ||
| 47 | + - name: Upload the archive to the release | ||
| 48 | + env: | ||
| 49 | + GITHUB_TOKEN: ${{ github.token }} | ||
| 50 | + run: bash ./upload.sh | ||
| 51 | +WORKFLOW | ||
| 52 | +cat > "${work}/branch/upload.sh" <<'UPLOAD' | ||
| 53 | +#!/usr/bin/env bash | ||
| 54 | +set -euo pipefail | ||
| 55 | +tag="$(cat TAG)" | ||
| 56 | +api="${GITHUB_API_URL%/}/repos/${GITHUB_REPOSITORY}" | ||
| 57 | +config="$(mktemp)" | ||
| 58 | +printf 'header = "Authorization: Bearer %s"\n' "${GITHUB_TOKEN}" > "${config}" | ||
| 59 | +curl -fsS -K "${config}" "${api}/releases?per_page=100" > releases.json | ||
| 60 | +upload_url="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].upload_url // empty' releases.json | sed 's/{[^}]*}$//')" | ||
| 61 | +[ -n "${upload_url}" ] || { echo "::error::no release ${tag} visible to the job"; exit 1; } | ||
| 62 | +for file in assets/*; do | ||
| 63 | + name="$(basename "${file}")" | ||
| 64 | + status="$(curl -sS -o response.json -w '%{http_code}' -K "${config}" -X POST \ | ||
| 65 | + -H 'Content-Type: application/octet-stream' --data-binary @"${file}" "${upload_url}?name=${name}")" | ||
| 66 | + [ "${status}" = "201" ] || { echo "::error::HTTP ${status} uploading ${name}: $(cat response.json)"; exit 1; } | ||
| 67 | + echo "uploaded ${name}" | ||
| 68 | +done | ||
| 69 | +release_id="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].id' releases.json)" | ||
| 70 | +curl -fsS -K "${config}" "${api}/releases/${release_id}/assets" | jq -r '.[] | "asset \(.name) \(.size)"' | ||
| 71 | +UPLOAD | ||
| 72 | +git -C "${work}/branch" add -A | ||
| 73 | +git -C "${work}/branch" -c user.name="${handle}" -c user.email="${handle}@users.noreply.rickub.com" commit -q -m "local ci: temporary branch to publish ${TAG}" | ||
| 74 | +head_sha="$(git -C "${work}/branch" rev-parse HEAD)" | ||
| 75 | +echo " $(du -sh "${work}/branch/assets" | cut -f1) of assets" | ||
| 76 | + | ||
| 77 | +echo "==> pushing ${branch}" | ||
| 78 | +git -C "${work}/branch" push -q "${git_url}" "HEAD:refs/heads/${branch}" | ||
| 79 | +branch_pushed="yes" | ||
| 80 | + | ||
| 81 | +echo "==> waiting for the CI job" | ||
| 82 | +deadline=$(( SECONDS + run_timeout_seconds )) | ||
| 83 | +run_number="" | ||
| 84 | +run_status="" | ||
| 85 | +while [ "${SECONDS}" -lt "${deadline}" ]; do | ||
| 86 | + sleep 10 | ||
| 87 | + status="$(call GET /actions/runs)" | ||
| 88 | + [ "${status}" = "200" ] || continue | ||
| 89 | + run="$(jq -c --arg sha "${head_sha}" '[.items[] | select(.head_sha == $sha)][0] // empty' "${work}/body")" | ||
| 90 | + [ -n "${run}" ] || continue | ||
| 91 | + run_number="$(jq -r '.number' <<<"${run}")" | ||
| 92 | + run_status="$(jq -r '.status' <<<"${run}")" | ||
| 93 | + echo " run ${run_number}: ${run_status}" | ||
| 94 | + case "${run_status}" in | ||
| 95 | + queued | pending | running | in_progress | waiting) ;; | ||
| 96 | + *) break ;; | ||
| 97 | + esac | ||
| 98 | +done | ||
| 99 | + | ||
| 100 | +if [ -n "${run_number}" ] && [ "$(call GET "/actions/runs/${run_number}/logs")" = "200" ]; then | ||
| 101 | + jq -r '.jobs[].log // empty' "${work}/body" > "${work}/run.log" | ||
| 102 | + grep -E '(^| )(uploaded |asset |::error::)' "${work}/run.log" | cut -c1-160 || true | ||
| 103 | +fi | ||
| 104 | +[ "${run_status}" = "success" ] || { echo "❌ the job did not succeed (run ${run_number:-none}: ${run_status:-no run seen})"; exit 1; } | ||
| 105 | + | ||
| 106 | +expected="$(find "${work}/branch/assets" -type f | wc -l | tr -d ' ')" | ||
| 107 | +uploaded="$(grep -cE '(^| )asset ' "${work}/run.log" || true)" | ||
| 108 | +[ "${uploaded}" = "${expected}" ] || { echo "❌ ${uploaded} assets on the release, ${expected} expected"; exit 1; } | ||
| 109 | +echo "✅ ${expected} files on the draft ${TAG}" | ||
added
local-ci-05-publish.sh +40 -0 | new file mode 100755 | ||
| @@ -0,0 +1,40 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-05-publish.sh — the draft becomes public, as a prerelease. | |
| 3 | +# | |
| 4 | +# On Rickub a published prerelease becomes /releases/latest, so everybody who | |
| 5 | +# downloads the latest version gets this one. It asks you to type the tag first, | |
| 6 | +# then downloads what is public and compares it with release/<TAG>/. | |
| 7 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 8 | +load_token | |
| 9 | + | |
| 10 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 11 | +id="$(release_field id)" | |
| 12 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}: run local-ci-03-create-draft.sh"; exit 1; } | |
| 13 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is already public"; exit 1; } | |
| 14 | + | |
| 15 | +echo "/releases/latest is now: $(latest_location)" | |
| 16 | +echo "Publishing makes ${TAG} the latest version for everybody." | |
| 17 | +printf 'Type %s to publish: ' "${TAG}" | |
| 18 | +read -r answer || answer="" | |
| 19 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not published"; exit 1; } | |
| 20 | + | |
| 21 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"draft": false, "prerelease": true}')" | |
| 22 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | |
| 23 | +echo "==> published" | |
| 24 | + | |
| 25 | +echo "==> checking what is public" | |
| 26 | +mkdir -p "${work}/download" | |
| 27 | +curl -fsSL -m 60 "${web}/releases/download/${TAG}/SHA256SUMS" -o "${work}/download/SHA256SUMS" | |
| 28 | +cmp "${work}/download/SHA256SUMS" "${assets_dir}/SHA256SUMS" || { echo "❌ SHA256SUMS differs"; exit 1; } | |
| 29 | +while read -r _ name; do | |
| 30 | + curl -fsSL -m 300 "${web}/releases/download/${TAG}/${name}" -o "${work}/download/${name}" | |
| 31 | +done < "${assets_dir}/SHA256SUMS" | |
| 32 | +( cd "${work}/download" && checksum -c SHA256SUMS ) | |
| 33 | + | |
| 34 | +location="$(latest_location)" | |
| 35 | +echo "/releases/latest -> ${location}" | |
| 36 | +case "${location}" in | |
| 37 | + *"/${TAG}") ;; | |
| 38 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | |
| 39 | +esac | |
| 40 | +echo "✅ ${TAG} is public" | |
| new file mode 100755 | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-05-publish.sh — the draft becomes public, as a prerelease. | ||
| 3 | +# | ||
| 4 | +# On Rickub a published prerelease becomes /releases/latest, so everybody who | ||
| 5 | +# downloads the latest version gets this one. It asks you to type the tag first, | ||
| 6 | +# then downloads what is public and compares it with release/<TAG>/. | ||
| 7 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 8 | +load_token | ||
| 9 | + | ||
| 10 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 11 | +id="$(release_field id)" | ||
| 12 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}: run local-ci-03-create-draft.sh"; exit 1; } | ||
| 13 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is already public"; exit 1; } | ||
| 14 | + | ||
| 15 | +echo "/releases/latest is now: $(latest_location)" | ||
| 16 | +echo "Publishing makes ${TAG} the latest version for everybody." | ||
| 17 | +printf 'Type %s to publish: ' "${TAG}" | ||
| 18 | +read -r answer || answer="" | ||
| 19 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not published"; exit 1; } | ||
| 20 | + | ||
| 21 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"draft": false, "prerelease": true}')" | ||
| 22 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | ||
| 23 | +echo "==> published" | ||
| 24 | + | ||
| 25 | +echo "==> checking what is public" | ||
| 26 | +mkdir -p "${work}/download" | ||
| 27 | +curl -fsSL -m 60 "${web}/releases/download/${TAG}/SHA256SUMS" -o "${work}/download/SHA256SUMS" | ||
| 28 | +cmp "${work}/download/SHA256SUMS" "${assets_dir}/SHA256SUMS" || { echo "❌ SHA256SUMS differs"; exit 1; } | ||
| 29 | +while read -r _ name; do | ||
| 30 | + curl -fsSL -m 300 "${web}/releases/download/${TAG}/${name}" -o "${work}/download/${name}" | ||
| 31 | +done < "${assets_dir}/SHA256SUMS" | ||
| 32 | +( cd "${work}/download" && checksum -c SHA256SUMS ) | ||
| 33 | + | ||
| 34 | +location="$(latest_location)" | ||
| 35 | +echo "/releases/latest -> ${location}" | ||
| 36 | +case "${location}" in | ||
| 37 | + *"/${TAG}") ;; | ||
| 38 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | ||
| 39 | +esac | ||
| 40 | +echo "✅ ${TAG} is public" | ||
added
local-ci-06-promote.sh +44 -0 | new file mode 100755 | ||
| @@ -0,0 +1,44 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# local-ci-06-promote.sh — a published prerelease becomes a release. | |
| 3 | +# | |
| 4 | +# ./local-ci-06-promote.sh # the TAG of .release.env | |
| 5 | +# ./local-ci-06-promote.sh v1.0.5 # another published prerelease | |
| 6 | +# | |
| 7 | +# Only the "pre-release" label goes: the files, the notes and the tag stay as | |
| 8 | +# they are. On Rickub a published prerelease is already /releases/latest, so | |
| 9 | +# downloads should not change. It asks you to type the tag first. | |
| 10 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 11 | +load_token | |
| 12 | + | |
| 13 | +TAG="${1:-${TAG}}" | |
| 14 | + | |
| 15 | +id="$(release_field id)" | |
| 16 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}"; exit 1; } | |
| 17 | +[ "$(release_field draft)" = "false" ] || { echo "❌ ${TAG} is still a draft: run local-ci-05-publish.sh first"; exit 1; } | |
| 18 | +[ "$(release_field prerelease)" = "true" ] || { echo "❌ ${TAG} is not a prerelease: nothing to do"; exit 1; } | |
| 19 | + | |
| 20 | +echo "/releases/latest is now: $(latest_location)" | |
| 21 | +echo "Promoting removes the pre-release label from ${TAG}." | |
| 22 | +printf 'Type %s to promote: ' "${TAG}" | |
| 23 | +read -r answer || answer="" | |
| 24 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not promoted"; exit 1; } | |
| 25 | + | |
| 26 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"prerelease": false}')" | |
| 27 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | |
| 28 | + | |
| 29 | +# Read the release back rather than trusting the 200: a field the server | |
| 30 | +# ignores would answer 200 too. | |
| 31 | +prerelease="$(release_field prerelease)" | |
| 32 | +draft="$(release_field draft)" | |
| 33 | +if [ "${prerelease}" != "false" ] || [ "${draft}" != "false" ]; then | |
| 34 | + echo "❌ ${TAG} reads back as prerelease=${prerelease}, draft=${draft}" | |
| 35 | + exit 1 | |
| 36 | +fi | |
| 37 | + | |
| 38 | +location="$(latest_location)" | |
| 39 | +echo "/releases/latest -> ${location}" | |
| 40 | +case "${location}" in | |
| 41 | + *"/${TAG}") ;; | |
| 42 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | |
| 43 | +esac | |
| 44 | +echo "✅ ${TAG} is a release" | |
| new file mode 100755 | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# local-ci-06-promote.sh — a published prerelease becomes a release. | ||
| 3 | +# | ||
| 4 | +# ./local-ci-06-promote.sh # the TAG of .release.env | ||
| 5 | +# ./local-ci-06-promote.sh v1.0.5 # another published prerelease | ||
| 6 | +# | ||
| 7 | +# Only the "pre-release" label goes: the files, the notes and the tag stay as | ||
| 8 | +# they are. On Rickub a published prerelease is already /releases/latest, so | ||
| 9 | +# downloads should not change. It asks you to type the tag first. | ||
| 10 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 11 | +load_token | ||
| 12 | + | ||
| 13 | +TAG="${1:-${TAG}}" | ||
| 14 | + | ||
| 15 | +id="$(release_field id)" | ||
| 16 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}"; exit 1; } | ||
| 17 | +[ "$(release_field draft)" = "false" ] || { echo "❌ ${TAG} is still a draft: run local-ci-05-publish.sh first"; exit 1; } | ||
| 18 | +[ "$(release_field prerelease)" = "true" ] || { echo "❌ ${TAG} is not a prerelease: nothing to do"; exit 1; } | ||
| 19 | + | ||
| 20 | +echo "/releases/latest is now: $(latest_location)" | ||
| 21 | +echo "Promoting removes the pre-release label from ${TAG}." | ||
| 22 | +printf 'Type %s to promote: ' "${TAG}" | ||
| 23 | +read -r answer || answer="" | ||
| 24 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not promoted"; exit 1; } | ||
| 25 | + | ||
| 26 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"prerelease": false}')" | ||
| 27 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | ||
| 28 | + | ||
| 29 | +# Read the release back rather than trusting the 200: a field the server | ||
| 30 | +# ignores would answer 200 too. | ||
| 31 | +prerelease="$(release_field prerelease)" | ||
| 32 | +draft="$(release_field draft)" | ||
| 33 | +if [ "${prerelease}" != "false" ] || [ "${draft}" != "false" ]; then | ||
| 34 | + echo "❌ ${TAG} reads back as prerelease=${prerelease}, draft=${draft}" | ||
| 35 | + exit 1 | ||
| 36 | +fi | ||
| 37 | + | ||
| 38 | +location="$(latest_location)" | ||
| 39 | +echo "/releases/latest -> ${location}" | ||
| 40 | +case "${location}" in | ||
| 41 | + *"/${TAG}") ;; | ||
| 42 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | ||
| 43 | +esac | ||
| 44 | +echo "✅ ${TAG} is a release" | ||
added
release-notes/v1.0.0.fr.md +26 -0 | new file mode 100644 | ||
| @@ -0,0 +1,26 @@ | ||
| 1 | +# razorbill 1.0.0 | |
| 2 | + | |
| 3 | +*[English version](v1.0.0.md)* | |
| 4 | + | |
| 5 | +razorbill 1.0.0 est la première version stable et la première publiée sur Rickub : `rzb` est signé avec un Developer ID et notarisé par Apple, une archive téléchargée se lance donc sans lever la quarantaine. razorbill passe sous licence MIT. Le serveur et la TUI sont ceux de la 0.3.0. | |
| 6 | + | |
| 7 | +## Nouveautés | |
| 8 | + | |
| 9 | +- **Signé et notarisé** (#52) : `rzb` porte une signature Developer ID avec le hardened runtime et un horodatage, ses bundles de ressources sont signés eux aussi, et le dossier entier est notarisé par Apple. Un exécutable seul ne peut pas recevoir le ticket (« staple ») : le premier lancement d'un téléchargement par navigateur vérifie la notarisation en ligne, puis macOS le lance sans rien demander. | |
| 10 | +- **Releases publiées** : l'archive `razorbill-1.0.0-macos-arm64.tar.gz` et son `SHA256SUMS` sont sur la [page des releases](https://rickub.com/bots-garden/razorbill/releases). | |
| 11 | +- **Guide d'installation** : [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md) installe le dossier dans `/usr/local/lib/razorbill` avec un lanceur `/usr/local/bin/rzb` (le même lanceur que `scripts/install.sh` : `scripts/install.sh --uninstall` retire l'une ou l'autre installation), et montre comment vérifier l'empreinte et la signature avant d'installer. | |
| 12 | +- **Licence MIT** : [LICENSE](../LICENSE), livrée aussi dans l'archive. | |
| 13 | + | |
| 14 | +## Pour les contributeurs | |
| 15 | + | |
| 16 | +- La chaîne de release est `local-ci-01-check.sh` à `local-ci-06-promote.sh` à la racine du dépôt : vérifications, compilation Release avec signature et notarisation, brouillon de prerelease, envoi, publication : [Préparer et publier une release](../docs/fr/how-to/preparer-une-release.md). | |
| 17 | +- `scripts/check-hardened-runtime.sh` lance la suite de compatibilité OpenAI sur une copie de `rzb` signée avec le hardened runtime, pour vérifier que MLX fonctionne toujours avec. | |
| 18 | +- `scripts/release.sh` gagne `--out <dossier>`, et son archive contient maintenant `LICENSE` ; son `INSTALL.txt` indique si `rzb` est signé. | |
| 19 | + | |
| 20 | +## Mise à jour | |
| 21 | + | |
| 22 | +Rien ne change dans la configuration, l'API ou les commandes. Remplacez le dossier installé entier (bundles compris) plutôt que `rzb` seul : [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md#mettre-à-jour-et-désinstaller). | |
| 23 | + | |
| 24 | +## Installation | |
| 25 | + | |
| 26 | +Téléchargez `razorbill-1.0.0-macos-arm64.tar.gz` et suivez [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md). macOS 14 ou plus récent sur Apple Silicon. | |
| new file mode 100644 | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | +# razorbill 1.0.0 | ||
| 2 | + | ||
| 3 | +*[English version](v1.0.0.md)* | ||
| 4 | + | ||
| 5 | +razorbill 1.0.0 est la première version stable et la première publiée sur Rickub : `rzb` est signé avec un Developer ID et notarisé par Apple, une archive téléchargée se lance donc sans lever la quarantaine. razorbill passe sous licence MIT. Le serveur et la TUI sont ceux de la 0.3.0. | ||
| 6 | + | ||
| 7 | +## Nouveautés | ||
| 8 | + | ||
| 9 | +- **Signé et notarisé** (#52) : `rzb` porte une signature Developer ID avec le hardened runtime et un horodatage, ses bundles de ressources sont signés eux aussi, et le dossier entier est notarisé par Apple. Un exécutable seul ne peut pas recevoir le ticket (« staple ») : le premier lancement d'un téléchargement par navigateur vérifie la notarisation en ligne, puis macOS le lance sans rien demander. | ||
| 10 | +- **Releases publiées** : l'archive `razorbill-1.0.0-macos-arm64.tar.gz` et son `SHA256SUMS` sont sur la [page des releases](https://rickub.com/bots-garden/razorbill/releases). | ||
| 11 | +- **Guide d'installation** : [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md) installe le dossier dans `/usr/local/lib/razorbill` avec un lanceur `/usr/local/bin/rzb` (le même lanceur que `scripts/install.sh` : `scripts/install.sh --uninstall` retire l'une ou l'autre installation), et montre comment vérifier l'empreinte et la signature avant d'installer. | ||
| 12 | +- **Licence MIT** : [LICENSE](../LICENSE), livrée aussi dans l'archive. | ||
| 13 | + | ||
| 14 | +## Pour les contributeurs | ||
| 15 | + | ||
| 16 | +- La chaîne de release est `local-ci-01-check.sh` à `local-ci-06-promote.sh` à la racine du dépôt : vérifications, compilation Release avec signature et notarisation, brouillon de prerelease, envoi, publication : [Préparer et publier une release](../docs/fr/how-to/preparer-une-release.md). | ||
| 17 | +- `scripts/check-hardened-runtime.sh` lance la suite de compatibilité OpenAI sur une copie de `rzb` signée avec le hardened runtime, pour vérifier que MLX fonctionne toujours avec. | ||
| 18 | +- `scripts/release.sh` gagne `--out <dossier>`, et son archive contient maintenant `LICENSE` ; son `INSTALL.txt` indique si `rzb` est signé. | ||
| 19 | + | ||
| 20 | +## Mise à jour | ||
| 21 | + | ||
| 22 | +Rien ne change dans la configuration, l'API ou les commandes. Remplacez le dossier installé entier (bundles compris) plutôt que `rzb` seul : [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md#mettre-à-jour-et-désinstaller). | ||
| 23 | + | ||
| 24 | +## Installation | ||
| 25 | + | ||
| 26 | +Téléchargez `razorbill-1.0.0-macos-arm64.tar.gz` et suivez [INSTALL.MACOS.fr.md](../INSTALL.MACOS.fr.md). macOS 14 ou plus récent sur Apple Silicon. | ||
added
release-notes/v1.0.0.md +26 -0 | new file mode 100644 | ||
| @@ -0,0 +1,26 @@ | ||
| 1 | +# razorbill 1.0.0 | |
| 2 | + | |
| 3 | +*[Version française](v1.0.0.fr.md)* | |
| 4 | + | |
| 5 | +razorbill 1.0.0 is the first stable release and the first one published on Rickub: `rzb` is signed with a Developer ID and notarized by Apple, so a downloaded archive runs without clearing the quarantine. razorbill is now under the MIT license. The server and the TUI are the same as in 0.3.0. | |
| 6 | + | |
| 7 | +## New | |
| 8 | + | |
| 9 | +- **Signed and notarized** (#52): `rzb` carries a Developer ID signature with the hardened runtime and a timestamp, its resource bundles are signed too, and the whole folder is notarized by Apple. A bare executable cannot be stapled: the first run of a browser download checks the notarization online, then macOS runs it without asking. | |
| 10 | +- **Published releases**: the archive `razorbill-1.0.0-macos-arm64.tar.gz` and its `SHA256SUMS` are on the [releases page](https://rickub.com/bots-garden/razorbill/releases). | |
| 11 | +- **Install guide**: [INSTALL.MACOS.md](../INSTALL.MACOS.md) installs the folder under `/usr/local/lib/razorbill` with a launcher in `/usr/local/bin/rzb` (the same launcher as `scripts/install.sh`, so `scripts/install.sh --uninstall` removes either), and shows how to check the checksum and the signature before installing. | |
| 12 | +- **MIT license**: [LICENSE](../LICENSE), also shipped in the archive. | |
| 13 | + | |
| 14 | +## For contributors | |
| 15 | + | |
| 16 | +- The release chain is `local-ci-01-check.sh` to `local-ci-06-promote.sh` at the root of the repository: checks, Release build with signature and notarization, draft prerelease, upload, publication: [Package and publish a release](../docs/en/how-to/package-a-release.md). | |
| 17 | +- `scripts/check-hardened-runtime.sh` runs the OpenAI compatibility suite against a copy of `rzb` signed with the hardened runtime, to check that MLX still works under it. | |
| 18 | +- `scripts/release.sh` gains `--out <dir>`, and its archive now holds `LICENSE`; its `INSTALL.txt` says whether `rzb` is signed. | |
| 19 | + | |
| 20 | +## Upgrading | |
| 21 | + | |
| 22 | +Nothing changes in the configuration, the API or the commands. Replace the whole installed folder (bundles included) rather than `rzb` alone: [INSTALL.MACOS.md](../INSTALL.MACOS.md#upgrading-and-uninstalling). | |
| 23 | + | |
| 24 | +## Install | |
| 25 | + | |
| 26 | +Download `razorbill-1.0.0-macos-arm64.tar.gz` and follow [INSTALL.MACOS.md](../INSTALL.MACOS.md). macOS 14 or later on Apple Silicon. | |
| new file mode 100644 | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | +# razorbill 1.0.0 | ||
| 2 | + | ||
| 3 | +*[Version française](v1.0.0.fr.md)* | ||
| 4 | + | ||
| 5 | +razorbill 1.0.0 is the first stable release and the first one published on Rickub: `rzb` is signed with a Developer ID and notarized by Apple, so a downloaded archive runs without clearing the quarantine. razorbill is now under the MIT license. The server and the TUI are the same as in 0.3.0. | ||
| 6 | + | ||
| 7 | +## New | ||
| 8 | + | ||
| 9 | +- **Signed and notarized** (#52): `rzb` carries a Developer ID signature with the hardened runtime and a timestamp, its resource bundles are signed too, and the whole folder is notarized by Apple. A bare executable cannot be stapled: the first run of a browser download checks the notarization online, then macOS runs it without asking. | ||
| 10 | +- **Published releases**: the archive `razorbill-1.0.0-macos-arm64.tar.gz` and its `SHA256SUMS` are on the [releases page](https://rickub.com/bots-garden/razorbill/releases). | ||
| 11 | +- **Install guide**: [INSTALL.MACOS.md](../INSTALL.MACOS.md) installs the folder under `/usr/local/lib/razorbill` with a launcher in `/usr/local/bin/rzb` (the same launcher as `scripts/install.sh`, so `scripts/install.sh --uninstall` removes either), and shows how to check the checksum and the signature before installing. | ||
| 12 | +- **MIT license**: [LICENSE](../LICENSE), also shipped in the archive. | ||
| 13 | + | ||
| 14 | +## For contributors | ||
| 15 | + | ||
| 16 | +- The release chain is `local-ci-01-check.sh` to `local-ci-06-promote.sh` at the root of the repository: checks, Release build with signature and notarization, draft prerelease, upload, publication: [Package and publish a release](../docs/en/how-to/package-a-release.md). | ||
| 17 | +- `scripts/check-hardened-runtime.sh` runs the OpenAI compatibility suite against a copy of `rzb` signed with the hardened runtime, to check that MLX still works under it. | ||
| 18 | +- `scripts/release.sh` gains `--out <dir>`, and its archive now holds `LICENSE`; its `INSTALL.txt` says whether `rzb` is signed. | ||
| 19 | + | ||
| 20 | +## Upgrading | ||
| 21 | + | ||
| 22 | +Nothing changes in the configuration, the API or the commands. Replace the whole installed folder (bundles included) rather than `rzb` alone: [INSTALL.MACOS.md](../INSTALL.MACOS.md#upgrading-and-uninstalling). | ||
| 23 | + | ||
| 24 | +## Install | ||
| 25 | + | ||
| 26 | +Download `razorbill-1.0.0-macos-arm64.tar.gz` and follow [INSTALL.MACOS.md](../INSTALL.MACOS.md). macOS 14 or later on Apple Silicon. | ||
modified
sbxenv.yaml +2 -2 | @@ -9,9 +9,9 @@ workspace: . | ||
| 9 | 9 | |
| 10 | 10 | additionalWorkspaces: |
| 11 | 11 | # - path: /Users/k33g/Documents |
| 12 | - # - path: /Users/k33g/kDrive/Rickub/bots-garden/mini-me-kit | |
| 12 | + - path: /Users/k33g/kDrive/Rickub/bots-garden/mini-me | |
| 13 | 13 | # - path: /Users/k33g/kDrive/Rickub/bots-garden/pov-ray-go |
| 14 | - - path: /Users/k33g/kDrive/swift-model-runner/ | |
| 14 | + # - path: /Users/k33g/kDrive/swift-model-runner/ | |
| 15 | 15 | |
| 16 | 16 | kits: |
| 17 | 17 | - docker.io/k33g/swift-toolchain-kit:0.2.0 |
| @@ -9,9 +9,9 @@ workspace: . | |||
| 9 | 9 | ||
| 10 | additionalWorkspaces: | 10 | additionalWorkspaces: |
| 11 | # - path: /Users/k33g/Documents | 11 | # - path: /Users/k33g/Documents |
| 12 | - # - path: /Users/k33g/kDrive/Rickub/bots-garden/mini-me-kit | 12 | + - path: /Users/k33g/kDrive/Rickub/bots-garden/mini-me |
| 13 | # - path: /Users/k33g/kDrive/Rickub/bots-garden/pov-ray-go | 13 | # - path: /Users/k33g/kDrive/Rickub/bots-garden/pov-ray-go |
| 14 | - - path: /Users/k33g/kDrive/swift-model-runner/ | 14 | + # - path: /Users/k33g/kDrive/swift-model-runner/ |
| 15 | 15 | ||
| 16 | kits: | 16 | kits: |
| 17 | - docker.io/k33g/swift-toolchain-kit:0.2.0 | 17 | - docker.io/k33g/swift-toolchain-kit:0.2.0 |
added
scripts/check-hardened-runtime.sh +70 -0 | new file mode 100755 | ||
| @@ -0,0 +1,70 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Does rzb still work under the hardened runtime that notarization requires? (ticket #52) | |
| 3 | +# | |
| 4 | +# scripts/check-hardened-runtime.sh # Mac only; writes nothing in the repository | |
| 5 | +# | |
| 6 | +# Builds rzb in Release (incremental, .build/xcode), copies it with its bundles to a temporary | |
| 7 | +# folder, signs the copy the way local-ci-02-build.sh signs the release (hardened runtime, with | |
| 8 | +# RZB_SIGN_IDENTITY from .release.env when it is set, otherwise ad hoc), then runs the OpenAI | |
| 9 | +# compatibility suite (scripts/compat.sh) against that copy: real MLX chat, streaming, | |
| 10 | +# structured output, tools and embeddings, with Metal kernels compiled at run time and | |
| 11 | +# default.metallib loaded from the bundle. The models compat.sh needs must be pulled first. | |
| 12 | +# | |
| 13 | +# Exit code: 0 = rzb works signed like the release, 1 = it does not, 2 = the check could not run. | |
| 14 | +set -euo pipefail | |
| 15 | +cd "$(dirname "$0")/.." | |
| 16 | + | |
| 17 | +if [[ "$(uname -s)" != Darwin ]]; then | |
| 18 | + echo "❌ this check needs macOS (codesign, MLX)" | |
| 19 | + exit 2 | |
| 20 | +fi | |
| 21 | + | |
| 22 | +# .release.env may hold RZB_SIGN_IDENTITY; it also requires nothing else here. | |
| 23 | +if [[ -f ./.release.env ]]; then | |
| 24 | + # shellcheck disable=SC1091 | |
| 25 | + source ./.release.env | |
| 26 | +fi | |
| 27 | +identity="${RZB_SIGN_IDENTITY:--}" | |
| 28 | + | |
| 29 | +xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | |
| 30 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation -quiet \ | |
| 31 | + CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO | |
| 32 | +products=.build/xcode/Build/Products/Release | |
| 33 | + | |
| 34 | +work=$(mktemp -d) | |
| 35 | +trap 'rm -rf "$work"' EXIT | |
| 36 | +cp "$products/rzb" "$work/" | |
| 37 | +cp -R "$products"/*.bundle "$work/" | |
| 38 | +xattr -cr "$work" 2>/dev/null || true | |
| 39 | + | |
| 40 | +if [[ "$identity" == "-" ]]; then | |
| 41 | + echo "🔏 signing ad hoc (RZB_SIGN_IDENTITY is not set), with the hardened runtime" | |
| 42 | +else | |
| 43 | + echo "🔏 signing with $identity, with the hardened runtime" | |
| 44 | +fi | |
| 45 | +# No --timestamp: this copy is not notarized, and the timestamp server is not what is checked. | |
| 46 | +for bundle in "$work"/*.bundle; do | |
| 47 | + codesign --force --timestamp=none --sign "$identity" "$bundle" 2>/dev/null | |
| 48 | +done | |
| 49 | +codesign --force --timestamp=none --options runtime --identifier com.bots-garden.rzb \ | |
| 50 | + --sign "$identity" "$work/rzb" 2>/dev/null | |
| 51 | + | |
| 52 | +# The whole output first: with pipefail, `codesign | grep -q` fails when grep stops early. | |
| 53 | +details=$(codesign -dv --verbose=4 "$work/rzb" 2>&1) | |
| 54 | +if ! grep -q "flags=.*runtime" <<<"$details"; then | |
| 55 | + echo "❌ the copy has no hardened runtime flag: the check would prove nothing" | |
| 56 | + printf '%s\n' "$details" | |
| 57 | + exit 2 | |
| 58 | +fi | |
| 59 | +echo " ✅ hardened runtime flag present" | |
| 60 | + | |
| 61 | +echo "🧪 OpenAI compatibility suite against the signed copy..." | |
| 62 | +if RZB_BIN="$work/rzb" scripts/compat.sh; then | |
| 63 | + echo "" | |
| 64 | + echo "✅ rzb works under the hardened runtime: no entitlement needed." | |
| 65 | + exit 0 | |
| 66 | +fi | |
| 67 | +echo "" | |
| 68 | +echo "❌ the suite fails with the hardened runtime. Run scripts/compat.sh alone (unsigned build):" | |
| 69 | +echo " if it passes, the hardened runtime is the cause and rzb needs an entitlement." | |
| 70 | +exit 1 | |
| new file mode 100755 | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Does rzb still work under the hardened runtime that notarization requires? (ticket #52) | ||
| 3 | +# | ||
| 4 | +# scripts/check-hardened-runtime.sh # Mac only; writes nothing in the repository | ||
| 5 | +# | ||
| 6 | +# Builds rzb in Release (incremental, .build/xcode), copies it with its bundles to a temporary | ||
| 7 | +# folder, signs the copy the way local-ci-02-build.sh signs the release (hardened runtime, with | ||
| 8 | +# RZB_SIGN_IDENTITY from .release.env when it is set, otherwise ad hoc), then runs the OpenAI | ||
| 9 | +# compatibility suite (scripts/compat.sh) against that copy: real MLX chat, streaming, | ||
| 10 | +# structured output, tools and embeddings, with Metal kernels compiled at run time and | ||
| 11 | +# default.metallib loaded from the bundle. The models compat.sh needs must be pulled first. | ||
| 12 | +# | ||
| 13 | +# Exit code: 0 = rzb works signed like the release, 1 = it does not, 2 = the check could not run. | ||
| 14 | +set -euo pipefail | ||
| 15 | +cd "$(dirname "$0")/.." | ||
| 16 | + | ||
| 17 | +if [[ "$(uname -s)" != Darwin ]]; then | ||
| 18 | + echo "❌ this check needs macOS (codesign, MLX)" | ||
| 19 | + exit 2 | ||
| 20 | +fi | ||
| 21 | + | ||
| 22 | +# .release.env may hold RZB_SIGN_IDENTITY; it also requires nothing else here. | ||
| 23 | +if [[ -f ./.release.env ]]; then | ||
| 24 | + # shellcheck disable=SC1091 | ||
| 25 | + source ./.release.env | ||
| 26 | +fi | ||
| 27 | +identity="${RZB_SIGN_IDENTITY:--}" | ||
| 28 | + | ||
| 29 | +xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | ||
| 30 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation -quiet \ | ||
| 31 | + CLANG_ENABLE_CODE_COVERAGE=NO CLANG_COVERAGE_MAPPING=NO | ||
| 32 | +products=.build/xcode/Build/Products/Release | ||
| 33 | + | ||
| 34 | +work=$(mktemp -d) | ||
| 35 | +trap 'rm -rf "$work"' EXIT | ||
| 36 | +cp "$products/rzb" "$work/" | ||
| 37 | +cp -R "$products"/*.bundle "$work/" | ||
| 38 | +xattr -cr "$work" 2>/dev/null || true | ||
| 39 | + | ||
| 40 | +if [[ "$identity" == "-" ]]; then | ||
| 41 | + echo "🔏 signing ad hoc (RZB_SIGN_IDENTITY is not set), with the hardened runtime" | ||
| 42 | +else | ||
| 43 | + echo "🔏 signing with $identity, with the hardened runtime" | ||
| 44 | +fi | ||
| 45 | +# No --timestamp: this copy is not notarized, and the timestamp server is not what is checked. | ||
| 46 | +for bundle in "$work"/*.bundle; do | ||
| 47 | + codesign --force --timestamp=none --sign "$identity" "$bundle" 2>/dev/null | ||
| 48 | +done | ||
| 49 | +codesign --force --timestamp=none --options runtime --identifier com.bots-garden.rzb \ | ||
| 50 | + --sign "$identity" "$work/rzb" 2>/dev/null | ||
| 51 | + | ||
| 52 | +# The whole output first: with pipefail, `codesign | grep -q` fails when grep stops early. | ||
| 53 | +details=$(codesign -dv --verbose=4 "$work/rzb" 2>&1) | ||
| 54 | +if ! grep -q "flags=.*runtime" <<<"$details"; then | ||
| 55 | + echo "❌ the copy has no hardened runtime flag: the check would prove nothing" | ||
| 56 | + printf '%s\n' "$details" | ||
| 57 | + exit 2 | ||
| 58 | +fi | ||
| 59 | +echo " ✅ hardened runtime flag present" | ||
| 60 | + | ||
| 61 | +echo "🧪 OpenAI compatibility suite against the signed copy..." | ||
| 62 | +if RZB_BIN="$work/rzb" scripts/compat.sh; then | ||
| 63 | + echo "" | ||
| 64 | + echo "✅ rzb works under the hardened runtime: no entitlement needed." | ||
| 65 | + exit 0 | ||
| 66 | +fi | ||
| 67 | +echo "" | ||
| 68 | +echo "❌ the suite fails with the hardened runtime. Run scripts/compat.sh alone (unsigned build):" | ||
| 69 | +echo " if it passes, the hardened runtime is the cause and rzb needs an entitlement." | ||
| 70 | +exit 1 | ||
modified
scripts/release.sh +33 -12 | @@ -4,23 +4,27 @@ | ||
| 4 | 4 | # scripts/release.sh # build, package, check (Mac, Apple Silicon) |
| 5 | 5 | # scripts/release.sh --products <dir> # package an existing build instead of building |
| 6 | 6 | # scripts/release.sh --allow-dirty # accept uncommitted changes (test archives only) |
| 7 | +# scripts/release.sh --out <dir> # write the archive there instead of dist/ | |
| 7 | 8 | # |
| 8 | -# Output, in dist/: | |
| 9 | +# Output, in dist/ (or --out): | |
| 9 | 10 | # razorbill-<version>-macos-arm64.tar.gz rzb + the resource bundles it loads at run time |
| 10 | 11 | # razorbill-<version>-macos-arm64.tar.gz.sha256 its SHA-256, in `shasum -a 256 -c` format |
| 11 | 12 | # |
| 12 | -# The version is read from Sources/RazorbillCore/Razorbill.swift. The executable is not signed | |
| 13 | -# beyond the linker's ad-hoc signature (Developer ID signing and notarization: v1.0.0). | |
| 13 | +# The version is read from Sources/RazorbillCore/Razorbill.swift. This script does not sign: a | |
| 14 | +# signed and notarized release is local-ci-02-build.sh, which signs a copy of the build and | |
| 15 | +# hands it to this script with --products. | |
| 14 | 16 | set -euo pipefail |
| 15 | 17 | cd "$(dirname "$0")/.." |
| 16 | 18 | |
| 17 | 19 | products="" |
| 18 | 20 | allow_dirty=false |
| 21 | +out=dist | |
| 19 | 22 | while [[ $# -gt 0 ]]; do |
| 20 | 23 | case "$1" in |
| 21 | 24 | --products) products="${2:?--products needs a directory}"; shift 2 ;; |
| 22 | 25 | --allow-dirty) allow_dirty=true; shift ;; |
| 23 | - -h|--help) sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | |
| 26 | + --out) out="${2:?--out needs a directory}"; shift 2 ;; | |
| 27 | + -h|--help) sed -n '2,16p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | |
| 24 | 28 | *) echo "release.sh: unknown option $1 (see --help)" >&2; exit 2 ;; |
| 25 | 29 | esac |
| 26 | 30 | done |
| @@ -67,6 +71,22 @@ cp "$products/rzb" "$staging/$name/" | ||
| 67 | 71 | for bundle in "$products"/*.bundle; do |
| 68 | 72 | cp -R "$bundle" "$staging/$name/" |
| 69 | 73 | done |
| 74 | +cp LICENSE "$staging/$name/" | |
| 75 | +# What INSTALL.txt says about the quarantine depends on the signature the archive carries. | |
| 76 | +# The whole codesign output first: with pipefail, `codesign | grep -q` fails when grep stops | |
| 77 | +# early and codesign dies of SIGPIPE. | |
| 78 | +signed=false | |
| 79 | +if [[ "$(uname -s)" == Darwin ]]; then | |
| 80 | + signature=$(codesign -dv "$products/rzb" 2>&1 || true) | |
| 81 | + if grep -q '^Authority=Developer ID Application' <<<"$signature"; then signed=true; fi | |
| 82 | +fi | |
| 83 | +if [[ "$signed" == true ]]; then | |
| 84 | + quarantine="rzb is signed with a Developer ID and notarized by Apple: a browser download | |
| 85 | +runs without clearing the quarantine (the first run checks the notarization online)." | |
| 86 | +else | |
| 87 | + quarantine="If the archive was downloaded with a browser, macOS quarantines it (this rzb is | |
| 88 | +not notarized). Clear it once: xattr -dr com.apple.quarantine ~/.local/lib/razorbill" | |
| 89 | +fi | |
| 70 | 90 | cat > "$staging/$name/INSTALL.txt" <<EOF |
| 71 | 91 | razorbill ${version} — MLX model server for Apple Silicon (macOS 14 or later) |
| 72 | 92 | |
| @@ -77,21 +97,22 @@ Keep rzb and the .bundle folders together: rzb loads them from its own folder | ||
| 77 | 97 | export PATH="\$HOME/.local/lib/razorbill:\$PATH" # add this line to ~/.zshrc |
| 78 | 98 | rzb version |
| 79 | 99 | |
| 80 | -If the archive was downloaded with a browser, macOS quarantines it (rzb is not | |
| 81 | -notarized yet). Clear it once: xattr -dr com.apple.quarantine ~/.local/lib/razorbill | |
| 100 | +$quarantine | |
| 101 | + | |
| 102 | +Full guide: https://rickub.com/bots-garden/razorbill/blob/main/INSTALL.MACOS.md | |
| 82 | 103 | EOF |
| 83 | 104 | |
| 84 | -mkdir -p dist | |
| 85 | -archive="dist/${name}.tar.gz" | |
| 105 | +mkdir -p "$out" | |
| 106 | +archive="$out/${name}.tar.gz" | |
| 86 | 107 | # A dist/ left by an earlier run under sudo is root-owned: tar would only say "Failed to open". |
| 87 | -for target in dist "$archive" "$archive.sha256"; do | |
| 108 | +for target in "$out" "$archive" "$archive.sha256"; do | |
| 88 | 109 | if [[ -e "$target" && ! -w "$target" ]]; then |
| 89 | - fail "$target is not writable (left by a run with sudo?): sudo chown -R \"\$(whoami)\" dist .build" | |
| 110 | + fail "$target is not writable (left by a run with sudo?): sudo chown -R \"\$(whoami)\" $out .build" | |
| 90 | 111 | fi |
| 91 | 112 | done |
| 92 | 113 | # No AppleDouble (._*) files from extended attributes in the archive (macOS tar). |
| 93 | 114 | COPYFILE_DISABLE=1 tar -C "$staging" -czf "$archive" "$name" |
| 94 | -(cd dist && shasum -a 256 "${name}.tar.gz" > "${name}.tar.gz.sha256") | |
| 115 | +(cd "$out" && shasum -a 256 "${name}.tar.gz" > "${name}.tar.gz.sha256") | |
| 95 | 116 | |
| 96 | 117 | # Check the archive itself, unpacked somewhere else: the bundles must travel with rzb. |
| 97 | 118 | check=$(mktemp -d) |
| @@ -104,4 +125,4 @@ if [[ "$(uname -s)" == Darwin ]]; then | ||
| 104 | 125 | fi |
| 105 | 126 | |
| 106 | 127 | echo "$archive" |
| 107 | -cat "dist/${name}.tar.gz.sha256" | |
| 128 | +cat "$out/${name}.tar.gz.sha256" | |
| @@ -4,23 +4,27 @@ | |||
| 4 | # scripts/release.sh # build, package, check (Mac, Apple Silicon) | 4 | # scripts/release.sh # build, package, check (Mac, Apple Silicon) |
| 5 | # scripts/release.sh --products <dir> # package an existing build instead of building | 5 | # scripts/release.sh --products <dir> # package an existing build instead of building |
| 6 | # scripts/release.sh --allow-dirty # accept uncommitted changes (test archives only) | 6 | # scripts/release.sh --allow-dirty # accept uncommitted changes (test archives only) |
| 7 | +# scripts/release.sh --out <dir> # write the archive there instead of dist/ | ||
| 7 | # | 8 | # |
| 8 | -# Output, in dist/: | 9 | +# Output, in dist/ (or --out): |
| 9 | # razorbill-<version>-macos-arm64.tar.gz rzb + the resource bundles it loads at run time | 10 | # razorbill-<version>-macos-arm64.tar.gz rzb + the resource bundles it loads at run time |
| 10 | # razorbill-<version>-macos-arm64.tar.gz.sha256 its SHA-256, in `shasum -a 256 -c` format | 11 | # razorbill-<version>-macos-arm64.tar.gz.sha256 its SHA-256, in `shasum -a 256 -c` format |
| 11 | # | 12 | # |
| 12 | -# The version is read from Sources/RazorbillCore/Razorbill.swift. The executable is not signed | 13 | +# The version is read from Sources/RazorbillCore/Razorbill.swift. This script does not sign: a |
| 13 | -# beyond the linker's ad-hoc signature (Developer ID signing and notarization: v1.0.0). | 14 | +# signed and notarized release is local-ci-02-build.sh, which signs a copy of the build and |
| 15 | +# hands it to this script with --products. | ||
| 14 | set -euo pipefail | 16 | set -euo pipefail |
| 15 | cd "$(dirname "$0")/.." | 17 | cd "$(dirname "$0")/.." |
| 16 | 18 | ||
| 17 | products="" | 19 | products="" |
| 18 | allow_dirty=false | 20 | allow_dirty=false |
| 21 | +out=dist | ||
| 19 | while [[ $# -gt 0 ]]; do | 22 | while [[ $# -gt 0 ]]; do |
| 20 | case "$1" in | 23 | case "$1" in |
| 21 | --products) products="${2:?--products needs a directory}"; shift 2 ;; | 24 | --products) products="${2:?--products needs a directory}"; shift 2 ;; |
| 22 | --allow-dirty) allow_dirty=true; shift ;; | 25 | --allow-dirty) allow_dirty=true; shift ;; |
| 23 | - -h|--help) sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | 26 | + --out) out="${2:?--out needs a directory}"; shift 2 ;; |
| 27 | + -h|--help) sed -n '2,16p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | ||
| 24 | *) echo "release.sh: unknown option $1 (see --help)" >&2; exit 2 ;; | 28 | *) echo "release.sh: unknown option $1 (see --help)" >&2; exit 2 ;; |
| 25 | esac | 29 | esac |
| 26 | done | 30 | done |
| @@ -67,6 +71,22 @@ cp "$products/rzb" "$staging/$name/" | |||
| 67 | for bundle in "$products"/*.bundle; do | 71 | for bundle in "$products"/*.bundle; do |
| 68 | cp -R "$bundle" "$staging/$name/" | 72 | cp -R "$bundle" "$staging/$name/" |
| 69 | done | 73 | done |
| 74 | +cp LICENSE "$staging/$name/" | ||
| 75 | +# What INSTALL.txt says about the quarantine depends on the signature the archive carries. | ||
| 76 | +# The whole codesign output first: with pipefail, `codesign | grep -q` fails when grep stops | ||
| 77 | +# early and codesign dies of SIGPIPE. | ||
| 78 | +signed=false | ||
| 79 | +if [[ "$(uname -s)" == Darwin ]]; then | ||
| 80 | + signature=$(codesign -dv "$products/rzb" 2>&1 || true) | ||
| 81 | + if grep -q '^Authority=Developer ID Application' <<<"$signature"; then signed=true; fi | ||
| 82 | +fi | ||
| 83 | +if [[ "$signed" == true ]]; then | ||
| 84 | + quarantine="rzb is signed with a Developer ID and notarized by Apple: a browser download | ||
| 85 | +runs without clearing the quarantine (the first run checks the notarization online)." | ||
| 86 | +else | ||
| 87 | + quarantine="If the archive was downloaded with a browser, macOS quarantines it (this rzb is | ||
| 88 | +not notarized). Clear it once: xattr -dr com.apple.quarantine ~/.local/lib/razorbill" | ||
| 89 | +fi | ||
| 70 | cat > "$staging/$name/INSTALL.txt" <<EOF | 90 | cat > "$staging/$name/INSTALL.txt" <<EOF |
| 71 | razorbill ${version} — MLX model server for Apple Silicon (macOS 14 or later) | 91 | razorbill ${version} — MLX model server for Apple Silicon (macOS 14 or later) |
| 72 | 92 | ||
| @@ -77,21 +97,22 @@ Keep rzb and the .bundle folders together: rzb loads them from its own folder | |||
| 77 | export PATH="\$HOME/.local/lib/razorbill:\$PATH" # add this line to ~/.zshrc | 97 | export PATH="\$HOME/.local/lib/razorbill:\$PATH" # add this line to ~/.zshrc |
| 78 | rzb version | 98 | rzb version |
| 79 | 99 | ||
| 80 | -If the archive was downloaded with a browser, macOS quarantines it (rzb is not | 100 | +$quarantine |
| 81 | -notarized yet). Clear it once: xattr -dr com.apple.quarantine ~/.local/lib/razorbill | 101 | + |
| 102 | +Full guide: https://rickub.com/bots-garden/razorbill/blob/main/INSTALL.MACOS.md | ||
| 82 | EOF | 103 | EOF |
| 83 | 104 | ||
| 84 | -mkdir -p dist | 105 | +mkdir -p "$out" |
| 85 | -archive="dist/${name}.tar.gz" | 106 | +archive="$out/${name}.tar.gz" |
| 86 | # A dist/ left by an earlier run under sudo is root-owned: tar would only say "Failed to open". | 107 | # A dist/ left by an earlier run under sudo is root-owned: tar would only say "Failed to open". |
| 87 | -for target in dist "$archive" "$archive.sha256"; do | 108 | +for target in "$out" "$archive" "$archive.sha256"; do |
| 88 | if [[ -e "$target" && ! -w "$target" ]]; then | 109 | if [[ -e "$target" && ! -w "$target" ]]; then |
| 89 | - fail "$target is not writable (left by a run with sudo?): sudo chown -R \"\$(whoami)\" dist .build" | 110 | + fail "$target is not writable (left by a run with sudo?): sudo chown -R \"\$(whoami)\" $out .build" |
| 90 | fi | 111 | fi |
| 91 | done | 112 | done |
| 92 | # No AppleDouble (._*) files from extended attributes in the archive (macOS tar). | 113 | # No AppleDouble (._*) files from extended attributes in the archive (macOS tar). |
| 93 | COPYFILE_DISABLE=1 tar -C "$staging" -czf "$archive" "$name" | 114 | COPYFILE_DISABLE=1 tar -C "$staging" -czf "$archive" "$name" |
| 94 | -(cd dist && shasum -a 256 "${name}.tar.gz" > "${name}.tar.gz.sha256") | 115 | +(cd "$out" && shasum -a 256 "${name}.tar.gz" > "${name}.tar.gz.sha256") |
| 95 | 116 | ||
| 96 | # Check the archive itself, unpacked somewhere else: the bundles must travel with rzb. | 117 | # Check the archive itself, unpacked somewhere else: the bundles must travel with rzb. |
| 97 | check=$(mktemp -d) | 118 | check=$(mktemp -d) |
| @@ -104,4 +125,4 @@ if [[ "$(uname -s)" == Darwin ]]; then | |||
| 104 | fi | 125 | fi |
| 105 | 126 | ||
| 106 | echo "$archive" | 127 | echo "$archive" |
| 107 | -cat "dist/${name}.tar.gz.sha256" | 128 | +cat "$out/${name}.tar.gz.sha256" |