🛟 Updated.
8095158 parent: f9dc67e renamed
.github.bak/workflows/release.yml +0 -0 | similarity index 100% | ||
| rename from .github/workflows/release.yml | ||
| rename to .github.bak/workflows/release.yml |
| similarity index 100% | |||
| rename from .github/workflows/release.yml | |||
| rename to .github.bak/workflows/release.yml |
modified
.gitignore +4 -0 | @@ -23,3 +23,7 @@ tmp/ | ||
| 23 | 23 | |
| 24 | 24 | sandboxes |
| 25 | 25 | blog |
| 26 | + | |
| 27 | +# Local CI (local-ci-*.sh): settings, token and staged packages | |
| 28 | +*.env | |
| 29 | +release/ | |
| @@ -23,3 +23,7 @@ tmp/ | |||
| 23 | 23 | ||
| 24 | sandboxes | 24 | sandboxes |
| 25 | blog | 25 | blog |
| 26 | + | ||
| 27 | +# Local CI (local-ci-*.sh): settings, token and staged packages | ||
| 28 | +*.env | ||
| 29 | +release/ | ||
added
.memory/handoffs/2026-11-08-local-ci.md +17 -0 | new file mode 100644 | ||
| @@ -0,0 +1,17 @@ | ||
| 1 | +# Handoff — 2026-11-08 — Local CI | |
| 2 | + | |
| 3 | +## State | |
| 4 | + | |
| 5 | +The local CI is written, uncommitted, and has never run on the Mac. `.release.env` has `TAG="v9.9.9"`. | |
| 6 | + | |
| 7 | +## Next steps | |
| 8 | + | |
| 9 | +1. Review `git status`, commit (`.github.bak` rename, scripts, docs), push to `main`: step 03 refuses while `HEAD` still has `.github/workflows`. | |
| 10 | +2. On the Mac, in order: `./local-ci-01-check.sh`, `./local-ci-02-build.sh` (SIDEKICKS_SIGN_IDENTITY / SIDEKICKS_NOTARY_PROFILE exported), 03, 04, 05; then delete the v9.9.9 release and tag on Rickub. | |
| 11 | +3. Then set `TAG` to `v1.2.0` (or the next version) for the real release. | |
| 12 | + | |
| 13 | +## Watch out for | |
| 14 | + | |
| 15 | +- The `.dmg` step (`wails3 tool package`, same flags as the old guide's B5) and the hardened runtime without entitlements are untested here; if the signed app fails to start, see "Variants" in the signing guide (entitlements). | |
| 16 | +- `.ci.cd.token.env` was copied from mini-me: if step 03 answers 401/403, make a token for this repo. | |
| 17 | +- Test tag v9.9.9 + upload branch `local-ci-publish-v9.9.9`: if a run dies, delete the branch by hand. | |
| new file mode 100644 | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | +# Handoff — 2026-11-08 — Local CI | ||
| 2 | + | ||
| 3 | +## State | ||
| 4 | + | ||
| 5 | +The local CI is written, uncommitted, and has never run on the Mac. `.release.env` has `TAG="v9.9.9"`. | ||
| 6 | + | ||
| 7 | +## Next steps | ||
| 8 | + | ||
| 9 | +1. Review `git status`, commit (`.github.bak` rename, scripts, docs), push to `main`: step 03 refuses while `HEAD` still has `.github/workflows`. | ||
| 10 | +2. On the Mac, in order: `./local-ci-01-check.sh`, `./local-ci-02-build.sh` (SIDEKICKS_SIGN_IDENTITY / SIDEKICKS_NOTARY_PROFILE exported), 03, 04, 05; then delete the v9.9.9 release and tag on Rickub. | ||
| 11 | +3. Then set `TAG` to `v1.2.0` (or the next version) for the real release. | ||
| 12 | + | ||
| 13 | +## Watch out for | ||
| 14 | + | ||
| 15 | +- The `.dmg` step (`wails3 tool package`, same flags as the old guide's B5) and the hardened runtime without entitlements are untested here; if the signed app fails to start, see "Variants" in the signing guide (entitlements). | ||
| 16 | +- `.ci.cd.token.env` was copied from mini-me: if step 03 answers 401/403, make a token for this repo. | ||
| 17 | +- Test tag v9.9.9 + upload branch `local-ci-publish-v9.9.9`: if a run dies, delete the branch by hand. | ||
modified
.memory/history.md +10 -0 | @@ -197,3 +197,13 @@ | ||
| 197 | 197 | ## 2026-10-30 — v0.1 closed |
| 198 | 198 | |
| 199 | 199 | - Owner closed the milestone: #33, #35, #36, #37 closed (closing comments; #36 records the final release scope — macOS arm64, Windows amd64/arm64, no Linux, manual attach, no CI); #34 closed with tasks 1–3 closed (guide written) and task 4 (results report) left open, the report not having been posted. Milestone "v0.1 · Première release" closed in `.tickets/milestones.yaml`. |
| 200 | + | |
| 201 | +## 2026-11-08 — Local CI (replaces the Release workflow) | |
| 202 | + | |
| 203 | +- Asked: same principle as mini-me (local CI, temporary upload branch, `.release.env` / `.ci.cd.token.env`, test release v9.9.9), plus the signed and notarized macOS `.dmg`. Main saved as `save-20261108`. | |
| 204 | +- Done: `local-ci-00…06-*.sh` at the root (copied from mini-me, adapted); `local-ci-02-build.sh` runs `scripts/build-release.sh`, then signs/notarizes/staples the app, rebuilds the `.dmg` from the stapled app (`wails3 tool package`), signs/notarizes/staples it, and stages `release/<TAG>/` with a new `SHA256SUMS`. `local-ci-03` rebuilds the notes the old workflow produced. `.github` → `.github.bak` (staged `git mv`); `scripts/tag-release.sh` and its test removed; Makefile `release-tag` → `release-check`, `release-package`; RELEASING (EN/FR), publish-a-release, commands reference, signing guides updated. `.gitignore`: `*.env`, `release/`. | |
| 205 | +- Decision: files are named after `info.version` (package.sh), so TAG may differ from it only for `v9.9.9*` (test); otherwise TAG must be `v<version>`. Rejected: bumping the version for the test. | |
| 206 | +- `.ci.cd.token.env` copied from mini-me (same user); unknown whether that token has rights on bots-garden/sidekicks. | |
| 207 | +- Verified (Linux sandbox): `bash -n`, `check-license-headers.sh`, `package_test.sh`, notes generation of step 03. NOT verified: everything that needs the Mac (codesign, notarytool, wails3, dmg), and the Rickub API/upload steps. Nothing committed. | |
| 208 | +- Follow-up (owner: LSMinimumSystemVersion should be automatic and documented): `scripts/sync-build-assets.sh [--check]` runs `wails3 task common:update:build-assets`, puts 13.0.0 back in both Info.plist (sed, tested on a copy: round trip identical) and verifies versions; `local-ci-02-build.sh` runs it and stops if tracked build/ files changed. Docs: how-to `set-the-version` / `definir-la-version`, RELEASING, reference. Not run with wails3 (absent in the Linux sandbox); `--check` passes on the current tree. | |
| 209 | +- Follow-up: temporary FR-only guide `docs/fr/how-to/tester-la-ci-locale.md` (test of the local CI with v9.9.9, to delete once the method is proven). Not followed on the Mac yet. | |
| @@ -197,3 +197,13 @@ | |||
| 197 | ## 2026-10-30 — v0.1 closed | 197 | ## 2026-10-30 — v0.1 closed |
| 198 | 198 | ||
| 199 | - Owner closed the milestone: #33, #35, #36, #37 closed (closing comments; #36 records the final release scope — macOS arm64, Windows amd64/arm64, no Linux, manual attach, no CI); #34 closed with tasks 1–3 closed (guide written) and task 4 (results report) left open, the report not having been posted. Milestone "v0.1 · Première release" closed in `.tickets/milestones.yaml`. | 199 | - Owner closed the milestone: #33, #35, #36, #37 closed (closing comments; #36 records the final release scope — macOS arm64, Windows amd64/arm64, no Linux, manual attach, no CI); #34 closed with tasks 1–3 closed (guide written) and task 4 (results report) left open, the report not having been posted. Milestone "v0.1 · Première release" closed in `.tickets/milestones.yaml`. |
| 200 | + | ||
| 201 | +## 2026-11-08 — Local CI (replaces the Release workflow) | ||
| 202 | + | ||
| 203 | +- Asked: same principle as mini-me (local CI, temporary upload branch, `.release.env` / `.ci.cd.token.env`, test release v9.9.9), plus the signed and notarized macOS `.dmg`. Main saved as `save-20261108`. | ||
| 204 | +- Done: `local-ci-00…06-*.sh` at the root (copied from mini-me, adapted); `local-ci-02-build.sh` runs `scripts/build-release.sh`, then signs/notarizes/staples the app, rebuilds the `.dmg` from the stapled app (`wails3 tool package`), signs/notarizes/staples it, and stages `release/<TAG>/` with a new `SHA256SUMS`. `local-ci-03` rebuilds the notes the old workflow produced. `.github` → `.github.bak` (staged `git mv`); `scripts/tag-release.sh` and its test removed; Makefile `release-tag` → `release-check`, `release-package`; RELEASING (EN/FR), publish-a-release, commands reference, signing guides updated. `.gitignore`: `*.env`, `release/`. | ||
| 205 | +- Decision: files are named after `info.version` (package.sh), so TAG may differ from it only for `v9.9.9*` (test); otherwise TAG must be `v<version>`. Rejected: bumping the version for the test. | ||
| 206 | +- `.ci.cd.token.env` copied from mini-me (same user); unknown whether that token has rights on bots-garden/sidekicks. | ||
| 207 | +- Verified (Linux sandbox): `bash -n`, `check-license-headers.sh`, `package_test.sh`, notes generation of step 03. NOT verified: everything that needs the Mac (codesign, notarytool, wails3, dmg), and the Rickub API/upload steps. Nothing committed. | ||
| 208 | +- Follow-up (owner: LSMinimumSystemVersion should be automatic and documented): `scripts/sync-build-assets.sh [--check]` runs `wails3 task common:update:build-assets`, puts 13.0.0 back in both Info.plist (sed, tested on a copy: round trip identical) and verifies versions; `local-ci-02-build.sh` runs it and stops if tracked build/ files changed. Docs: how-to `set-the-version` / `definir-la-version`, RELEASING, reference. Not run with wails3 (absent in the Linux sandbox); `--check` passes on the current tree. | ||
| 209 | +- Follow-up: temporary FR-only guide `docs/fr/how-to/tester-la-ci-locale.md` (test of the local CI with v9.9.9, to delete once the method is proven). Not followed on the Mac yet. | ||
modified
.memory/summary.md +1 -1 | @@ -15,7 +15,7 @@ What exists: | ||
| 15 | 15 | |
| 16 | 16 | - `main.go` (root, only Wails importer; registers 11 typed events; injects the native file dialog; its emitter ignores events sent before the Wails app exists) · `internal/app` (Core, AgentService, ChannelService, ConfigService; opens the history per config file) · `internal/channels` (routing, sessions, context, queue, permissions) · `internal/store` (Pebble) · `internal/workspace` (Local, Container, Terminals; contract tests local + alpine container) · `internal/agents` · `internal/acp` (sessions, readable AgentError, stdin→TERM→KILL) · `internal/config` (+ `WatchWithReady`, `AppendAgent` keeps comments and unescapes emoji) · `internal/prefs` · `internal/events` · `internal/shellpath` · `schema`. |
| 17 | 17 | - `frontend/`: shell + panel registry, `state.svelte.ts` (`appState`, one ordered frame batcher for message events), `lib/chat/*` (Markdown, MessageView, ToolCallCard, PermissionCard, Composer), `lib/settings/ConfigEditor.svelte`, `lib/i18n` (en/fr catalogue, `t()`), pure modules with vitest (`markdown`, `conversation`, `composer`, `suggestions`, `tools`, `yamlSchema`, `events`, `theme`, `panels/registry`). State is keyed by channel id; a `$derived` must never call `conversationOf` (it writes state → `state_unsafe_mutation` freezes the UI). |
| 18 | -- Tooling: `Makefile`, golangci-lint (`tools/go.mod`), no CI (owner's choice: checks run locally, `make verify`; `make check-linux` runs `make check` in the Linux Docker image), `scripts/agents.sh`, `scripts/install-test-config.sh`, `scripts/check-license-headers.sh`, `scripts/package.sh` (+ `package_test.sh`), `scripts/build-release.sh`, `scripts/tag-release.sh` (+ `tag-release_test.sh`), `scripts/linux-packages.Dockerfile`, `scripts/check-linux.sh`, release workflow (tag push → release) `.github/workflows/release.yml`. | |
| 18 | +- Tooling: `Makefile`, golangci-lint (`tools/go.mod`), no hosted CI (owner's choice: checks run locally, `make verify`; releases by the local CI `local-ci-*.sh` + `.release.env`/`.ci.cd.token.env`, see RELEASING.md — the old workflow is `.github.bak/`; `make check-linux` runs `make check` in the Linux Docker image), `scripts/agents.sh`, `scripts/install-test-config.sh`, `scripts/check-license-headers.sh`, `scripts/package.sh` (+ `package_test.sh`), `scripts/build-release.sh`, `scripts/tag-release.sh` (+ `tag-release_test.sh`), `scripts/linux-packages.Dockerfile`, `scripts/check-linux.sh`, release workflow (tag push → release) `.github/workflows/release.yml`. | |
| 19 | 19 | |
| 20 | 20 | ## Decisions in force |
| 21 | 21 | |
| @@ -15,7 +15,7 @@ What exists: | |||
| 15 | 15 | ||
| 16 | - `main.go` (root, only Wails importer; registers 11 typed events; injects the native file dialog; its emitter ignores events sent before the Wails app exists) · `internal/app` (Core, AgentService, ChannelService, ConfigService; opens the history per config file) · `internal/channels` (routing, sessions, context, queue, permissions) · `internal/store` (Pebble) · `internal/workspace` (Local, Container, Terminals; contract tests local + alpine container) · `internal/agents` · `internal/acp` (sessions, readable AgentError, stdin→TERM→KILL) · `internal/config` (+ `WatchWithReady`, `AppendAgent` keeps comments and unescapes emoji) · `internal/prefs` · `internal/events` · `internal/shellpath` · `schema`. | 16 | - `main.go` (root, only Wails importer; registers 11 typed events; injects the native file dialog; its emitter ignores events sent before the Wails app exists) · `internal/app` (Core, AgentService, ChannelService, ConfigService; opens the history per config file) · `internal/channels` (routing, sessions, context, queue, permissions) · `internal/store` (Pebble) · `internal/workspace` (Local, Container, Terminals; contract tests local + alpine container) · `internal/agents` · `internal/acp` (sessions, readable AgentError, stdin→TERM→KILL) · `internal/config` (+ `WatchWithReady`, `AppendAgent` keeps comments and unescapes emoji) · `internal/prefs` · `internal/events` · `internal/shellpath` · `schema`. |
| 17 | - `frontend/`: shell + panel registry, `state.svelte.ts` (`appState`, one ordered frame batcher for message events), `lib/chat/*` (Markdown, MessageView, ToolCallCard, PermissionCard, Composer), `lib/settings/ConfigEditor.svelte`, `lib/i18n` (en/fr catalogue, `t()`), pure modules with vitest (`markdown`, `conversation`, `composer`, `suggestions`, `tools`, `yamlSchema`, `events`, `theme`, `panels/registry`). State is keyed by channel id; a `$derived` must never call `conversationOf` (it writes state → `state_unsafe_mutation` freezes the UI). | 17 | - `frontend/`: shell + panel registry, `state.svelte.ts` (`appState`, one ordered frame batcher for message events), `lib/chat/*` (Markdown, MessageView, ToolCallCard, PermissionCard, Composer), `lib/settings/ConfigEditor.svelte`, `lib/i18n` (en/fr catalogue, `t()`), pure modules with vitest (`markdown`, `conversation`, `composer`, `suggestions`, `tools`, `yamlSchema`, `events`, `theme`, `panels/registry`). State is keyed by channel id; a `$derived` must never call `conversationOf` (it writes state → `state_unsafe_mutation` freezes the UI). |
| 18 | -- Tooling: `Makefile`, golangci-lint (`tools/go.mod`), no CI (owner's choice: checks run locally, `make verify`; `make check-linux` runs `make check` in the Linux Docker image), `scripts/agents.sh`, `scripts/install-test-config.sh`, `scripts/check-license-headers.sh`, `scripts/package.sh` (+ `package_test.sh`), `scripts/build-release.sh`, `scripts/tag-release.sh` (+ `tag-release_test.sh`), `scripts/linux-packages.Dockerfile`, `scripts/check-linux.sh`, release workflow (tag push → release) `.github/workflows/release.yml`. | 18 | +- Tooling: `Makefile`, golangci-lint (`tools/go.mod`), no hosted CI (owner's choice: checks run locally, `make verify`; releases by the local CI `local-ci-*.sh` + `.release.env`/`.ci.cd.token.env`, see RELEASING.md — the old workflow is `.github.bak/`; `make check-linux` runs `make check` in the Linux Docker image), `scripts/agents.sh`, `scripts/install-test-config.sh`, `scripts/check-license-headers.sh`, `scripts/package.sh` (+ `package_test.sh`), `scripts/build-release.sh`, `scripts/tag-release.sh` (+ `tag-release_test.sh`), `scripts/linux-packages.Dockerfile`, `scripts/check-linux.sh`, release workflow (tag push → release) `.github/workflows/release.yml`. |
| 19 | 19 | ||
| 20 | ## Decisions in force | 20 | ## Decisions in force |
| 21 | 21 | ||
modified
Makefile +8 -6 | @@ -6,7 +6,7 @@ | ||
| 6 | 6 | GOLANGCI_LINT := go tool -modfile=tools/go.mod golangci-lint |
| 7 | 7 | PNPM := pnpm --dir frontend |
| 8 | 8 | |
| 9 | -.PHONY: help install bindings frontend dev build package package-linux package-windows package-macos release-build release-tag install-test-config \ | |
| 9 | +.PHONY: help install bindings frontend dev build package package-linux package-windows package-macos release-build release-check release-package install-test-config \ | |
| 10 | 10 | check verify check-linux test test-go test-frontend test-scripts test-real \ |
| 11 | 11 | lint lint-go lint-frontend lint-headers bindings-check |
| 12 | 12 | |
| @@ -47,11 +47,14 @@ package-windows: ## Release packages for Windows amd64 and arm64 (installer, zip | ||
| 47 | 47 | package-macos: ## Release packages for macOS on Apple Silicon (dmg, zip) into dist/; on macOS only |
| 48 | 48 | @scripts/package.sh macos |
| 49 | 49 | |
| 50 | -release-build: ## On the Mac: every release package (macOS arm64, Windows amd64 and arm64) and SHA256SUMS into dist/ | |
| 50 | +release-build: ## On the Mac: every unsigned release package (macOS arm64, Windows amd64 and arm64) and SHA256SUMS into dist/ | |
| 51 | 51 | @scripts/build-release.sh |
| 52 | 52 | |
| 53 | -release-tag: ## Tag v<version> on main and push it: the Release workflow creates the release | |
| 54 | - @scripts/tag-release.sh | |
| 53 | +release-check: ## Local CI, step 1: make verify (see RELEASING.md) | |
| 54 | + @./local-ci-01-check.sh | |
| 55 | + | |
| 56 | +release-package: ## Local CI, step 2: build, sign and notarize into release/<TAG>/ | |
| 57 | + @./local-ci-02-build.sh | |
| 55 | 58 | |
| 56 | 59 | install-test-config: ## Write the test agents configuration at the default location (absolute paths) |
| 57 | 60 | @scripts/install-test-config.sh |
| @@ -78,8 +81,7 @@ test-scripts: ## Tests of the shell tooling | ||
| 78 | 81 | @scripts/agents_test.sh |
| 79 | 82 | @scripts/check-license-headers_test.sh |
| 80 | 83 | @scripts/package_test.sh |
| 81 | - @scripts/tag-release_test.sh | |
| 82 | - | |
| 84 | + | |
| 83 | 85 | test-real: ## Tests against the real mm agents (needs mm and llmman; 2 agents at most) |
| 84 | 86 | @go test -tags realagents -count=1 ./... |
| 85 | 87 | |
| @@ -6,7 +6,7 @@ | |||
| 6 | GOLANGCI_LINT := go tool -modfile=tools/go.mod golangci-lint | 6 | GOLANGCI_LINT := go tool -modfile=tools/go.mod golangci-lint |
| 7 | PNPM := pnpm --dir frontend | 7 | PNPM := pnpm --dir frontend |
| 8 | 8 | ||
| 9 | -.PHONY: help install bindings frontend dev build package package-linux package-windows package-macos release-build release-tag install-test-config \ | 9 | +.PHONY: help install bindings frontend dev build package package-linux package-windows package-macos release-build release-check release-package install-test-config \ |
| 10 | check verify check-linux test test-go test-frontend test-scripts test-real \ | 10 | check verify check-linux test test-go test-frontend test-scripts test-real \ |
| 11 | lint lint-go lint-frontend lint-headers bindings-check | 11 | lint lint-go lint-frontend lint-headers bindings-check |
| 12 | 12 | ||
| @@ -47,11 +47,14 @@ package-windows: ## Release packages for Windows amd64 and arm64 (installer, zip | |||
| 47 | package-macos: ## Release packages for macOS on Apple Silicon (dmg, zip) into dist/; on macOS only | 47 | package-macos: ## Release packages for macOS on Apple Silicon (dmg, zip) into dist/; on macOS only |
| 48 | @scripts/package.sh macos | 48 | @scripts/package.sh macos |
| 49 | 49 | ||
| 50 | -release-build: ## On the Mac: every release package (macOS arm64, Windows amd64 and arm64) and SHA256SUMS into dist/ | 50 | +release-build: ## On the Mac: every unsigned release package (macOS arm64, Windows amd64 and arm64) and SHA256SUMS into dist/ |
| 51 | @scripts/build-release.sh | 51 | @scripts/build-release.sh |
| 52 | 52 | ||
| 53 | -release-tag: ## Tag v<version> on main and push it: the Release workflow creates the release | 53 | +release-check: ## Local CI, step 1: make verify (see RELEASING.md) |
| 54 | - @scripts/tag-release.sh | 54 | + @./local-ci-01-check.sh |
| 55 | + | ||
| 56 | +release-package: ## Local CI, step 2: build, sign and notarize into release/<TAG>/ | ||
| 57 | + @./local-ci-02-build.sh | ||
| 55 | 58 | ||
| 56 | install-test-config: ## Write the test agents configuration at the default location (absolute paths) | 59 | install-test-config: ## Write the test agents configuration at the default location (absolute paths) |
| 57 | @scripts/install-test-config.sh | 60 | @scripts/install-test-config.sh |
| @@ -78,8 +81,7 @@ test-scripts: ## Tests of the shell tooling | |||
| 78 | @scripts/agents_test.sh | 81 | @scripts/agents_test.sh |
| 79 | @scripts/check-license-headers_test.sh | 82 | @scripts/check-license-headers_test.sh |
| 80 | @scripts/package_test.sh | 83 | @scripts/package_test.sh |
| 81 | - @scripts/tag-release_test.sh | 84 | + |
| 82 | - | ||
| 83 | test-real: ## Tests against the real mm agents (needs mm and llmman; 2 agents at most) | 85 | test-real: ## Tests against the real mm agents (needs mm and llmman; 2 agents at most) |
| 84 | @go test -tags realagents -count=1 ./... | 86 | @go test -tags realagents -count=1 ./... |
| 85 | 87 | ||
modified
RELEASING.fr.md +35 -42 | @@ -1,72 +1,65 @@ | ||
| 1 | -# Publier une version de Sidekicks | |
| 1 | +# Publier une release de Sidekicks | |
| 2 | 2 | |
| 3 | 3 | [English](RELEASING.md) |
| 4 | 4 | |
| 5 | -Trois étapes, sur le Mac : tout construire, tagger, attacher les fichiers ; puis ramener le tag dans chaque copie du dépôt. | |
| 5 | +Il n'y a plus de workflow CI : tout se passe sur le Mac, avec les scripts `local-ci-*.sh` à la racine du dépôt. Ils construisent, signent et notarisent les paquets macOS, créent une release brouillon sur Rickub, y envoient les fichiers par une branche temporaire (Rickub n'accepte les envois que du jeton d'un job CI), puis publient. | |
| 6 | 6 | |
| 7 | 7 | | Étape | Commande | Résultat | |
| 8 | 8 | | --- | --- | --- | |
| 9 | -| 1. Construire | `make release-build` | `dist/` : les paquets macOS (Apple Silicon) et Windows (x86-64 et Arm), et `SHA256SUMS` | | |
| 10 | -| 2. Tagger | `make release-tag` | le tag `v<version>` est poussé ; le workflow **Release** crée la release sur Rickub, avec ses notes | | |
| 11 | -| 3. Attacher | à la main, sur la page de la release | tous les fichiers de `dist/` attachés à la release | | |
| 12 | -| 4. Après | `git fetch --tags` | le tag `v<version>` est dans chaque copie du dépôt | | |
| 9 | +| 1. Vérifier | `./local-ci-01-check.sh` (`make release-check`) | `make verify` : lint, tests, bindings | | |
| 10 | +| 2. Construire | `./local-ci-02-build.sh` (`make release-package`) | `release/<TAG>/` : les paquets macOS (Apple Silicon, signés et notarisés) et Windows (x86-64 et Arm), `SHA256SUMS` | | |
| 11 | +| 3. Brouillon | `./local-ci-03-create-draft.sh` | le tag et une **préversion en brouillon** sur Rickub, avec ses notes | | |
| 12 | +| 4. Envoyer | `./local-ci-04-upload.sh` | les fichiers sont sur le brouillon (branche temporaire, supprimée ensuite) | | |
| 13 | +| 5. Publier | `./local-ci-05-publish.sh` | le brouillon devient public (demande de taper le tag), le public est téléchargé et comparé | | |
| 14 | +| 6. Promouvoir | `./local-ci-06-promote.sh` | facultatif : la préversion devient une release (demande de taper le tag) | | |
| 13 | 15 | |
| 14 | -La version est `info.version` dans `build/config.yml` ; le tag est `v` + cette version. | |
| 16 | +## Réglages | |
| 15 | 17 | |
| 16 | -## Avant : fixer la version | |
| 18 | +Deux fichiers à la racine, ignorés par git (`*.env`) : | |
| 17 | 19 | |
| 18 | -1. Dans `build/config.yml`, réglez `info.version` (par exemple `"0.2.0"`). | |
| 19 | -2. `wails3 task common:update:build-assets`, puis remettez `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `build/darwin/Info.dev.plist` (la commande le remet à `12.0.0`). | |
| 20 | -3. Écrivez les nouveautés dans `docs/release-notes/v<version>.md` (et `v<version>.fr.md`) : le workflow **Release** met la version anglaise sur la page de la release, sous les fichiers. | |
| 21 | -4. `make verify` ([vérifications avant de fusionner](docs/fr/how-to/verifier-avant-de-fusionner.md)), commitez, fusionnez dans `main`, puis `git checkout main && git pull`. | |
| 20 | +- `.release.env` : `TAG`, `ABOUT`, `OWNER`, `REPO`, et la signature macOS, `SIGN_IDENTITY` et `NOTARY_PROFILE` (par défaut `$SIDEKICKS_SIGN_IDENTITY` et `$SIDEKICKS_NOTARY_PROFILE`, [partie A du guide de signature](docs/fr/how-to/signer-et-notariser-sous-macos.md)). `SIGN_IDENTITY` vide : les paquets macOS ne sont pas signés. | |
| 21 | +- `.ci.cd.token.env` : `CI_TOKEN`, le jeton qui parle à Rickub. Il n'apparaît jamais sur une ligne de commande. | |
| 22 | 22 | |
| 23 | -## 1. Construire | |
| 23 | +`LOCAL_CI_ENV_FILE` pointe les scripts vers un autre fichier de réglages. | |
| 24 | 24 | |
| 25 | -```bash | |
| 26 | -make release-build | |
| 27 | -``` | |
| 25 | +## Tester d'abord avec v9.9.9 | |
| 28 | 26 | |
| 29 | -Il construit, dans `dist/` : | |
| 30 | - | |
| 31 | -| Fichiers | Comment | | |
| 32 | -| --- | --- | | |
| 33 | -| `Sidekicks-<v>-macos-arm64.dmg`, `.zip` | en natif, pour Apple Silicon seulement (outils en ligne de commande de Xcode) | | |
| 34 | -| `Sidekicks-<v>-windows-amd64-installer.exe`, `sidekicks_<v>_windows_amd64.zip` | compilés depuis le Mac (demande `brew install makensis`) | | |
| 35 | -| `Sidekicks-<v>-windows-arm64-installer.exe`, `sidekicks_<v>_windows_arm64.zip` | compilés depuis le Mac, pour Windows sur Arm | | |
| 36 | -| `SHA256SUMS` | sur tous les fichiers ci-dessus | | |
| 27 | +`TAG="v9.9.9"` dans `.release.env` est la release de test : le tag peut différer de la version de `build/config.yml` (les paquets gardent la vraie version dans leur nom). Lancez les étapes 1 à 5, vérifiez les téléchargements, puis supprimez la release et le tag sur Rickub. Tout autre tag doit être `v` + `info.version`. | |
| 37 | 28 | |
| 38 | -Pas de paquets Linux dans les releases pour le moment : `LINUX_ARCHES=amd64 make release-build` les construit aussi, dans Docker. `SKIP="windows"` (ou `macos`) laisse un système de côté ; `WINDOWS_ARCHES=amd64` ne construit qu'une architecture Windows. La liste des fichiers d'une release est `scripts/package.sh release-names`. | |
| 29 | +## Avant : fixer la version | |
| 39 | 30 | |
| 40 | -**Signature macOS** : avec le certificat Developer ID, signez et notarisez les paquets macOS maintenant, avant de tagger : [Signer et notariser Sidekicks pour macOS](docs/fr/how-to/signer-et-notariser-sous-macos.md), partie B. | |
| 31 | +1. Dans `build/config.yml`, fixez `info.version` (p. ex. `"0.2.0"`). | |
| 32 | +2. `scripts/sync-build-assets.sh` : régénère les Info.plist et les fichiers Windows et Linux à partir de celle-ci et remet `LSMinimumSystemVersion` à `13.0.0` (le générateur le remet à `12.0.0`). `local-ci-02-build.sh` le lance aussi et s'arrête s'il a changé quelque chose. Pourquoi : [Définir la version](docs/fr/how-to/definir-la-version.md). | |
| 33 | +3. Écrivez les nouveautés dans `docs/release-notes/v<version>.md` (et `v<version>.fr.md`) : les notes du brouillon reprennent la version anglaise, sous les liens d'installation. | |
| 34 | +4. Mettez `TAG="v<version>"` dans `.release.env`. | |
| 35 | +5. Commit, fusion dans `main`, push : l'étape 3 refuse un arbre de travail modifié, et un `HEAD` qui n'est pas le `main` distant. | |
| 41 | 36 | |
| 42 | -## 2. Tagger | |
| 37 | +## 2. Construire | |
| 43 | 38 | |
| 44 | -```bash | |
| 45 | -make release-tag | |
| 46 | -``` | |
| 39 | +`local-ci-02-build.sh` lance `scripts/build-release.sh` (dans `dist/`, non signé) puis, quand `SIGN_IDENTITY` est fixé, signe et notarise l'app, construit le `.dmg` à partir de l'app agrafée, le signe, le notarise et l'agrafe, et vérifie les deux avec `spctl`. Il range tout dans `release/<TAG>/` avec un nouveau `SHA256SUMS`. Comptez 10 à 20 minutes, surtout l'attente d'Apple. La signature se fait dans un dossier temporaire : un dossier synchronisé (kDrive, iCloud…) ne peut pas corrompre les signatures. | |
| 47 | 40 | |
| 48 | -Il refuse si la copie de travail a des modifications, si vous n'êtes pas sur `main`, si `main` diffère de `origin/main`, ou si le tag existe ; il avertit s'il manque un paquet dans `dist/`. Puis il crée le tag annoté `v<version>` et le pousse. Le push lance `.github/workflows/release.yml`, qui vérifie que le tag correspond à `build/config.yml` et crée la release avec des notes qui listent les fichiers attendus. | |
| 41 | +`SKIP="windows"` (ou `macos`) écarte un système ; `LINUX_ARCHES=amd64` ajoute les paquets Linux (dans Docker ; ils ne sont pas dans `release-names`, donc pas rangés). Le détail de la signature et les vérifications sur un autre Mac : [Signer et notariser Sidekicks sur macOS](docs/fr/how-to/signer-et-notariser-sous-macos.md). | |
| 49 | 42 | |
| 50 | -## 3. Attacher | |
| 43 | +## 3 à 6. Publier | |
| 51 | 44 | |
| 52 | -Ouvrez la release sur Rickub (**Releases → v<version>**) et attachez tous les fichiers de `dist/`, `SHA256SUMS` compris. | |
| 45 | +Les étapes 3 à 5 refusent d'avancer quand quelque chose cloche (pas de `SHA256SUMS`, release déjà publique, `HEAD` pas sur le `main` distant, `.github/workflows` encore sur `HEAD`). `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` affiche les notes sans rien créer. L'étape 5 prend la place de **dernière** version : `/releases/latest` pointe vers la nouvelle version pour tout le monde. | |
| 53 | 46 | |
| 54 | -## 4. Après : récupérer le tag | |
| 47 | +## Après : récupérer le tag | |
| 55 | 48 | |
| 56 | 49 | ```bash |
| 57 | 50 | git fetch --tags |
| 58 | -git tag --list 'v*' # v<version> apparaît | |
| 51 | +git tag --list 'v*' # v<version> est listé | |
| 59 | 52 | ``` |
| 60 | 53 | |
| 61 | -Dans chaque autre copie du dépôt (une autre machine, une sandbox, un clone fait avant la release), récupérez les tags : le tag a été poussé depuis le Mac, un simple `git pull` ne le ramène pas toujours, et `git describe`, `git log v<précédente>..v<version>` ou les notes de la release suivante en ont besoin. | |
| 54 | +Le tag est créé par Rickub : dans chaque copie du dépôt (celle-ci comprise), récupérez les tags. | |
| 62 | 55 | |
| 63 | -## En cas de problème | |
| 56 | +## Quand quelque chose se passe mal | |
| 64 | 57 | |
| 65 | 58 | | Symptôme | Que faire | |
| 66 | 59 | | --- | --- | |
| 67 | 60 | | `makensis is missing` | `brew install makensis` — ou `SKIP=windows`. | |
| 68 | -| `the tag v… already exists` | Cette version a déjà été publiée : augmentez `info.version`. | | |
| 69 | -| Le workflow a échoué : « The tag is … but build/config.yml says … » | Supprimez le tag (`git push origin :refs/tags/v…` et `git tag -d v…`), corrigez `info.version`, recommencez. | | |
| 70 | -| Le workflow a tourné mais aucune release n'est apparue | Le journal du job dit pourquoi (un `403` veut dire que le jeton n'a pas pu écrire : `permissions: contents: write` doit rester dans `release.yml`). Créez la release à la main sur Rickub depuis le tag ; les notes sont dans le journal du job. | | |
| 71 | - | |
| 72 | -Détails : [Publier une release](docs/fr/how-to/publier-une-release.md) · [référence des commandes](docs/fr/reference/commandes.md). | |
| 61 | +| `TAG is … but build/config.yml says …` | Corrigez `.release.env`, ou montez `info.version`. | | |
| 62 | +| `no valid identity` / le profil notarytool ne marche pas | Les commandes du message ; partie A du guide de signature. | | |
| 63 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"`. | | |
| 64 | +| `the release … already exists` (409) | Supprimez la release et son tag sur Rickub, ou montez la version. | | |
| 65 | +| Le job d'envoi échoue ou dépasse le délai | Le script affiche les lignes du journal du job ; la branche `local-ci-publish-<TAG>` est supprimée quand même (sinon, supprimez-la à la main). | | |
| @@ -1,72 +1,65 @@ | |||
| 1 | -# Publier une version de Sidekicks | 1 | +# Publier une release de Sidekicks |
| 2 | 2 | ||
| 3 | [English](RELEASING.md) | 3 | [English](RELEASING.md) |
| 4 | 4 | ||
| 5 | -Trois étapes, sur le Mac : tout construire, tagger, attacher les fichiers ; puis ramener le tag dans chaque copie du dépôt. | 5 | +Il n'y a plus de workflow CI : tout se passe sur le Mac, avec les scripts `local-ci-*.sh` à la racine du dépôt. Ils construisent, signent et notarisent les paquets macOS, créent une release brouillon sur Rickub, y envoient les fichiers par une branche temporaire (Rickub n'accepte les envois que du jeton d'un job CI), puis publient. |
| 6 | 6 | ||
| 7 | | Étape | Commande | Résultat | | 7 | | Étape | Commande | Résultat | |
| 8 | | --- | --- | --- | | 8 | | --- | --- | --- | |
| 9 | -| 1. Construire | `make release-build` | `dist/` : les paquets macOS (Apple Silicon) et Windows (x86-64 et Arm), et `SHA256SUMS` | | 9 | +| 1. Vérifier | `./local-ci-01-check.sh` (`make release-check`) | `make verify` : lint, tests, bindings | |
| 10 | -| 2. Tagger | `make release-tag` | le tag `v<version>` est poussé ; le workflow **Release** crée la release sur Rickub, avec ses notes | | 10 | +| 2. Construire | `./local-ci-02-build.sh` (`make release-package`) | `release/<TAG>/` : les paquets macOS (Apple Silicon, signés et notarisés) et Windows (x86-64 et Arm), `SHA256SUMS` | |
| 11 | -| 3. Attacher | à la main, sur la page de la release | tous les fichiers de `dist/` attachés à la release | | 11 | +| 3. Brouillon | `./local-ci-03-create-draft.sh` | le tag et une **préversion en brouillon** sur Rickub, avec ses notes | |
| 12 | -| 4. Après | `git fetch --tags` | le tag `v<version>` est dans chaque copie du dépôt | | 12 | +| 4. Envoyer | `./local-ci-04-upload.sh` | les fichiers sont sur le brouillon (branche temporaire, supprimée ensuite) | |
| 13 | +| 5. Publier | `./local-ci-05-publish.sh` | le brouillon devient public (demande de taper le tag), le public est téléchargé et comparé | | ||
| 14 | +| 6. Promouvoir | `./local-ci-06-promote.sh` | facultatif : la préversion devient une release (demande de taper le tag) | | ||
| 13 | 15 | ||
| 14 | -La version est `info.version` dans `build/config.yml` ; le tag est `v` + cette version. | 16 | +## Réglages |
| 15 | 17 | ||
| 16 | -## Avant : fixer la version | 18 | +Deux fichiers à la racine, ignorés par git (`*.env`) : |
| 17 | 19 | ||
| 18 | -1. Dans `build/config.yml`, réglez `info.version` (par exemple `"0.2.0"`). | 20 | +- `.release.env` : `TAG`, `ABOUT`, `OWNER`, `REPO`, et la signature macOS, `SIGN_IDENTITY` et `NOTARY_PROFILE` (par défaut `$SIDEKICKS_SIGN_IDENTITY` et `$SIDEKICKS_NOTARY_PROFILE`, [partie A du guide de signature](docs/fr/how-to/signer-et-notariser-sous-macos.md)). `SIGN_IDENTITY` vide : les paquets macOS ne sont pas signés. |
| 19 | -2. `wails3 task common:update:build-assets`, puis remettez `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `build/darwin/Info.dev.plist` (la commande le remet à `12.0.0`). | 21 | +- `.ci.cd.token.env` : `CI_TOKEN`, le jeton qui parle à Rickub. Il n'apparaît jamais sur une ligne de commande. |
| 20 | -3. Écrivez les nouveautés dans `docs/release-notes/v<version>.md` (et `v<version>.fr.md`) : le workflow **Release** met la version anglaise sur la page de la release, sous les fichiers. | ||
| 21 | -4. `make verify` ([vérifications avant de fusionner](docs/fr/how-to/verifier-avant-de-fusionner.md)), commitez, fusionnez dans `main`, puis `git checkout main && git pull`. | ||
| 22 | 22 | ||
| 23 | -## 1. Construire | 23 | +`LOCAL_CI_ENV_FILE` pointe les scripts vers un autre fichier de réglages. |
| 24 | 24 | ||
| 25 | -```bash | 25 | +## Tester d'abord avec v9.9.9 |
| 26 | -make release-build | ||
| 27 | -``` | ||
| 28 | 26 | ||
| 29 | -Il construit, dans `dist/` : | 27 | +`TAG="v9.9.9"` dans `.release.env` est la release de test : le tag peut différer de la version de `build/config.yml` (les paquets gardent la vraie version dans leur nom). Lancez les étapes 1 à 5, vérifiez les téléchargements, puis supprimez la release et le tag sur Rickub. Tout autre tag doit être `v` + `info.version`. |
| 30 | - | ||
| 31 | -| Fichiers | Comment | | ||
| 32 | -| --- | --- | | ||
| 33 | -| `Sidekicks-<v>-macos-arm64.dmg`, `.zip` | en natif, pour Apple Silicon seulement (outils en ligne de commande de Xcode) | | ||
| 34 | -| `Sidekicks-<v>-windows-amd64-installer.exe`, `sidekicks_<v>_windows_amd64.zip` | compilés depuis le Mac (demande `brew install makensis`) | | ||
| 35 | -| `Sidekicks-<v>-windows-arm64-installer.exe`, `sidekicks_<v>_windows_arm64.zip` | compilés depuis le Mac, pour Windows sur Arm | | ||
| 36 | -| `SHA256SUMS` | sur tous les fichiers ci-dessus | | ||
| 37 | 28 | ||
| 38 | -Pas de paquets Linux dans les releases pour le moment : `LINUX_ARCHES=amd64 make release-build` les construit aussi, dans Docker. `SKIP="windows"` (ou `macos`) laisse un système de côté ; `WINDOWS_ARCHES=amd64` ne construit qu'une architecture Windows. La liste des fichiers d'une release est `scripts/package.sh release-names`. | 29 | +## Avant : fixer la version |
| 39 | 30 | ||
| 40 | -**Signature macOS** : avec le certificat Developer ID, signez et notarisez les paquets macOS maintenant, avant de tagger : [Signer et notariser Sidekicks pour macOS](docs/fr/how-to/signer-et-notariser-sous-macos.md), partie B. | 31 | +1. Dans `build/config.yml`, fixez `info.version` (p. ex. `"0.2.0"`). |
| 32 | +2. `scripts/sync-build-assets.sh` : régénère les Info.plist et les fichiers Windows et Linux à partir de celle-ci et remet `LSMinimumSystemVersion` à `13.0.0` (le générateur le remet à `12.0.0`). `local-ci-02-build.sh` le lance aussi et s'arrête s'il a changé quelque chose. Pourquoi : [Définir la version](docs/fr/how-to/definir-la-version.md). | ||
| 33 | +3. Écrivez les nouveautés dans `docs/release-notes/v<version>.md` (et `v<version>.fr.md`) : les notes du brouillon reprennent la version anglaise, sous les liens d'installation. | ||
| 34 | +4. Mettez `TAG="v<version>"` dans `.release.env`. | ||
| 35 | +5. Commit, fusion dans `main`, push : l'étape 3 refuse un arbre de travail modifié, et un `HEAD` qui n'est pas le `main` distant. | ||
| 41 | 36 | ||
| 42 | -## 2. Tagger | 37 | +## 2. Construire |
| 43 | 38 | ||
| 44 | -```bash | 39 | +`local-ci-02-build.sh` lance `scripts/build-release.sh` (dans `dist/`, non signé) puis, quand `SIGN_IDENTITY` est fixé, signe et notarise l'app, construit le `.dmg` à partir de l'app agrafée, le signe, le notarise et l'agrafe, et vérifie les deux avec `spctl`. Il range tout dans `release/<TAG>/` avec un nouveau `SHA256SUMS`. Comptez 10 à 20 minutes, surtout l'attente d'Apple. La signature se fait dans un dossier temporaire : un dossier synchronisé (kDrive, iCloud…) ne peut pas corrompre les signatures. |
| 45 | -make release-tag | ||
| 46 | -``` | ||
| 47 | 40 | ||
| 48 | -Il refuse si la copie de travail a des modifications, si vous n'êtes pas sur `main`, si `main` diffère de `origin/main`, ou si le tag existe ; il avertit s'il manque un paquet dans `dist/`. Puis il crée le tag annoté `v<version>` et le pousse. Le push lance `.github/workflows/release.yml`, qui vérifie que le tag correspond à `build/config.yml` et crée la release avec des notes qui listent les fichiers attendus. | 41 | +`SKIP="windows"` (ou `macos`) écarte un système ; `LINUX_ARCHES=amd64` ajoute les paquets Linux (dans Docker ; ils ne sont pas dans `release-names`, donc pas rangés). Le détail de la signature et les vérifications sur un autre Mac : [Signer et notariser Sidekicks sur macOS](docs/fr/how-to/signer-et-notariser-sous-macos.md). |
| 49 | 42 | ||
| 50 | -## 3. Attacher | 43 | +## 3 à 6. Publier |
| 51 | 44 | ||
| 52 | -Ouvrez la release sur Rickub (**Releases → v<version>**) et attachez tous les fichiers de `dist/`, `SHA256SUMS` compris. | 45 | +Les étapes 3 à 5 refusent d'avancer quand quelque chose cloche (pas de `SHA256SUMS`, release déjà publique, `HEAD` pas sur le `main` distant, `.github/workflows` encore sur `HEAD`). `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` affiche les notes sans rien créer. L'étape 5 prend la place de **dernière** version : `/releases/latest` pointe vers la nouvelle version pour tout le monde. |
| 53 | 46 | ||
| 54 | -## 4. Après : récupérer le tag | 47 | +## Après : récupérer le tag |
| 55 | 48 | ||
| 56 | ```bash | 49 | ```bash |
| 57 | git fetch --tags | 50 | git fetch --tags |
| 58 | -git tag --list 'v*' # v<version> apparaît | 51 | +git tag --list 'v*' # v<version> est listé |
| 59 | ``` | 52 | ``` |
| 60 | 53 | ||
| 61 | -Dans chaque autre copie du dépôt (une autre machine, une sandbox, un clone fait avant la release), récupérez les tags : le tag a été poussé depuis le Mac, un simple `git pull` ne le ramène pas toujours, et `git describe`, `git log v<précédente>..v<version>` ou les notes de la release suivante en ont besoin. | 54 | +Le tag est créé par Rickub : dans chaque copie du dépôt (celle-ci comprise), récupérez les tags. |
| 62 | 55 | ||
| 63 | -## En cas de problème | 56 | +## Quand quelque chose se passe mal |
| 64 | 57 | ||
| 65 | | Symptôme | Que faire | | 58 | | Symptôme | Que faire | |
| 66 | | --- | --- | | 59 | | --- | --- | |
| 67 | | `makensis is missing` | `brew install makensis` — ou `SKIP=windows`. | | 60 | | `makensis is missing` | `brew install makensis` — ou `SKIP=windows`. | |
| 68 | -| `the tag v… already exists` | Cette version a déjà été publiée : augmentez `info.version`. | | 61 | +| `TAG is … but build/config.yml says …` | Corrigez `.release.env`, ou montez `info.version`. | |
| 69 | -| Le workflow a échoué : « The tag is … but build/config.yml says … » | Supprimez le tag (`git push origin :refs/tags/v…` et `git tag -d v…`), corrigez `info.version`, recommencez. | | 62 | +| `no valid identity` / le profil notarytool ne marche pas | Les commandes du message ; partie A du guide de signature. | |
| 70 | -| Le workflow a tourné mais aucune release n'est apparue | Le journal du job dit pourquoi (un `403` veut dire que le jeton n'a pas pu écrire : `permissions: contents: write` doit rester dans `release.yml`). Créez la release à la main sur Rickub depuis le tag ; les notes sont dans le journal du job. | | 63 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"`. | |
| 71 | - | 64 | +| `the release … already exists` (409) | Supprimez la release et son tag sur Rickub, ou montez la version. | |
| 72 | -Détails : [Publier une release](docs/fr/how-to/publier-une-release.md) · [référence des commandes](docs/fr/reference/commandes.md). | 65 | +| Le job d'envoi échoue ou dépasse le délai | Le script affiche les lignes du journal du job ; la branche `local-ci-publish-<TAG>` est supprimée quand même (sinon, supprimez-la à la main). | |
modified
RELEASING.md +32 -39 | @@ -2,71 +2,64 @@ | ||
| 2 | 2 | |
| 3 | 3 | [Français](RELEASING.fr.md) |
| 4 | 4 | |
| 5 | -Three steps, on the Mac: build everything, tag, attach the files; then bring the tag back to every copy of the repository. | |
| 5 | +There is no CI workflow any more: everything runs on the Mac, with the `local-ci-*.sh` scripts at the root of the repository. They build, sign and notarize the macOS packages, create a draft release on Rickub, upload the files through a temporary branch (Rickub only accepts uploads from a CI job's token), and publish. | |
| 6 | 6 | |
| 7 | 7 | | Step | Command | Result | |
| 8 | 8 | | --- | --- | --- | |
| 9 | -| 1. Build | `make release-build` | `dist/`: the macOS (Apple Silicon) and Windows (x86-64 and Arm) packages, and `SHA256SUMS` | | |
| 10 | -| 2. Tag | `make release-tag` | the tag `v<version>` is pushed; the **Release** workflow creates the release on Rickub, with its notes | | |
| 11 | -| 3. Attach | by hand, on the release page | every file of `dist/` attached to the release | | |
| 12 | -| 4. After | `git fetch --tags` | the tag `v<version>` is in every copy of the repository | | |
| 9 | +| 1. Check | `./local-ci-01-check.sh` (`make release-check`) | `make verify`: lint, tests, bindings | | |
| 10 | +| 2. Build | `./local-ci-02-build.sh` (`make release-package`) | `release/<TAG>/`: the macOS (Apple Silicon, signed and notarized) and Windows (x86-64 and Arm) packages, `SHA256SUMS` | | |
| 11 | +| 3. Draft | `./local-ci-03-create-draft.sh` | the tag and a **draft prerelease** on Rickub, with its notes | | |
| 12 | +| 4. Upload | `./local-ci-04-upload.sh` | the files are on the draft (temporary branch, deleted afterwards) | | |
| 13 | +| 5. Publish | `./local-ci-05-publish.sh` | the draft is public (asks you to type the tag), what is public is downloaded and compared | | |
| 14 | +| 6. Promote | `./local-ci-06-promote.sh` | optional: the prerelease becomes a release (asks you to type the tag) | | |
| 13 | 15 | |
| 14 | -The version is `info.version` in `build/config.yml`; the tag is `v` + that version. | |
| 16 | +## Settings | |
| 15 | 17 | |
| 16 | -## Before: set the version | |
| 17 | - | |
| 18 | -1. In `build/config.yml`, set `info.version` (e.g. `"0.2.0"`). | |
| 19 | -2. `wails3 task common:update:build-assets`, then put `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `build/darwin/Info.dev.plist` (the command resets it to `12.0.0`). | |
| 20 | -3. Write what is new in `docs/release-notes/v<version>.md` (and `v<version>.fr.md`): the **Release** workflow puts the English one on the release page, under the files. | |
| 21 | -4. `make verify` ([checks before merging](docs/en/how-to/check-before-merging.md)), commit, merge into `main`, and `git checkout main && git pull`. | |
| 18 | +Two files at the root, ignored by git (`*.env`): | |
| 22 | 19 | |
| 23 | -## 1. Build | |
| 20 | +- `.release.env`: `TAG`, `ABOUT`, `OWNER`, `REPO`, and the macOS signature, `SIGN_IDENTITY` and `NOTARY_PROFILE` (by default `$SIDEKICKS_SIGN_IDENTITY` and `$SIDEKICKS_NOTARY_PROFILE`, [part A of the signing guide](docs/en/how-to/sign-and-notarize-on-macos.md)). Empty `SIGN_IDENTITY`: the macOS packages are not signed. | |
| 21 | +- `.ci.cd.token.env`: `CI_TOKEN`, the token that talks to Rickub. It never reaches a command line. | |
| 24 | 22 | |
| 25 | -```bash | |
| 26 | -make release-build | |
| 27 | -``` | |
| 23 | +`LOCAL_CI_ENV_FILE` points the scripts at another settings file. | |
| 28 | 24 | |
| 29 | -It builds, into `dist/`: | |
| 25 | +## Test first with v9.9.9 | |
| 30 | 26 | |
| 31 | -| Files | How | | |
| 32 | -| --- | --- | | |
| 33 | -| `Sidekicks-<v>-macos-arm64.dmg`, `.zip` | natively, for Apple Silicon only (Xcode command line tools) | | |
| 34 | -| `Sidekicks-<v>-windows-amd64-installer.exe`, `sidekicks_<v>_windows_amd64.zip` | cross-built (needs `brew install makensis`) | | |
| 35 | -| `Sidekicks-<v>-windows-arm64-installer.exe`, `sidekicks_<v>_windows_arm64.zip` | cross-built, for Windows on Arm | | |
| 36 | -| `SHA256SUMS` | over all the files above | | |
| 27 | +`TAG="v9.9.9"` in `.release.env` is the test release: the tag may differ from the version of `build/config.yml` (the packages keep the real version in their names). Run steps 1 to 5, check the downloads, then delete the release and the tag on Rickub. Any other tag must be `v` + `info.version`. | |
| 37 | 28 | |
| 38 | -No Linux packages in the releases for now: `LINUX_ARCHES=amd64 make release-build` builds them too, in Docker. `SKIP="windows"` (or `macos`) leaves a system out; `WINDOWS_ARCHES=amd64` builds one Windows architecture only. The list of the files of a release is `scripts/package.sh release-names`. | |
| 29 | +## Before: set the version | |
| 39 | 30 | |
| 40 | -**macOS signing**: with the Developer ID certificate, sign and notarize the macOS packages now, before tagging: [How to sign and notarize Sidekicks for macOS](docs/en/how-to/sign-and-notarize-on-macos.md), part B. | |
| 31 | +1. In `build/config.yml`, set `info.version` (e.g. `"0.2.0"`). | |
| 32 | +2. `scripts/sync-build-assets.sh`: regenerates the Info.plist, Windows and Linux files from it and puts `LSMinimumSystemVersion` back to `13.0.0` (the generator resets it to `12.0.0`). `local-ci-02-build.sh` runs it too and stops if it changed anything. Why: [How to set the version](docs/en/how-to/set-the-version.md). | |
| 33 | +3. Write what is new in `docs/release-notes/v<version>.md` (and `v<version>.fr.md`): the draft's notes include the English one, under the install links. | |
| 34 | +4. Set `TAG="v<version>"` in `.release.env`. | |
| 35 | +5. Commit, merge into `main`, push: step 3 refuses a working tree with changes, and a `HEAD` that is not the remote's `main`. | |
| 41 | 36 | |
| 42 | -## 2. Tag | |
| 37 | +## 2. Build | |
| 43 | 38 | |
| 44 | -```bash | |
| 45 | -make release-tag | |
| 46 | -``` | |
| 39 | +`local-ci-02-build.sh` runs `scripts/build-release.sh` (into `dist/`, unsigned), then, when `SIGN_IDENTITY` is set, signs and notarizes the app, builds the `.dmg` from the stapled app, signs, notarizes and staples it, and checks both with `spctl`. It stages everything in `release/<TAG>/` with a new `SHA256SUMS`. It takes 10 to 20 minutes, mostly Apple's wait. The signing work happens in a temporary folder, so a synced folder (kDrive, iCloud…) cannot corrupt the signatures. | |
| 47 | 40 | |
| 48 | -It refuses when the working tree has changes, when you are not on `main`, when `main` differs from `origin/main`, or when the tag exists; it warns when `dist/` misses a package. Then it creates the annotated tag `v<version>` and pushes it. The push starts `.github/workflows/release.yml`, which checks that the tag matches `build/config.yml` and creates the release with notes listing the files to expect. | |
| 41 | +`SKIP="windows"` (or `macos`) leaves a system out; `LINUX_ARCHES=amd64` adds the Linux packages (in Docker; they are not in `release-names`, so they are not staged). Details of the signing steps and the checks on another Mac: [How to sign and notarize Sidekicks for macOS](docs/en/how-to/sign-and-notarize-on-macos.md). | |
| 49 | 42 | |
| 50 | -## 3. Attach | |
| 43 | +## 3 to 6. Publish | |
| 51 | 44 | |
| 52 | -Open the release on Rickub (**Releases → v<version>**), and attach every file of `dist/`, `SHA256SUMS` included. | |
| 45 | +Steps 3 to 5 refuse to go on when something is off (no `SHA256SUMS`, release already public, `HEAD` not on the remote's `main`, `.github/workflows` still on `HEAD`). `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` prints the notes and creates nothing. Step 5 takes the **latest** place: `/releases/latest` points at the new version for everybody. | |
| 53 | 46 | |
| 54 | -## 4. After: fetch the tag | |
| 47 | +## After: fetch the tag | |
| 55 | 48 | |
| 56 | 49 | ```bash |
| 57 | 50 | git fetch --tags |
| 58 | 51 | git tag --list 'v*' # v<version> is listed |
| 59 | 52 | ``` |
| 60 | 53 | |
| 61 | -In every other copy of the repository (another machine, a sandbox, a clone made before the release), fetch the tags: the tag was pushed from the Mac, a plain `git pull` does not always bring it, and `git describe`, `git log v<previous>..v<version>` or the next release's notes need it. | |
| 54 | +The tag is created by Rickub: in every copy of the repository (this one included), fetch the tags. | |
| 62 | 55 | |
| 63 | 56 | ## When something goes wrong |
| 64 | 57 | |
| 65 | 58 | | Symptom | What to do | |
| 66 | 59 | | --- | --- | |
| 67 | 60 | | `makensis is missing` | `brew install makensis` — or `SKIP=windows`. | |
| 68 | -| `the tag v… already exists` | That version was released already: raise `info.version`. | | |
| 69 | -| The workflow failed: "The tag is … but build/config.yml says …" | Delete the tag (`git push origin :refs/tags/v…` and `git tag -d v…`), fix `info.version`, start again. | | |
| 70 | -| The workflow ran but no release appeared | The job's log tells why (a `403` means the token could not write: `permissions: contents: write` must stay in `release.yml`). Create the release by hand on Rickub from the tag; the notes are in the job's log. | | |
| 71 | - | |
| 72 | -Details: [How to publish a release](docs/en/how-to/publish-a-release.md) · [commands reference](docs/en/reference/commands.md). | |
| 61 | +| `TAG is … but build/config.yml says …` | Fix `.release.env`, or raise `info.version`. | | |
| 62 | +| `no valid identity` / the notarytool profile does not work | The commands in the message; part A of the signing guide. | | |
| 63 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"`. | | |
| 64 | +| `the release … already exists` (409) | Delete the release and its tag on Rickub, or raise the version. | | |
| 65 | +| The upload job fails or times out | The script prints the job's log lines; the temporary branch `local-ci-publish-<TAG>` is deleted anyway (if not: delete it by hand). | | |
| @@ -2,71 +2,64 @@ | |||
| 2 | 2 | ||
| 3 | [Français](RELEASING.fr.md) | 3 | [Français](RELEASING.fr.md) |
| 4 | 4 | ||
| 5 | -Three steps, on the Mac: build everything, tag, attach the files; then bring the tag back to every copy of the repository. | 5 | +There is no CI workflow any more: everything runs on the Mac, with the `local-ci-*.sh` scripts at the root of the repository. They build, sign and notarize the macOS packages, create a draft release on Rickub, upload the files through a temporary branch (Rickub only accepts uploads from a CI job's token), and publish. |
| 6 | 6 | ||
| 7 | | Step | Command | Result | | 7 | | Step | Command | Result | |
| 8 | | --- | --- | --- | | 8 | | --- | --- | --- | |
| 9 | -| 1. Build | `make release-build` | `dist/`: the macOS (Apple Silicon) and Windows (x86-64 and Arm) packages, and `SHA256SUMS` | | 9 | +| 1. Check | `./local-ci-01-check.sh` (`make release-check`) | `make verify`: lint, tests, bindings | |
| 10 | -| 2. Tag | `make release-tag` | the tag `v<version>` is pushed; the **Release** workflow creates the release on Rickub, with its notes | | 10 | +| 2. Build | `./local-ci-02-build.sh` (`make release-package`) | `release/<TAG>/`: the macOS (Apple Silicon, signed and notarized) and Windows (x86-64 and Arm) packages, `SHA256SUMS` | |
| 11 | -| 3. Attach | by hand, on the release page | every file of `dist/` attached to the release | | 11 | +| 3. Draft | `./local-ci-03-create-draft.sh` | the tag and a **draft prerelease** on Rickub, with its notes | |
| 12 | -| 4. After | `git fetch --tags` | the tag `v<version>` is in every copy of the repository | | 12 | +| 4. Upload | `./local-ci-04-upload.sh` | the files are on the draft (temporary branch, deleted afterwards) | |
| 13 | +| 5. Publish | `./local-ci-05-publish.sh` | the draft is public (asks you to type the tag), what is public is downloaded and compared | | ||
| 14 | +| 6. Promote | `./local-ci-06-promote.sh` | optional: the prerelease becomes a release (asks you to type the tag) | | ||
| 13 | 15 | ||
| 14 | -The version is `info.version` in `build/config.yml`; the tag is `v` + that version. | 16 | +## Settings |
| 15 | 17 | ||
| 16 | -## Before: set the version | 18 | +Two files at the root, ignored by git (`*.env`): |
| 17 | - | ||
| 18 | -1. In `build/config.yml`, set `info.version` (e.g. `"0.2.0"`). | ||
| 19 | -2. `wails3 task common:update:build-assets`, then put `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `build/darwin/Info.dev.plist` (the command resets it to `12.0.0`). | ||
| 20 | -3. Write what is new in `docs/release-notes/v<version>.md` (and `v<version>.fr.md`): the **Release** workflow puts the English one on the release page, under the files. | ||
| 21 | -4. `make verify` ([checks before merging](docs/en/how-to/check-before-merging.md)), commit, merge into `main`, and `git checkout main && git pull`. | ||
| 22 | 19 | ||
| 23 | -## 1. Build | 20 | +- `.release.env`: `TAG`, `ABOUT`, `OWNER`, `REPO`, and the macOS signature, `SIGN_IDENTITY` and `NOTARY_PROFILE` (by default `$SIDEKICKS_SIGN_IDENTITY` and `$SIDEKICKS_NOTARY_PROFILE`, [part A of the signing guide](docs/en/how-to/sign-and-notarize-on-macos.md)). Empty `SIGN_IDENTITY`: the macOS packages are not signed. |
| 21 | +- `.ci.cd.token.env`: `CI_TOKEN`, the token that talks to Rickub. It never reaches a command line. | ||
| 24 | 22 | ||
| 25 | -```bash | 23 | +`LOCAL_CI_ENV_FILE` points the scripts at another settings file. |
| 26 | -make release-build | ||
| 27 | -``` | ||
| 28 | 24 | ||
| 29 | -It builds, into `dist/`: | 25 | +## Test first with v9.9.9 |
| 30 | 26 | ||
| 31 | -| Files | How | | 27 | +`TAG="v9.9.9"` in `.release.env` is the test release: the tag may differ from the version of `build/config.yml` (the packages keep the real version in their names). Run steps 1 to 5, check the downloads, then delete the release and the tag on Rickub. Any other tag must be `v` + `info.version`. |
| 32 | -| --- | --- | | ||
| 33 | -| `Sidekicks-<v>-macos-arm64.dmg`, `.zip` | natively, for Apple Silicon only (Xcode command line tools) | | ||
| 34 | -| `Sidekicks-<v>-windows-amd64-installer.exe`, `sidekicks_<v>_windows_amd64.zip` | cross-built (needs `brew install makensis`) | | ||
| 35 | -| `Sidekicks-<v>-windows-arm64-installer.exe`, `sidekicks_<v>_windows_arm64.zip` | cross-built, for Windows on Arm | | ||
| 36 | -| `SHA256SUMS` | over all the files above | | ||
| 37 | 28 | ||
| 38 | -No Linux packages in the releases for now: `LINUX_ARCHES=amd64 make release-build` builds them too, in Docker. `SKIP="windows"` (or `macos`) leaves a system out; `WINDOWS_ARCHES=amd64` builds one Windows architecture only. The list of the files of a release is `scripts/package.sh release-names`. | 29 | +## Before: set the version |
| 39 | 30 | ||
| 40 | -**macOS signing**: with the Developer ID certificate, sign and notarize the macOS packages now, before tagging: [How to sign and notarize Sidekicks for macOS](docs/en/how-to/sign-and-notarize-on-macos.md), part B. | 31 | +1. In `build/config.yml`, set `info.version` (e.g. `"0.2.0"`). |
| 32 | +2. `scripts/sync-build-assets.sh`: regenerates the Info.plist, Windows and Linux files from it and puts `LSMinimumSystemVersion` back to `13.0.0` (the generator resets it to `12.0.0`). `local-ci-02-build.sh` runs it too and stops if it changed anything. Why: [How to set the version](docs/en/how-to/set-the-version.md). | ||
| 33 | +3. Write what is new in `docs/release-notes/v<version>.md` (and `v<version>.fr.md`): the draft's notes include the English one, under the install links. | ||
| 34 | +4. Set `TAG="v<version>"` in `.release.env`. | ||
| 35 | +5. Commit, merge into `main`, push: step 3 refuses a working tree with changes, and a `HEAD` that is not the remote's `main`. | ||
| 41 | 36 | ||
| 42 | -## 2. Tag | 37 | +## 2. Build |
| 43 | 38 | ||
| 44 | -```bash | 39 | +`local-ci-02-build.sh` runs `scripts/build-release.sh` (into `dist/`, unsigned), then, when `SIGN_IDENTITY` is set, signs and notarizes the app, builds the `.dmg` from the stapled app, signs, notarizes and staples it, and checks both with `spctl`. It stages everything in `release/<TAG>/` with a new `SHA256SUMS`. It takes 10 to 20 minutes, mostly Apple's wait. The signing work happens in a temporary folder, so a synced folder (kDrive, iCloud…) cannot corrupt the signatures. |
| 45 | -make release-tag | ||
| 46 | -``` | ||
| 47 | 40 | ||
| 48 | -It refuses when the working tree has changes, when you are not on `main`, when `main` differs from `origin/main`, or when the tag exists; it warns when `dist/` misses a package. Then it creates the annotated tag `v<version>` and pushes it. The push starts `.github/workflows/release.yml`, which checks that the tag matches `build/config.yml` and creates the release with notes listing the files to expect. | 41 | +`SKIP="windows"` (or `macos`) leaves a system out; `LINUX_ARCHES=amd64` adds the Linux packages (in Docker; they are not in `release-names`, so they are not staged). Details of the signing steps and the checks on another Mac: [How to sign and notarize Sidekicks for macOS](docs/en/how-to/sign-and-notarize-on-macos.md). |
| 49 | 42 | ||
| 50 | -## 3. Attach | 43 | +## 3 to 6. Publish |
| 51 | 44 | ||
| 52 | -Open the release on Rickub (**Releases → v<version>**), and attach every file of `dist/`, `SHA256SUMS` included. | 45 | +Steps 3 to 5 refuse to go on when something is off (no `SHA256SUMS`, release already public, `HEAD` not on the remote's `main`, `.github/workflows` still on `HEAD`). `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` prints the notes and creates nothing. Step 5 takes the **latest** place: `/releases/latest` points at the new version for everybody. |
| 53 | 46 | ||
| 54 | -## 4. After: fetch the tag | 47 | +## After: fetch the tag |
| 55 | 48 | ||
| 56 | ```bash | 49 | ```bash |
| 57 | git fetch --tags | 50 | git fetch --tags |
| 58 | git tag --list 'v*' # v<version> is listed | 51 | git tag --list 'v*' # v<version> is listed |
| 59 | ``` | 52 | ``` |
| 60 | 53 | ||
| 61 | -In every other copy of the repository (another machine, a sandbox, a clone made before the release), fetch the tags: the tag was pushed from the Mac, a plain `git pull` does not always bring it, and `git describe`, `git log v<previous>..v<version>` or the next release's notes need it. | 54 | +The tag is created by Rickub: in every copy of the repository (this one included), fetch the tags. |
| 62 | 55 | ||
| 63 | ## When something goes wrong | 56 | ## When something goes wrong |
| 64 | 57 | ||
| 65 | | Symptom | What to do | | 58 | | Symptom | What to do | |
| 66 | | --- | --- | | 59 | | --- | --- | |
| 67 | | `makensis is missing` | `brew install makensis` — or `SKIP=windows`. | | 60 | | `makensis is missing` | `brew install makensis` — or `SKIP=windows`. | |
| 68 | -| `the tag v… already exists` | That version was released already: raise `info.version`. | | 61 | +| `TAG is … but build/config.yml says …` | Fix `.release.env`, or raise `info.version`. | |
| 69 | -| The workflow failed: "The tag is … but build/config.yml says …" | Delete the tag (`git push origin :refs/tags/v…` and `git tag -d v…`), fix `info.version`, start again. | | 62 | +| `no valid identity` / the notarytool profile does not work | The commands in the message; part A of the signing guide. | |
| 70 | -| The workflow ran but no release appeared | The job's log tells why (a `403` means the token could not write: `permissions: contents: write` must stay in `release.yml`). Create the release by hand on Rickub from the tag; the notes are in the job's log. | | 63 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"`. | |
| 71 | - | 64 | +| `the release … already exists` (409) | Delete the release and its tag on Rickub, or raise the version. | |
| 72 | -Details: [How to publish a release](docs/en/how-to/publish-a-release.md) · [commands reference](docs/en/reference/commands.md). | 65 | +| The upload job fails or times out | The script prints the job's log lines; the temporary branch `local-ci-publish-<TAG>` is deleted anyway (if not: delete it by hand). | |
modified
docs/en/README.md +1 -1 | @@ -7,7 +7,7 @@ This documentation follows [Diátaxis](https://diataxis.fr): pick the section th | ||
| 7 | 7 | | You want to… | Section | Pages | |
| 8 | 8 | | --- | --- | --- | |
| 9 | 9 | | **learn** by doing | Tutorials | [Your first agent, without writing any configuration](tutorials/your-first-agent.md) · [A channel with two agents](tutorials/first-channel.md) · [Your first conversation with an agent](tutorials/first-conversation.md) · [Your first launch of Sidekicks](tutorials/first-launch.md) · [Your first ACP exchange with a test agent](tutorials/first-acp-exchange.md) | |
| 10 | -| **do** a specific task | How-to guides | [Install Sidekicks](how-to/install-sidekicks.md) · [Add an agent](how-to/add-an-agent.md) · [Work with an agent's files and terminal](how-to/work-with-an-agents-files.md) · [Run an agent in a Docker container](how-to/run-an-agent-in-docker.md) · [Run an agent in an sbx sandbox](how-to/run-an-agent-in-a-sandbox.md) · [Join files to a message](how-to/join-files-to-a-message.md) · [Manage channels and their agents](how-to/manage-channels.md) · [Edit or switch the configuration](how-to/edit-or-switch-the-configuration.md) · [Reset Sidekicks](how-to/reset-sidekicks.md) · [Watch the memory pressure](how-to/watch-the-memory-pressure.md) · [Develop the application](how-to/develop-the-application.md) · [Run the tests](how-to/run-the-tests.md) · [Check a change before merging it](how-to/check-before-merging.md) · [Run a test agent](how-to/run-a-test-agent.md) · [Run the end-to-end scenarios (v0.1)](how-to/run-the-end-to-end-scenarios.md) · [Publish a release](how-to/publish-a-release.md) · [Sign and notarize for macOS](how-to/sign-and-notarize-on-macos.md) · [Test issue #52 on macOS](how-to/test-issue-52-on-macos.md) · [Test issues #49 and #50 on macOS](how-to/test-issues-49-and-50-on-macos.md) · [Test issue #47 on macOS](how-to/test-issue-47-on-macos.md) · [Test milestone M4 on macOS](how-to/test-milestone-m4-on-macos.md) · [Test milestone M3 on macOS](how-to/test-milestone-m3-on-macos.md) · [Test milestone M2 on macOS](how-to/test-milestone-m2-on-macos.md) · [Test milestone M1 on macOS](how-to/test-milestone-m1-on-macos.md) · [Test milestone Initialize on macOS](how-to/test-milestone-initialize-on-macos.md) | | |
| 10 | +| **do** a specific task | How-to guides | [Install Sidekicks](how-to/install-sidekicks.md) · [Add an agent](how-to/add-an-agent.md) · [Work with an agent's files and terminal](how-to/work-with-an-agents-files.md) · [Run an agent in a Docker container](how-to/run-an-agent-in-docker.md) · [Run an agent in an sbx sandbox](how-to/run-an-agent-in-a-sandbox.md) · [Join files to a message](how-to/join-files-to-a-message.md) · [Manage channels and their agents](how-to/manage-channels.md) · [Edit or switch the configuration](how-to/edit-or-switch-the-configuration.md) · [Reset Sidekicks](how-to/reset-sidekicks.md) · [Watch the memory pressure](how-to/watch-the-memory-pressure.md) · [Develop the application](how-to/develop-the-application.md) · [Run the tests](how-to/run-the-tests.md) · [Check a change before merging it](how-to/check-before-merging.md) · [Run a test agent](how-to/run-a-test-agent.md) · [Run the end-to-end scenarios (v0.1)](how-to/run-the-end-to-end-scenarios.md) · [Set the version](how-to/set-the-version.md) · [Publish a release](how-to/publish-a-release.md) · [Sign and notarize for macOS](how-to/sign-and-notarize-on-macos.md) · [Test issue #52 on macOS](how-to/test-issue-52-on-macos.md) · [Test issues #49 and #50 on macOS](how-to/test-issues-49-and-50-on-macos.md) · [Test issue #47 on macOS](how-to/test-issue-47-on-macos.md) · [Test milestone M4 on macOS](how-to/test-milestone-m4-on-macos.md) · [Test milestone M3 on macOS](how-to/test-milestone-m3-on-macos.md) · [Test milestone M2 on macOS](how-to/test-milestone-m2-on-macos.md) · [Test milestone M1 on macOS](how-to/test-milestone-m1-on-macos.md) · [Test milestone Initialize on macOS](how-to/test-milestone-initialize-on-macos.md) | | |
| 11 | 11 | | **look up** an exact detail | Reference | [The configuration file](reference/configuration.md) · [Keyboard shortcuts](reference/keyboard-shortcuts.md) · [Agents, channels and events](reference/agents-and-events.md) · [Commands](reference/commands.md) · [scripts/agents.sh](reference/agents-script.md) | |
| 12 | 12 | | **understand** why | Explanation | [Workspaces and terminals](explanation/workspaces-and-terminals.md) · [Channels and what each agent knows](explanation/channels-and-context.md) · [Permissions and trust](explanation/permissions.md) · [Why ACP](explanation/why-acp.md) · [The interface stack](explanation/ui-stack.md) · [Architecture](explanation/architecture.md) · [Memory and local models](explanation/memory-and-local-models.md) | |
| 13 | 13 | |
| @@ -7,7 +7,7 @@ This documentation follows [Diátaxis](https://diataxis.fr): pick the section th | |||
| 7 | | You want to… | Section | Pages | | 7 | | You want to… | Section | Pages | |
| 8 | | --- | --- | --- | | 8 | | --- | --- | --- | |
| 9 | | **learn** by doing | Tutorials | [Your first agent, without writing any configuration](tutorials/your-first-agent.md) · [A channel with two agents](tutorials/first-channel.md) · [Your first conversation with an agent](tutorials/first-conversation.md) · [Your first launch of Sidekicks](tutorials/first-launch.md) · [Your first ACP exchange with a test agent](tutorials/first-acp-exchange.md) | | 9 | | **learn** by doing | Tutorials | [Your first agent, without writing any configuration](tutorials/your-first-agent.md) · [A channel with two agents](tutorials/first-channel.md) · [Your first conversation with an agent](tutorials/first-conversation.md) · [Your first launch of Sidekicks](tutorials/first-launch.md) · [Your first ACP exchange with a test agent](tutorials/first-acp-exchange.md) | |
| 10 | -| **do** a specific task | How-to guides | [Install Sidekicks](how-to/install-sidekicks.md) · [Add an agent](how-to/add-an-agent.md) · [Work with an agent's files and terminal](how-to/work-with-an-agents-files.md) · [Run an agent in a Docker container](how-to/run-an-agent-in-docker.md) · [Run an agent in an sbx sandbox](how-to/run-an-agent-in-a-sandbox.md) · [Join files to a message](how-to/join-files-to-a-message.md) · [Manage channels and their agents](how-to/manage-channels.md) · [Edit or switch the configuration](how-to/edit-or-switch-the-configuration.md) · [Reset Sidekicks](how-to/reset-sidekicks.md) · [Watch the memory pressure](how-to/watch-the-memory-pressure.md) · [Develop the application](how-to/develop-the-application.md) · [Run the tests](how-to/run-the-tests.md) · [Check a change before merging it](how-to/check-before-merging.md) · [Run a test agent](how-to/run-a-test-agent.md) · [Run the end-to-end scenarios (v0.1)](how-to/run-the-end-to-end-scenarios.md) · [Publish a release](how-to/publish-a-release.md) · [Sign and notarize for macOS](how-to/sign-and-notarize-on-macos.md) · [Test issue #52 on macOS](how-to/test-issue-52-on-macos.md) · [Test issues #49 and #50 on macOS](how-to/test-issues-49-and-50-on-macos.md) · [Test issue #47 on macOS](how-to/test-issue-47-on-macos.md) · [Test milestone M4 on macOS](how-to/test-milestone-m4-on-macos.md) · [Test milestone M3 on macOS](how-to/test-milestone-m3-on-macos.md) · [Test milestone M2 on macOS](how-to/test-milestone-m2-on-macos.md) · [Test milestone M1 on macOS](how-to/test-milestone-m1-on-macos.md) · [Test milestone Initialize on macOS](how-to/test-milestone-initialize-on-macos.md) | | 10 | +| **do** a specific task | How-to guides | [Install Sidekicks](how-to/install-sidekicks.md) · [Add an agent](how-to/add-an-agent.md) · [Work with an agent's files and terminal](how-to/work-with-an-agents-files.md) · [Run an agent in a Docker container](how-to/run-an-agent-in-docker.md) · [Run an agent in an sbx sandbox](how-to/run-an-agent-in-a-sandbox.md) · [Join files to a message](how-to/join-files-to-a-message.md) · [Manage channels and their agents](how-to/manage-channels.md) · [Edit or switch the configuration](how-to/edit-or-switch-the-configuration.md) · [Reset Sidekicks](how-to/reset-sidekicks.md) · [Watch the memory pressure](how-to/watch-the-memory-pressure.md) · [Develop the application](how-to/develop-the-application.md) · [Run the tests](how-to/run-the-tests.md) · [Check a change before merging it](how-to/check-before-merging.md) · [Run a test agent](how-to/run-a-test-agent.md) · [Run the end-to-end scenarios (v0.1)](how-to/run-the-end-to-end-scenarios.md) · [Set the version](how-to/set-the-version.md) · [Publish a release](how-to/publish-a-release.md) · [Sign and notarize for macOS](how-to/sign-and-notarize-on-macos.md) · [Test issue #52 on macOS](how-to/test-issue-52-on-macos.md) · [Test issues #49 and #50 on macOS](how-to/test-issues-49-and-50-on-macos.md) · [Test issue #47 on macOS](how-to/test-issue-47-on-macos.md) · [Test milestone M4 on macOS](how-to/test-milestone-m4-on-macos.md) · [Test milestone M3 on macOS](how-to/test-milestone-m3-on-macos.md) · [Test milestone M2 on macOS](how-to/test-milestone-m2-on-macos.md) · [Test milestone M1 on macOS](how-to/test-milestone-m1-on-macos.md) · [Test milestone Initialize on macOS](how-to/test-milestone-initialize-on-macos.md) | |
| 11 | | **look up** an exact detail | Reference | [The configuration file](reference/configuration.md) · [Keyboard shortcuts](reference/keyboard-shortcuts.md) · [Agents, channels and events](reference/agents-and-events.md) · [Commands](reference/commands.md) · [scripts/agents.sh](reference/agents-script.md) | | 11 | | **look up** an exact detail | Reference | [The configuration file](reference/configuration.md) · [Keyboard shortcuts](reference/keyboard-shortcuts.md) · [Agents, channels and events](reference/agents-and-events.md) · [Commands](reference/commands.md) · [scripts/agents.sh](reference/agents-script.md) | |
| 12 | | **understand** why | Explanation | [Workspaces and terminals](explanation/workspaces-and-terminals.md) · [Channels and what each agent knows](explanation/channels-and-context.md) · [Permissions and trust](explanation/permissions.md) · [Why ACP](explanation/why-acp.md) · [The interface stack](explanation/ui-stack.md) · [Architecture](explanation/architecture.md) · [Memory and local models](explanation/memory-and-local-models.md) | | 12 | | **understand** why | Explanation | [Workspaces and terminals](explanation/workspaces-and-terminals.md) · [Channels and what each agent knows](explanation/channels-and-context.md) · [Permissions and trust](explanation/permissions.md) · [Why ACP](explanation/why-acp.md) · [The interface stack](explanation/ui-stack.md) · [Architecture](explanation/architecture.md) · [Memory and local models](explanation/memory-and-local-models.md) | |
| 13 | 13 | ||
modified
docs/en/how-to/check-before-merging.md +1 -1 | @@ -14,7 +14,7 @@ Sidekicks has no CI: the checks run on your machine. This guide shows what to ru | ||
| 14 | 14 | It runs `make check` — golangci-lint, svelte-check, the licence headers, then the Go, frontend and shell tests — and then `make bindings-check`: the TypeScript bindings are regenerated and must be identical to the staged ones. A green run ends with: |
| 15 | 15 | |
| 16 | 16 | ```text |
| 17 | - all tag-release tests passed | |
| 17 | + all package tests passed | |
| 18 | 18 | ``` |
| 19 | 19 | |
| 20 | 20 | and no `git diff` output. |
| @@ -14,7 +14,7 @@ Sidekicks has no CI: the checks run on your machine. This guide shows what to ru | |||
| 14 | It runs `make check` — golangci-lint, svelte-check, the licence headers, then the Go, frontend and shell tests — and then `make bindings-check`: the TypeScript bindings are regenerated and must be identical to the staged ones. A green run ends with: | 14 | It runs `make check` — golangci-lint, svelte-check, the licence headers, then the Go, frontend and shell tests — and then `make bindings-check`: the TypeScript bindings are regenerated and must be identical to the staged ones. A green run ends with: |
| 15 | 15 | ||
| 16 | ```text | 16 | ```text |
| 17 | - all tag-release tests passed | 17 | + all package tests passed |
| 18 | ``` | 18 | ``` |
| 19 | 19 | ||
| 20 | and no `git diff` output. | 20 | and no `git diff` output. |
modified
docs/en/how-to/publish-a-release.md +18 -12 | @@ -1,25 +1,31 @@ | ||
| 1 | 1 | # How to publish a release |
| 2 | 2 | |
| 3 | -This guide shows how to publish a Sidekicks release from a Mac: build every package, tag, attach the files to the release that Rickub creates. It assumes the development tools of [How to develop the application](develop-the-application.md), `brew install makensis`, and the right to push tags. [RELEASING.md](../../../RELEASING.md) is the same procedure as a checklist. | |
| 3 | +This guide shows how to publish a Sidekicks release from a Mac with the local CI: build, sign and notarize, create a draft on Rickub, upload, publish. It assumes the development tools of [How to develop the application](develop-the-application.md), `brew install makensis`, the signing setup of [How to sign and notarize Sidekicks for macOS](sign-and-notarize-on-macos.md) (part A) and a token in `.ci.cd.token.env`. [RELEASING.md](../../../RELEASING.md) is the same procedure as a checklist, with the settings. | |
| 4 | 4 | |
| 5 | 5 | ## Steps |
| 6 | 6 | |
| 7 | -1. **Set the version** in `build/config.yml` (`info.version`), run `wails3 task common:update:build-assets`, put `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `Info.dev.plist`, then commit, merge into `main` and `git checkout main && git pull`. | |
| 8 | -2. **Build everything**: `make release-build`. `dist/` then holds the macOS packages (`.dmg` and `.zip` for Apple Silicon), the Windows ones (installer and `.zip`, for x86-64 and for Arm) and `SHA256SUMS`. | |
| 9 | -3. **Tag**: `make release-tag`. The tag `v<version>` is pushed, and the **Release** workflow creates the release on Rickub with notes listing the files. | |
| 10 | -4. **Attach the files**: on Rickub, open **Releases → v<version>** and attach every file of `dist/`. | |
| 11 | -5. **Fetch the tag** in every other copy of the repository (another machine, a sandbox): `git fetch --tags`, then `git tag --list 'v*'` shows `v<version>`. | |
| 7 | +1. **Set the version** ([How to set the version](set-the-version.md): `info.version`, then `scripts/sync-build-assets.sh`), write `docs/release-notes/v<version>.md`, set `TAG="v<version>"` in `.release.env`, then commit, merge into `main` and push. | |
| 8 | +2. `./local-ci-01-check.sh`: `make verify`. | |
| 9 | +3. `./local-ci-02-build.sh`: `release/<TAG>/` holds the signed and notarized macOS `.dmg` and `.zip`, the Windows packages and `SHA256SUMS`. | |
| 10 | +4. `./local-ci-03-create-draft.sh`: the tag and a draft prerelease. | |
| 11 | +5. `./local-ci-04-upload.sh`: the files go up through a temporary branch. | |
| 12 | +6. `./local-ci-05-publish.sh`: type the tag; the public files are downloaded and compared. | |
| 13 | +7. Optional, `./local-ci-06-promote.sh`: the prerelease becomes a release. | |
| 14 | +8. `git fetch --tags` in every copy of the repository. | |
| 15 | + | |
| 16 | +Rehearse with `TAG="v9.9.9"` first. | |
| 12 | 17 | |
| 13 | 18 | ## Variants |
| 14 | 19 | |
| 15 | -- **Linux packages too** (not released for now): `LINUX_ARCHES=amd64 make release-build`, with Docker Desktop running. | |
| 16 | -- **Leave a system out**: `SKIP="windows"` (or `macos`) before `make release-build`; `WINDOWS_ARCHES=amd64` for one Windows architecture. | |
| 17 | -- **Tag without pushing**: `scripts/tag-release.sh --no-push`, then `git push origin v<version>` when ready. | |
| 18 | -- **Wrong tag**: `git push origin :refs/tags/v<version>` and `git tag -d v<version>`, delete the release if it was created, fix the version and tag again. | |
| 19 | -- **One system only**: `make package-macos`, `make package-windows` (both architectures) or `make package-linux` (on Linux, for the machine's architecture). | |
| 20 | +- **Linux packages too** (not released for now): `LINUX_ARCHES=amd64 ./local-ci-02-build.sh`, with Docker Desktop running; they stay in `dist/`. | |
| 21 | +- **Leave a system out**: `SKIP="windows" ./local-ci-02-build.sh` (or `macos`); `WINDOWS_ARCHES=amd64` for one Windows architecture. | |
| 22 | +- **Unsigned build**: leave `SIGN_IDENTITY` empty. | |
| 23 | +- **Only the unsigned packages**: `make release-build` (into `dist/`). | |
| 24 | +- **Wrong release**: delete the release and its tag on Rickub, fix, start again at step 4. | |
| 20 | 25 | |
| 21 | 26 | ## See also |
| 22 | 27 | |
| 28 | +- [How to set the version](set-the-version.md) | |
| 23 | 29 | - [How to sign and notarize Sidekicks for macOS](sign-and-notarize-on-macos.md) |
| 24 | 30 | - [How to install Sidekicks](install-sidekicks.md) |
| 25 | -- [Reference: commands](../reference/commands.md) — `make release-*`, `scripts/build-release.sh`, `scripts/tag-release.sh`, the Release workflow | |
| 31 | +- [Reference: commands](../reference/commands.md) — `make release-*`, `scripts/build-release.sh`, `local-ci-*.sh` | |
| @@ -1,25 +1,31 @@ | |||
| 1 | # How to publish a release | 1 | # How to publish a release |
| 2 | 2 | ||
| 3 | -This guide shows how to publish a Sidekicks release from a Mac: build every package, tag, attach the files to the release that Rickub creates. It assumes the development tools of [How to develop the application](develop-the-application.md), `brew install makensis`, and the right to push tags. [RELEASING.md](../../../RELEASING.md) is the same procedure as a checklist. | 3 | +This guide shows how to publish a Sidekicks release from a Mac with the local CI: build, sign and notarize, create a draft on Rickub, upload, publish. It assumes the development tools of [How to develop the application](develop-the-application.md), `brew install makensis`, the signing setup of [How to sign and notarize Sidekicks for macOS](sign-and-notarize-on-macos.md) (part A) and a token in `.ci.cd.token.env`. [RELEASING.md](../../../RELEASING.md) is the same procedure as a checklist, with the settings. |
| 4 | 4 | ||
| 5 | ## Steps | 5 | ## Steps |
| 6 | 6 | ||
| 7 | -1. **Set the version** in `build/config.yml` (`info.version`), run `wails3 task common:update:build-assets`, put `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `Info.dev.plist`, then commit, merge into `main` and `git checkout main && git pull`. | 7 | +1. **Set the version** ([How to set the version](set-the-version.md): `info.version`, then `scripts/sync-build-assets.sh`), write `docs/release-notes/v<version>.md`, set `TAG="v<version>"` in `.release.env`, then commit, merge into `main` and push. |
| 8 | -2. **Build everything**: `make release-build`. `dist/` then holds the macOS packages (`.dmg` and `.zip` for Apple Silicon), the Windows ones (installer and `.zip`, for x86-64 and for Arm) and `SHA256SUMS`. | 8 | +2. `./local-ci-01-check.sh`: `make verify`. |
| 9 | -3. **Tag**: `make release-tag`. The tag `v<version>` is pushed, and the **Release** workflow creates the release on Rickub with notes listing the files. | 9 | +3. `./local-ci-02-build.sh`: `release/<TAG>/` holds the signed and notarized macOS `.dmg` and `.zip`, the Windows packages and `SHA256SUMS`. |
| 10 | -4. **Attach the files**: on Rickub, open **Releases → v<version>** and attach every file of `dist/`. | 10 | +4. `./local-ci-03-create-draft.sh`: the tag and a draft prerelease. |
| 11 | -5. **Fetch the tag** in every other copy of the repository (another machine, a sandbox): `git fetch --tags`, then `git tag --list 'v*'` shows `v<version>`. | 11 | +5. `./local-ci-04-upload.sh`: the files go up through a temporary branch. |
| 12 | +6. `./local-ci-05-publish.sh`: type the tag; the public files are downloaded and compared. | ||
| 13 | +7. Optional, `./local-ci-06-promote.sh`: the prerelease becomes a release. | ||
| 14 | +8. `git fetch --tags` in every copy of the repository. | ||
| 15 | + | ||
| 16 | +Rehearse with `TAG="v9.9.9"` first. | ||
| 12 | 17 | ||
| 13 | ## Variants | 18 | ## Variants |
| 14 | 19 | ||
| 15 | -- **Linux packages too** (not released for now): `LINUX_ARCHES=amd64 make release-build`, with Docker Desktop running. | 20 | +- **Linux packages too** (not released for now): `LINUX_ARCHES=amd64 ./local-ci-02-build.sh`, with Docker Desktop running; they stay in `dist/`. |
| 16 | -- **Leave a system out**: `SKIP="windows"` (or `macos`) before `make release-build`; `WINDOWS_ARCHES=amd64` for one Windows architecture. | 21 | +- **Leave a system out**: `SKIP="windows" ./local-ci-02-build.sh` (or `macos`); `WINDOWS_ARCHES=amd64` for one Windows architecture. |
| 17 | -- **Tag without pushing**: `scripts/tag-release.sh --no-push`, then `git push origin v<version>` when ready. | 22 | +- **Unsigned build**: leave `SIGN_IDENTITY` empty. |
| 18 | -- **Wrong tag**: `git push origin :refs/tags/v<version>` and `git tag -d v<version>`, delete the release if it was created, fix the version and tag again. | 23 | +- **Only the unsigned packages**: `make release-build` (into `dist/`). |
| 19 | -- **One system only**: `make package-macos`, `make package-windows` (both architectures) or `make package-linux` (on Linux, for the machine's architecture). | 24 | +- **Wrong release**: delete the release and its tag on Rickub, fix, start again at step 4. |
| 20 | 25 | ||
| 21 | ## See also | 26 | ## See also |
| 22 | 27 | ||
| 28 | +- [How to set the version](set-the-version.md) | ||
| 23 | - [How to sign and notarize Sidekicks for macOS](sign-and-notarize-on-macos.md) | 29 | - [How to sign and notarize Sidekicks for macOS](sign-and-notarize-on-macos.md) |
| 24 | - [How to install Sidekicks](install-sidekicks.md) | 30 | - [How to install Sidekicks](install-sidekicks.md) |
| 25 | -- [Reference: commands](../reference/commands.md) — `make release-*`, `scripts/build-release.sh`, `scripts/tag-release.sh`, the Release workflow | 31 | +- [Reference: commands](../reference/commands.md) — `make release-*`, `scripts/build-release.sh`, `local-ci-*.sh` |
added
docs/en/how-to/set-the-version.md +43 -0 | new file mode 100644 | ||
| @@ -0,0 +1,43 @@ | ||
| 1 | +# How to set the version of Sidekicks | |
| 2 | + | |
| 3 | +This guide shows how to change the version of Sidekicks before a release, and explains why one command is not enough. It assumes `wails3` (see [How to develop the application](develop-the-application.md)). | |
| 4 | + | |
| 5 | +## Steps | |
| 6 | + | |
| 7 | +1. In `build/config.yml`, set `info.version` (e.g. `"1.3.0"`). | |
| 8 | +2. Run: | |
| 9 | + | |
| 10 | + ```bash | |
| 11 | + scripts/sync-build-assets.sh | |
| 12 | + ``` | |
| 13 | + | |
| 14 | + It ends with `build assets are in sync with info.version 1.3.0 (LSMinimumSystemVersion 13.0.0)`. | |
| 15 | +3. Review `git diff build/`, then commit and push with the rest of the release. Write `docs/release-notes/v<version>.md` (and `.fr.md`) too. | |
| 16 | +4. Set `TAG="v<version>"` in `.release.env`. | |
| 17 | + | |
| 18 | +You can skip step 2: `local-ci-02-build.sh` runs the same script. But when it changes a tracked file it stops (the tag has to describe what was built), so you would commit and start it again. Doing step 2 yourself saves that round trip. | |
| 19 | + | |
| 20 | +## Why a script | |
| 21 | + | |
| 22 | +The version of the application is written in several places, and only `build/config.yml` is edited by hand. The others are **generated** by `wails3 task common:update:build-assets`: | |
| 23 | + | |
| 24 | +| File | Holds | | |
| 25 | +| --- | --- | | |
| 26 | +| `build/darwin/Info.plist`, `Info.dev.plist` | `CFBundleShortVersionString`, `CFBundleVersion`, `LSMinimumSystemVersion` | | |
| 27 | +| `build/windows/info.json`, `wails.exe.manifest`, `nsis/wails_tools.nsh` | the version of the Windows executable and installer | | |
| 28 | +| `build/linux/nfpm/nfpm.yaml` | the version of the Linux packages | | |
| 29 | + | |
| 30 | +If they are not regenerated, the About box, the Finder and the Windows file properties show the previous version although the packages are named after the new one. | |
| 31 | + | |
| 32 | +The generator has a flaw: it resets **`LSMinimumSystemVersion` to `12.0.0`**. Sidekicks is built for macOS 13 or later (`-mmacosx-version-min=13.0` in `build/darwin/Taskfile.yml`), so a release with 12.0.0 would let macOS 12 open an application that does not work there. `scripts/sync-build-assets.sh` runs the generator, puts `13.0.0` back in both plists and verifies the result (`--check` verifies without changing anything). | |
| 33 | + | |
| 34 | +The generated files are tracked by git and the release tag points at `HEAD`: that is why they are committed, and why the local CI refuses to go on when the sync changes them. | |
| 35 | + | |
| 36 | +## Test releases | |
| 37 | + | |
| 38 | +For a test tag (`v9.9.9`), the version is not changed: the packages keep the real `info.version`, and the sync finds nothing to do. | |
| 39 | + | |
| 40 | +## See also | |
| 41 | + | |
| 42 | +- [How to publish a release](publish-a-release.md) · [RELEASING.md](../../../RELEASING.md) | |
| 43 | +- [Reference: commands](../reference/commands.md) — `scripts/sync-build-assets.sh` | |
| new file mode 100644 | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | +# How to set the version of Sidekicks | ||
| 2 | + | ||
| 3 | +This guide shows how to change the version of Sidekicks before a release, and explains why one command is not enough. It assumes `wails3` (see [How to develop the application](develop-the-application.md)). | ||
| 4 | + | ||
| 5 | +## Steps | ||
| 6 | + | ||
| 7 | +1. In `build/config.yml`, set `info.version` (e.g. `"1.3.0"`). | ||
| 8 | +2. Run: | ||
| 9 | + | ||
| 10 | + ```bash | ||
| 11 | + scripts/sync-build-assets.sh | ||
| 12 | + ``` | ||
| 13 | + | ||
| 14 | + It ends with `build assets are in sync with info.version 1.3.0 (LSMinimumSystemVersion 13.0.0)`. | ||
| 15 | +3. Review `git diff build/`, then commit and push with the rest of the release. Write `docs/release-notes/v<version>.md` (and `.fr.md`) too. | ||
| 16 | +4. Set `TAG="v<version>"` in `.release.env`. | ||
| 17 | + | ||
| 18 | +You can skip step 2: `local-ci-02-build.sh` runs the same script. But when it changes a tracked file it stops (the tag has to describe what was built), so you would commit and start it again. Doing step 2 yourself saves that round trip. | ||
| 19 | + | ||
| 20 | +## Why a script | ||
| 21 | + | ||
| 22 | +The version of the application is written in several places, and only `build/config.yml` is edited by hand. The others are **generated** by `wails3 task common:update:build-assets`: | ||
| 23 | + | ||
| 24 | +| File | Holds | | ||
| 25 | +| --- | --- | | ||
| 26 | +| `build/darwin/Info.plist`, `Info.dev.plist` | `CFBundleShortVersionString`, `CFBundleVersion`, `LSMinimumSystemVersion` | | ||
| 27 | +| `build/windows/info.json`, `wails.exe.manifest`, `nsis/wails_tools.nsh` | the version of the Windows executable and installer | | ||
| 28 | +| `build/linux/nfpm/nfpm.yaml` | the version of the Linux packages | | ||
| 29 | + | ||
| 30 | +If they are not regenerated, the About box, the Finder and the Windows file properties show the previous version although the packages are named after the new one. | ||
| 31 | + | ||
| 32 | +The generator has a flaw: it resets **`LSMinimumSystemVersion` to `12.0.0`**. Sidekicks is built for macOS 13 or later (`-mmacosx-version-min=13.0` in `build/darwin/Taskfile.yml`), so a release with 12.0.0 would let macOS 12 open an application that does not work there. `scripts/sync-build-assets.sh` runs the generator, puts `13.0.0` back in both plists and verifies the result (`--check` verifies without changing anything). | ||
| 33 | + | ||
| 34 | +The generated files are tracked by git and the release tag points at `HEAD`: that is why they are committed, and why the local CI refuses to go on when the sync changes them. | ||
| 35 | + | ||
| 36 | +## Test releases | ||
| 37 | + | ||
| 38 | +For a test tag (`v9.9.9`), the version is not changed: the packages keep the real `info.version`, and the sync finds nothing to do. | ||
| 39 | + | ||
| 40 | +## See also | ||
| 41 | + | ||
| 42 | +- [How to publish a release](publish-a-release.md) · [RELEASING.md](../../../RELEASING.md) | ||
| 43 | +- [Reference: commands](../reference/commands.md) — `scripts/sync-build-assets.sh` | ||
modified
docs/en/how-to/sign-and-notarize-on-macos.md +2 -2 | @@ -3,7 +3,7 @@ | ||
| 3 | 3 | This guide shows how to sign Sidekicks with a **Developer ID** certificate and have Apple **notarize** it, so that it opens on any Mac without **Open Anyway**. It assumes a paid Apple Developer Program membership of which you are the **Account Holder** (only that role can create a Developer ID certificate), an Apple Silicon Mac with the project's development tools ([Develop the application](develop-the-application.md)), and a release built as [RELEASING.md](../../../RELEASING.md) describes. |
| 4 | 4 | |
| 5 | 5 | - **Part A** is done **once** (allow 30 minutes). |
| 6 | -- **Part B** is done **for every release**, after `make release-build`, until signing is automated (issue #58). Allow 10 to 20 minutes, mostly waiting for Apple. | |
| 6 | +- **Part B** is what `local-ci-02-build.sh` does for every release when `SIGN_IDENTITY` is set in `.release.env` (it reads `SIDEKICKS_SIGN_IDENTITY` and `SIDEKICKS_NOTARY_PROFILE`). Do it by hand only to understand it or to redo one step. Allow 10 to 20 minutes, mostly waiting for Apple. | |
| 7 | 7 | |
| 8 | 8 | Keep a Terminal window open at the root of the repository. |
| 9 | 9 | |
| @@ -87,7 +87,7 @@ export SIDEKICKS_SIGN_IDENTITY="Developer ID Application: First Last (AB12CD34EF | ||
| 87 | 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" |
| 88 | 88 | ``` |
| 89 | 89 | |
| 90 | -Part B uses them; the automation (issue #58) will too. | |
| 90 | +Part B and `local-ci-02-build.sh` use them. | |
| 91 | 91 | |
| 92 | 92 | ### A8. Keep the app's identifier |
| 93 | 93 | |
| @@ -3,7 +3,7 @@ | |||
| 3 | This guide shows how to sign Sidekicks with a **Developer ID** certificate and have Apple **notarize** it, so that it opens on any Mac without **Open Anyway**. It assumes a paid Apple Developer Program membership of which you are the **Account Holder** (only that role can create a Developer ID certificate), an Apple Silicon Mac with the project's development tools ([Develop the application](develop-the-application.md)), and a release built as [RELEASING.md](../../../RELEASING.md) describes. | 3 | This guide shows how to sign Sidekicks with a **Developer ID** certificate and have Apple **notarize** it, so that it opens on any Mac without **Open Anyway**. It assumes a paid Apple Developer Program membership of which you are the **Account Holder** (only that role can create a Developer ID certificate), an Apple Silicon Mac with the project's development tools ([Develop the application](develop-the-application.md)), and a release built as [RELEASING.md](../../../RELEASING.md) describes. |
| 4 | 4 | ||
| 5 | - **Part A** is done **once** (allow 30 minutes). | 5 | - **Part A** is done **once** (allow 30 minutes). |
| 6 | -- **Part B** is done **for every release**, after `make release-build`, until signing is automated (issue #58). Allow 10 to 20 minutes, mostly waiting for Apple. | 6 | +- **Part B** is what `local-ci-02-build.sh` does for every release when `SIGN_IDENTITY` is set in `.release.env` (it reads `SIDEKICKS_SIGN_IDENTITY` and `SIDEKICKS_NOTARY_PROFILE`). Do it by hand only to understand it or to redo one step. Allow 10 to 20 minutes, mostly waiting for Apple. |
| 7 | 7 | ||
| 8 | Keep a Terminal window open at the root of the repository. | 8 | Keep a Terminal window open at the root of the repository. |
| 9 | 9 | ||
| @@ -87,7 +87,7 @@ export SIDEKICKS_SIGN_IDENTITY="Developer ID Application: First Last (AB12CD34EF | |||
| 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" | 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" |
| 88 | ``` | 88 | ``` |
| 89 | 89 | ||
| 90 | -Part B uses them; the automation (issue #58) will too. | 90 | +Part B and `local-ci-02-build.sh` use them. |
| 91 | 91 | ||
| 92 | ### A8. Keep the app's identifier | 92 | ### A8. Keep the app's identifier |
| 93 | 93 | ||
modified
docs/en/reference/commands.md +19 -8 | @@ -28,7 +28,8 @@ The order is detailed in the [configuration reference](configuration.md#location | ||
| 28 | 28 | | `package-linux` | `scripts/package.sh linux`: `.deb`, `.rpm`, `.AppImage` and `.tar.gz` for the machine's architecture, into `dist/`. Needs `file` (AppImage) and `rpm`. | |
| 29 | 29 | | `package-windows` | `scripts/package.sh windows amd64` then `arm64`: NSIS installer and `.zip` for each, cross-built, into `dist/`. Needs `makensis` and `zip`. | |
| 30 | 30 | | `release-build` | `scripts/build-release.sh`: on the Mac, every release package (macOS arm64, Windows amd64 and arm64) into `dist/` and `SHA256SUMS`. | |
| 31 | -| `release-tag` | `scripts/tag-release.sh`: tags `v<version>` on `main` and pushes it. | | |
| 31 | +| `release-check` | `local-ci-01-check.sh`: `make verify`. | | |
| 32 | +| `release-package` | `local-ci-02-build.sh`: builds, signs and notarizes into `release/<TAG>/`. | | |
| 32 | 33 | | `package-macos` | `scripts/package.sh macos`: `.dmg` and `.zip` for Apple Silicon (arm64, signed ad hoc; no Intel build), into `dist/`. macOS only. | |
| 33 | 34 | | `install-test-config` | `scripts/install-test-config.sh`: writes `examples/test-agents.yaml` at the default configuration location with absolute paths to the repository: each agent is `mm -acp -config agent.yaml` started in its folder, with `afterStop: [<repo>/scripts/agents.sh, unload, <agent>]` to unload its model when it stops, `mm` written with its absolute path (`MM_BIN`, or the one in `PATH`), and the current `PATH` in each agent's `env`; an existing file is kept as `config.yaml.<date>.bak`. | |
| 34 | 35 | | `check` | `lint` then `test`. | |
| @@ -37,7 +38,7 @@ The order is detailed in the [configuration reference](configuration.md#location | ||
| 37 | 38 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | |
| 38 | 39 | | `test-go` | `go test ./...` (builds `frontend/dist` first if missing). | |
| 39 | 40 | | `test-frontend` | `vitest run` in `frontend/`. | |
| 40 | -| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh` and `scripts/tag-release_test.sh`. | | |
| 41 | +| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh`. | | |
| 41 | 42 | | `test-real` | `go test -tags realagents -count=1 ./...` — needs `mm` and llmman. | |
| 42 | 43 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | |
| 43 | 44 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | |
| @@ -66,7 +67,7 @@ scripts/package.sh version | ||
| 66 | 67 | | --- | --- | |
| 67 | 68 | | `linux`, `windows`, `macos` | Builds the packages of that system into `dist/` (see the `package-*` targets), then lists `dist/`. | |
| 68 | 69 | | `names <system> <arch>` | Prints the file names a build produces, one per line; builds nothing. | |
| 69 | -| `release-names` | Prints the files of a release: the names of each target of `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), then `SHA256SUMS`. Used by `tag-release.sh` and the Release workflow. | | |
| 70 | +| `release-names` | Prints the files of a release: the names of each target of `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), then `SHA256SUMS`. Used by `local-ci-02-build.sh`. | | |
| 70 | 71 | | `version` | Prints `info.version` of `build/config.yml`. | |
| 71 | 72 | |
| 72 | 73 | | System | Files (`<v>` = version) | |
| @@ -83,14 +84,24 @@ scripts/package.sh version | ||
| 83 | 84 | |
| 84 | 85 | Checks every prerequisite first, then empties `dist/` and builds: macOS with `scripts/package.sh macos` (macOS only), Windows with `scripts/package.sh windows <arch>` for each of `WINDOWS_ARCHES` (default `amd64 arm64`; needs `makensis` and `zip`), and, only when `LINUX_ARCHES` is set (empty by default: no Linux in the releases for now), Linux with `scripts/package.sh linux` in a container per architecture, built from `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go of `go.mod`, pnpm of `frontend/package.json`, Wails CLI) with the repository mounted at `/src` and the Go module cache in the volume `sidekicks-gomod-<arch>`. Finally writes `dist/SHA256SUMS`. `SKIP` leaves the systems it names out. Fails, before building anything, when a prerequisite is missing (macOS host, `makensis`, `zip`, Docker for Linux). |
| 85 | 86 | |
| 86 | -## `scripts/tag-release.sh` | |
| 87 | +## `scripts/sync-build-assets.sh` | |
| 87 | 88 | |
| 88 | 89 | ```text |
| 89 | -scripts/tag-release.sh [--remote <name>] [--no-push] | |
| 90 | +scripts/sync-build-assets.sh [--check] | |
| 90 | 91 | ``` |
| 91 | 92 | |
| 92 | -Creates the annotated tag `v<version>` (`info.version` of `build/config.yml`, message `Sidekicks <version>`) and pushes it to `--remote` (default `origin`). Refuses when tracked files have changes, when the current branch is not `main`, when `main` differs from `<remote>/main` after a fetch, or when the tag exists locally. Warns, without refusing, when `dist/` misses a package of the version or `SHA256SUMS`. `--no-push` tags locally only. | |
| 93 | +Runs `wails3 task common:update:build-assets` (regenerates the Info.plist, Windows and Linux files from `build/config.yml`), puts `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `Info.dev.plist`, then checks that both plists carry `info.version` and `13.0.0`. `--check` only checks. Run by `local-ci-02-build.sh`. Why: [How to set the version](../how-to/set-the-version.md). | |
| 93 | 94 | |
| 94 | -## Release workflow | |
| 95 | +## `local-ci-*.sh` | |
| 95 | 96 | |
| 96 | -`.github/workflows/release.yml`, on the push of a tag `v*`, with `permissions: contents: write`: fails when the tag is not `v` + `info.version` of `build/config.yml`, then creates the release `<tag>` named `Sidekicks <tag>` (`softprops/action-gh-release@v2`, through Rickub's GitHub-compatible API behind `GITHUB_API_URL`), with notes giving the commit, the install guides and the table of the files to expect (from `scripts/package.sh release-names`). It attaches no file: the packages are attached by hand. | |
| 97 | +The local CI, at the root of the repository (procedure: [RELEASING.md](../../../RELEASING.md)). All read `.release.env` (`TAG`, `ABOUT`, `OWNER`, `REPO`, `SIGN_IDENTITY`, `NOTARY_PROFILE`; another file with `LOCAL_CI_ENV_FILE`) and, for Rickub, `CI_TOKEN` in `.ci.cd.token.env`. | |
| 98 | + | |
| 99 | +| Script | What it does | | |
| 100 | +| --- | --- | | |
| 101 | +| `local-ci-00-common.sh` | Shared by the others (sourced). | | |
| 102 | +| `local-ci-01-check.sh` | `make verify`. | | |
| 103 | +| `local-ci-02-build.sh` | `scripts/build-release.sh`, then, with `SIGN_IDENTITY`, signs, notarizes and staples the app and the `.dmg`; stages `release/<TAG>/` and its `SHA256SUMS`. `TAG` must be `v` + `info.version`, or `v9.9.9…` (test). | | |
| 104 | +| `local-ci-03-create-draft.sh` | Creates the tag and a draft prerelease with notes. Refuses a working tree with changes, a `HEAD` that is not the remote's `main`, a `HEAD` with `.github/workflows`. `LOCAL_CI_PRINT_NOTES=1` prints the notes only; `LOCAL_CI_SKIP_GIT_CHECK=1` skips the git checks. | | |
| 105 | +| `local-ci-04-upload.sh` | Pushes a temporary orphan branch `local-ci-publish-<TAG>` whose one-job workflow uploads the files of `SHA256SUMS` to the draft, waits for the job, deletes the branch. | | |
| 106 | +| `local-ci-05-publish.sh` | Publishes the draft as a prerelease after you type the tag, downloads and compares the public files. | | |
| 107 | +| `local-ci-06-promote.sh [tag]` | Removes the pre-release label after you type the tag. | | |
| @@ -28,7 +28,8 @@ The order is detailed in the [configuration reference](configuration.md#location | |||
| 28 | | `package-linux` | `scripts/package.sh linux`: `.deb`, `.rpm`, `.AppImage` and `.tar.gz` for the machine's architecture, into `dist/`. Needs `file` (AppImage) and `rpm`. | | 28 | | `package-linux` | `scripts/package.sh linux`: `.deb`, `.rpm`, `.AppImage` and `.tar.gz` for the machine's architecture, into `dist/`. Needs `file` (AppImage) and `rpm`. | |
| 29 | | `package-windows` | `scripts/package.sh windows amd64` then `arm64`: NSIS installer and `.zip` for each, cross-built, into `dist/`. Needs `makensis` and `zip`. | | 29 | | `package-windows` | `scripts/package.sh windows amd64` then `arm64`: NSIS installer and `.zip` for each, cross-built, into `dist/`. Needs `makensis` and `zip`. | |
| 30 | | `release-build` | `scripts/build-release.sh`: on the Mac, every release package (macOS arm64, Windows amd64 and arm64) into `dist/` and `SHA256SUMS`. | | 30 | | `release-build` | `scripts/build-release.sh`: on the Mac, every release package (macOS arm64, Windows amd64 and arm64) into `dist/` and `SHA256SUMS`. | |
| 31 | -| `release-tag` | `scripts/tag-release.sh`: tags `v<version>` on `main` and pushes it. | | 31 | +| `release-check` | `local-ci-01-check.sh`: `make verify`. | |
| 32 | +| `release-package` | `local-ci-02-build.sh`: builds, signs and notarizes into `release/<TAG>/`. | | ||
| 32 | | `package-macos` | `scripts/package.sh macos`: `.dmg` and `.zip` for Apple Silicon (arm64, signed ad hoc; no Intel build), into `dist/`. macOS only. | | 33 | | `package-macos` | `scripts/package.sh macos`: `.dmg` and `.zip` for Apple Silicon (arm64, signed ad hoc; no Intel build), into `dist/`. macOS only. | |
| 33 | | `install-test-config` | `scripts/install-test-config.sh`: writes `examples/test-agents.yaml` at the default configuration location with absolute paths to the repository: each agent is `mm -acp -config agent.yaml` started in its folder, with `afterStop: [<repo>/scripts/agents.sh, unload, <agent>]` to unload its model when it stops, `mm` written with its absolute path (`MM_BIN`, or the one in `PATH`), and the current `PATH` in each agent's `env`; an existing file is kept as `config.yaml.<date>.bak`. | | 34 | | `install-test-config` | `scripts/install-test-config.sh`: writes `examples/test-agents.yaml` at the default configuration location with absolute paths to the repository: each agent is `mm -acp -config agent.yaml` started in its folder, with `afterStop: [<repo>/scripts/agents.sh, unload, <agent>]` to unload its model when it stops, `mm` written with its absolute path (`MM_BIN`, or the one in `PATH`), and the current `PATH` in each agent's `env`; an existing file is kept as `config.yaml.<date>.bak`. | |
| 34 | | `check` | `lint` then `test`. | | 35 | | `check` | `lint` then `test`. | |
| @@ -37,7 +38,7 @@ The order is detailed in the [configuration reference](configuration.md#location | |||
| 37 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | | 38 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | |
| 38 | | `test-go` | `go test ./...` (builds `frontend/dist` first if missing). | | 39 | | `test-go` | `go test ./...` (builds `frontend/dist` first if missing). | |
| 39 | | `test-frontend` | `vitest run` in `frontend/`. | | 40 | | `test-frontend` | `vitest run` in `frontend/`. | |
| 40 | -| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh` and `scripts/tag-release_test.sh`. | | 41 | +| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh`. | |
| 41 | | `test-real` | `go test -tags realagents -count=1 ./...` — needs `mm` and llmman. | | 42 | | `test-real` | `go test -tags realagents -count=1 ./...` — needs `mm` and llmman. | |
| 42 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | | 43 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | |
| 43 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | | 44 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | |
| @@ -66,7 +67,7 @@ scripts/package.sh version | |||
| 66 | | --- | --- | | 67 | | --- | --- | |
| 67 | | `linux`, `windows`, `macos` | Builds the packages of that system into `dist/` (see the `package-*` targets), then lists `dist/`. | | 68 | | `linux`, `windows`, `macos` | Builds the packages of that system into `dist/` (see the `package-*` targets), then lists `dist/`. | |
| 68 | | `names <system> <arch>` | Prints the file names a build produces, one per line; builds nothing. | | 69 | | `names <system> <arch>` | Prints the file names a build produces, one per line; builds nothing. | |
| 69 | -| `release-names` | Prints the files of a release: the names of each target of `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), then `SHA256SUMS`. Used by `tag-release.sh` and the Release workflow. | | 70 | +| `release-names` | Prints the files of a release: the names of each target of `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), then `SHA256SUMS`. Used by `local-ci-02-build.sh`. | |
| 70 | | `version` | Prints `info.version` of `build/config.yml`. | | 71 | | `version` | Prints `info.version` of `build/config.yml`. | |
| 71 | 72 | ||
| 72 | | System | Files (`<v>` = version) | | 73 | | System | Files (`<v>` = version) | |
| @@ -83,14 +84,24 @@ scripts/package.sh version | |||
| 83 | 84 | ||
| 84 | Checks every prerequisite first, then empties `dist/` and builds: macOS with `scripts/package.sh macos` (macOS only), Windows with `scripts/package.sh windows <arch>` for each of `WINDOWS_ARCHES` (default `amd64 arm64`; needs `makensis` and `zip`), and, only when `LINUX_ARCHES` is set (empty by default: no Linux in the releases for now), Linux with `scripts/package.sh linux` in a container per architecture, built from `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go of `go.mod`, pnpm of `frontend/package.json`, Wails CLI) with the repository mounted at `/src` and the Go module cache in the volume `sidekicks-gomod-<arch>`. Finally writes `dist/SHA256SUMS`. `SKIP` leaves the systems it names out. Fails, before building anything, when a prerequisite is missing (macOS host, `makensis`, `zip`, Docker for Linux). | 85 | Checks every prerequisite first, then empties `dist/` and builds: macOS with `scripts/package.sh macos` (macOS only), Windows with `scripts/package.sh windows <arch>` for each of `WINDOWS_ARCHES` (default `amd64 arm64`; needs `makensis` and `zip`), and, only when `LINUX_ARCHES` is set (empty by default: no Linux in the releases for now), Linux with `scripts/package.sh linux` in a container per architecture, built from `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go of `go.mod`, pnpm of `frontend/package.json`, Wails CLI) with the repository mounted at `/src` and the Go module cache in the volume `sidekicks-gomod-<arch>`. Finally writes `dist/SHA256SUMS`. `SKIP` leaves the systems it names out. Fails, before building anything, when a prerequisite is missing (macOS host, `makensis`, `zip`, Docker for Linux). |
| 85 | 86 | ||
| 86 | -## `scripts/tag-release.sh` | 87 | +## `scripts/sync-build-assets.sh` |
| 87 | 88 | ||
| 88 | ```text | 89 | ```text |
| 89 | -scripts/tag-release.sh [--remote <name>] [--no-push] | 90 | +scripts/sync-build-assets.sh [--check] |
| 90 | ``` | 91 | ``` |
| 91 | 92 | ||
| 92 | -Creates the annotated tag `v<version>` (`info.version` of `build/config.yml`, message `Sidekicks <version>`) and pushes it to `--remote` (default `origin`). Refuses when tracked files have changes, when the current branch is not `main`, when `main` differs from `<remote>/main` after a fetch, or when the tag exists locally. Warns, without refusing, when `dist/` misses a package of the version or `SHA256SUMS`. `--no-push` tags locally only. | 93 | +Runs `wails3 task common:update:build-assets` (regenerates the Info.plist, Windows and Linux files from `build/config.yml`), puts `LSMinimumSystemVersion` back to `13.0.0` in `build/darwin/Info.plist` and `Info.dev.plist`, then checks that both plists carry `info.version` and `13.0.0`. `--check` only checks. Run by `local-ci-02-build.sh`. Why: [How to set the version](../how-to/set-the-version.md). |
| 93 | 94 | ||
| 94 | -## Release workflow | 95 | +## `local-ci-*.sh` |
| 95 | 96 | ||
| 96 | -`.github/workflows/release.yml`, on the push of a tag `v*`, with `permissions: contents: write`: fails when the tag is not `v` + `info.version` of `build/config.yml`, then creates the release `<tag>` named `Sidekicks <tag>` (`softprops/action-gh-release@v2`, through Rickub's GitHub-compatible API behind `GITHUB_API_URL`), with notes giving the commit, the install guides and the table of the files to expect (from `scripts/package.sh release-names`). It attaches no file: the packages are attached by hand. | 97 | +The local CI, at the root of the repository (procedure: [RELEASING.md](../../../RELEASING.md)). All read `.release.env` (`TAG`, `ABOUT`, `OWNER`, `REPO`, `SIGN_IDENTITY`, `NOTARY_PROFILE`; another file with `LOCAL_CI_ENV_FILE`) and, for Rickub, `CI_TOKEN` in `.ci.cd.token.env`. |
| 98 | + | ||
| 99 | +| Script | What it does | | ||
| 100 | +| --- | --- | | ||
| 101 | +| `local-ci-00-common.sh` | Shared by the others (sourced). | | ||
| 102 | +| `local-ci-01-check.sh` | `make verify`. | | ||
| 103 | +| `local-ci-02-build.sh` | `scripts/build-release.sh`, then, with `SIGN_IDENTITY`, signs, notarizes and staples the app and the `.dmg`; stages `release/<TAG>/` and its `SHA256SUMS`. `TAG` must be `v` + `info.version`, or `v9.9.9…` (test). | | ||
| 104 | +| `local-ci-03-create-draft.sh` | Creates the tag and a draft prerelease with notes. Refuses a working tree with changes, a `HEAD` that is not the remote's `main`, a `HEAD` with `.github/workflows`. `LOCAL_CI_PRINT_NOTES=1` prints the notes only; `LOCAL_CI_SKIP_GIT_CHECK=1` skips the git checks. | | ||
| 105 | +| `local-ci-04-upload.sh` | Pushes a temporary orphan branch `local-ci-publish-<TAG>` whose one-job workflow uploads the files of `SHA256SUMS` to the draft, waits for the job, deletes the branch. | | ||
| 106 | +| `local-ci-05-publish.sh` | Publishes the draft as a prerelease after you type the tag, downloads and compares the public files. | | ||
| 107 | +| `local-ci-06-promote.sh [tag]` | Removes the pre-release label after you type the tag. | | ||
modified
docs/fr/README.md +1 -1 | @@ -7,7 +7,7 @@ Cette documentation suit la méthode [Diátaxis](https://diataxis.fr) : choisiss | ||
| 7 | 7 | | Vous voulez… | Section | Pages | |
| 8 | 8 | | --- | --- | --- | |
| 9 | 9 | | **apprendre** en pratiquant | Tutoriels | [Votre premier agent, sans écrire de configuration](tutorials/premier-agent.md) · [Un channel avec deux agents](tutorials/premier-channel.md) · [Votre première conversation avec un agent](tutorials/premiere-conversation.md) · [Votre premier lancement de Sidekicks](tutorials/premier-lancement.md) · [Votre premier échange ACP avec un agent de test](tutorials/premier-echange-acp.md) | |
| 10 | -| **réaliser** une tâche précise | Guides pratiques | [Installer Sidekicks](how-to/installer-sidekicks.md) · [Ajouter un agent](how-to/ajouter-un-agent.md) · [Travailler avec les fichiers et le terminal d'un agent](how-to/fichiers-et-terminal-d-un-agent.md) · [Lancer un agent dans un conteneur Docker](how-to/lancer-un-agent-dans-docker.md) · [Lancer un agent dans une sandbox sbx](how-to/lancer-un-agent-dans-une-sandbox.md) · [Joindre des fichiers à un message](how-to/joindre-des-fichiers-a-un-message.md) · [Gérer les channels et leurs agents](how-to/gerer-les-channels.md) · [Modifier ou changer la configuration](how-to/modifier-ou-changer-la-configuration.md) · [Repartir de zéro](how-to/repartir-de-zero.md) · [Surveiller la pression mémoire](how-to/surveiller-la-pression-memoire.md) · [Développer l'application](how-to/developper-l-application.md) · [Lancer les tests](how-to/lancer-les-tests.md) · [Vérifier une modification avant de la fusionner](how-to/verifier-avant-de-fusionner.md) · [Lancer un agent de test](how-to/lancer-un-agent-de-test.md) · [Dérouler les scénarios de bout en bout (v0.1)](how-to/derouler-les-scenarios-de-bout-en-bout.md) · [Publier une release](how-to/publier-une-release.md) · [Signer et notariser pour macOS](how-to/signer-et-notariser-sous-macos.md) · [Tester l'issue #52 sous macOS](how-to/tester-l-issue-52-sous-macos.md) · [Tester les issues #49 et #50 sous macOS](how-to/tester-les-issues-49-et-50-sous-macos.md) · [Tester l'issue #47 sous macOS](how-to/tester-l-issue-47-sous-macos.md) · [Tester la milestone M4 sous macOS](how-to/tester-la-milestone-m4-sous-macos.md) · [Tester la milestone M3 sous macOS](how-to/tester-la-milestone-m3-sous-macos.md) · [Tester la milestone M2 sous macOS](how-to/tester-la-milestone-m2-sous-macos.md) · [Tester la milestone M1 sous macOS](how-to/tester-la-milestone-m1-sous-macos.md) · [Tester la milestone Initialize sous macOS](how-to/tester-la-milestone-initialize-sous-macos.md) | | |
| 10 | +| **réaliser** une tâche précise | Guides pratiques | [Installer Sidekicks](how-to/installer-sidekicks.md) · [Ajouter un agent](how-to/ajouter-un-agent.md) · [Travailler avec les fichiers et le terminal d'un agent](how-to/fichiers-et-terminal-d-un-agent.md) · [Lancer un agent dans un conteneur Docker](how-to/lancer-un-agent-dans-docker.md) · [Lancer un agent dans une sandbox sbx](how-to/lancer-un-agent-dans-une-sandbox.md) · [Joindre des fichiers à un message](how-to/joindre-des-fichiers-a-un-message.md) · [Gérer les channels et leurs agents](how-to/gerer-les-channels.md) · [Modifier ou changer la configuration](how-to/modifier-ou-changer-la-configuration.md) · [Repartir de zéro](how-to/repartir-de-zero.md) · [Surveiller la pression mémoire](how-to/surveiller-la-pression-memoire.md) · [Développer l'application](how-to/developper-l-application.md) · [Lancer les tests](how-to/lancer-les-tests.md) · [Vérifier une modification avant de la fusionner](how-to/verifier-avant-de-fusionner.md) · [Lancer un agent de test](how-to/lancer-un-agent-de-test.md) · [Dérouler les scénarios de bout en bout (v0.1)](how-to/derouler-les-scenarios-de-bout-en-bout.md) · [Définir la version](how-to/definir-la-version.md) · [Tester la CI locale (temporaire)](how-to/tester-la-ci-locale.md) · [Publier une release](how-to/publier-une-release.md) · [Signer et notariser pour macOS](how-to/signer-et-notariser-sous-macos.md) · [Tester l'issue #52 sous macOS](how-to/tester-l-issue-52-sous-macos.md) · [Tester les issues #49 et #50 sous macOS](how-to/tester-les-issues-49-et-50-sous-macos.md) · [Tester l'issue #47 sous macOS](how-to/tester-l-issue-47-sous-macos.md) · [Tester la milestone M4 sous macOS](how-to/tester-la-milestone-m4-sous-macos.md) · [Tester la milestone M3 sous macOS](how-to/tester-la-milestone-m3-sous-macos.md) · [Tester la milestone M2 sous macOS](how-to/tester-la-milestone-m2-sous-macos.md) · [Tester la milestone M1 sous macOS](how-to/tester-la-milestone-m1-sous-macos.md) · [Tester la milestone Initialize sous macOS](how-to/tester-la-milestone-initialize-sous-macos.md) | | |
| 11 | 11 | | **consulter** un détail exact | Référence | [Le fichier de configuration](reference/configuration.md) · [Raccourcis clavier](reference/raccourcis-clavier.md) · [Agents, channels et événements](reference/agents-et-evenements.md) · [Commandes](reference/commandes.md) · [scripts/agents.sh](reference/script-agents.md) | |
| 12 | 12 | | **comprendre** le pourquoi | Explications | [Workspaces et terminaux](explanation/workspaces-et-terminaux.md) · [Les channels et ce que sait chaque agent](explanation/channels-et-contexte.md) · [Permissions et confiance](explanation/permissions-et-confiance.md) · [Pourquoi ACP](explanation/pourquoi-acp.md) · [La stack de l'interface](explanation/stack-interface.md) · [Architecture](explanation/architecture.md) · [Mémoire et modèles locaux](explanation/memoire-et-modeles-locaux.md) | |
| 13 | 13 | |
| @@ -7,7 +7,7 @@ Cette documentation suit la méthode [Diátaxis](https://diataxis.fr) : choisiss | |||
| 7 | | Vous voulez… | Section | Pages | | 7 | | Vous voulez… | Section | Pages | |
| 8 | | --- | --- | --- | | 8 | | --- | --- | --- | |
| 9 | | **apprendre** en pratiquant | Tutoriels | [Votre premier agent, sans écrire de configuration](tutorials/premier-agent.md) · [Un channel avec deux agents](tutorials/premier-channel.md) · [Votre première conversation avec un agent](tutorials/premiere-conversation.md) · [Votre premier lancement de Sidekicks](tutorials/premier-lancement.md) · [Votre premier échange ACP avec un agent de test](tutorials/premier-echange-acp.md) | | 9 | | **apprendre** en pratiquant | Tutoriels | [Votre premier agent, sans écrire de configuration](tutorials/premier-agent.md) · [Un channel avec deux agents](tutorials/premier-channel.md) · [Votre première conversation avec un agent](tutorials/premiere-conversation.md) · [Votre premier lancement de Sidekicks](tutorials/premier-lancement.md) · [Votre premier échange ACP avec un agent de test](tutorials/premier-echange-acp.md) | |
| 10 | -| **réaliser** une tâche précise | Guides pratiques | [Installer Sidekicks](how-to/installer-sidekicks.md) · [Ajouter un agent](how-to/ajouter-un-agent.md) · [Travailler avec les fichiers et le terminal d'un agent](how-to/fichiers-et-terminal-d-un-agent.md) · [Lancer un agent dans un conteneur Docker](how-to/lancer-un-agent-dans-docker.md) · [Lancer un agent dans une sandbox sbx](how-to/lancer-un-agent-dans-une-sandbox.md) · [Joindre des fichiers à un message](how-to/joindre-des-fichiers-a-un-message.md) · [Gérer les channels et leurs agents](how-to/gerer-les-channels.md) · [Modifier ou changer la configuration](how-to/modifier-ou-changer-la-configuration.md) · [Repartir de zéro](how-to/repartir-de-zero.md) · [Surveiller la pression mémoire](how-to/surveiller-la-pression-memoire.md) · [Développer l'application](how-to/developper-l-application.md) · [Lancer les tests](how-to/lancer-les-tests.md) · [Vérifier une modification avant de la fusionner](how-to/verifier-avant-de-fusionner.md) · [Lancer un agent de test](how-to/lancer-un-agent-de-test.md) · [Dérouler les scénarios de bout en bout (v0.1)](how-to/derouler-les-scenarios-de-bout-en-bout.md) · [Publier une release](how-to/publier-une-release.md) · [Signer et notariser pour macOS](how-to/signer-et-notariser-sous-macos.md) · [Tester l'issue #52 sous macOS](how-to/tester-l-issue-52-sous-macos.md) · [Tester les issues #49 et #50 sous macOS](how-to/tester-les-issues-49-et-50-sous-macos.md) · [Tester l'issue #47 sous macOS](how-to/tester-l-issue-47-sous-macos.md) · [Tester la milestone M4 sous macOS](how-to/tester-la-milestone-m4-sous-macos.md) · [Tester la milestone M3 sous macOS](how-to/tester-la-milestone-m3-sous-macos.md) · [Tester la milestone M2 sous macOS](how-to/tester-la-milestone-m2-sous-macos.md) · [Tester la milestone M1 sous macOS](how-to/tester-la-milestone-m1-sous-macos.md) · [Tester la milestone Initialize sous macOS](how-to/tester-la-milestone-initialize-sous-macos.md) | | 10 | +| **réaliser** une tâche précise | Guides pratiques | [Installer Sidekicks](how-to/installer-sidekicks.md) · [Ajouter un agent](how-to/ajouter-un-agent.md) · [Travailler avec les fichiers et le terminal d'un agent](how-to/fichiers-et-terminal-d-un-agent.md) · [Lancer un agent dans un conteneur Docker](how-to/lancer-un-agent-dans-docker.md) · [Lancer un agent dans une sandbox sbx](how-to/lancer-un-agent-dans-une-sandbox.md) · [Joindre des fichiers à un message](how-to/joindre-des-fichiers-a-un-message.md) · [Gérer les channels et leurs agents](how-to/gerer-les-channels.md) · [Modifier ou changer la configuration](how-to/modifier-ou-changer-la-configuration.md) · [Repartir de zéro](how-to/repartir-de-zero.md) · [Surveiller la pression mémoire](how-to/surveiller-la-pression-memoire.md) · [Développer l'application](how-to/developper-l-application.md) · [Lancer les tests](how-to/lancer-les-tests.md) · [Vérifier une modification avant de la fusionner](how-to/verifier-avant-de-fusionner.md) · [Lancer un agent de test](how-to/lancer-un-agent-de-test.md) · [Dérouler les scénarios de bout en bout (v0.1)](how-to/derouler-les-scenarios-de-bout-en-bout.md) · [Définir la version](how-to/definir-la-version.md) · [Tester la CI locale (temporaire)](how-to/tester-la-ci-locale.md) · [Publier une release](how-to/publier-une-release.md) · [Signer et notariser pour macOS](how-to/signer-et-notariser-sous-macos.md) · [Tester l'issue #52 sous macOS](how-to/tester-l-issue-52-sous-macos.md) · [Tester les issues #49 et #50 sous macOS](how-to/tester-les-issues-49-et-50-sous-macos.md) · [Tester l'issue #47 sous macOS](how-to/tester-l-issue-47-sous-macos.md) · [Tester la milestone M4 sous macOS](how-to/tester-la-milestone-m4-sous-macos.md) · [Tester la milestone M3 sous macOS](how-to/tester-la-milestone-m3-sous-macos.md) · [Tester la milestone M2 sous macOS](how-to/tester-la-milestone-m2-sous-macos.md) · [Tester la milestone M1 sous macOS](how-to/tester-la-milestone-m1-sous-macos.md) · [Tester la milestone Initialize sous macOS](how-to/tester-la-milestone-initialize-sous-macos.md) | |
| 11 | | **consulter** un détail exact | Référence | [Le fichier de configuration](reference/configuration.md) · [Raccourcis clavier](reference/raccourcis-clavier.md) · [Agents, channels et événements](reference/agents-et-evenements.md) · [Commandes](reference/commandes.md) · [scripts/agents.sh](reference/script-agents.md) | | 11 | | **consulter** un détail exact | Référence | [Le fichier de configuration](reference/configuration.md) · [Raccourcis clavier](reference/raccourcis-clavier.md) · [Agents, channels et événements](reference/agents-et-evenements.md) · [Commandes](reference/commandes.md) · [scripts/agents.sh](reference/script-agents.md) | |
| 12 | | **comprendre** le pourquoi | Explications | [Workspaces et terminaux](explanation/workspaces-et-terminaux.md) · [Les channels et ce que sait chaque agent](explanation/channels-et-contexte.md) · [Permissions et confiance](explanation/permissions-et-confiance.md) · [Pourquoi ACP](explanation/pourquoi-acp.md) · [La stack de l'interface](explanation/stack-interface.md) · [Architecture](explanation/architecture.md) · [Mémoire et modèles locaux](explanation/memoire-et-modeles-locaux.md) | | 12 | | **comprendre** le pourquoi | Explications | [Workspaces et terminaux](explanation/workspaces-et-terminaux.md) · [Les channels et ce que sait chaque agent](explanation/channels-et-contexte.md) · [Permissions et confiance](explanation/permissions-et-confiance.md) · [Pourquoi ACP](explanation/pourquoi-acp.md) · [La stack de l'interface](explanation/stack-interface.md) · [Architecture](explanation/architecture.md) · [Mémoire et modèles locaux](explanation/memoire-et-modeles-locaux.md) | |
| 13 | 13 | ||
added
docs/fr/how-to/definir-la-version.md +43 -0 | new file mode 100644 | ||
| @@ -0,0 +1,43 @@ | ||
| 1 | +# Définir la version de Sidekicks | |
| 2 | + | |
| 3 | +Ce guide montre comment changer la version de Sidekicks avant une release, et explique pourquoi une seule commande ne suffit pas. Il suppose `wails3` (voir [Développer l'application](developper-l-application.md)). | |
| 4 | + | |
| 5 | +## Étapes | |
| 6 | + | |
| 7 | +1. Dans `build/config.yml`, fixez `info.version` (p. ex. `"1.3.0"`). | |
| 8 | +2. Lancez : | |
| 9 | + | |
| 10 | + ```bash | |
| 11 | + scripts/sync-build-assets.sh | |
| 12 | + ``` | |
| 13 | + | |
| 14 | + Elle se termine par `build assets are in sync with info.version 1.3.0 (LSMinimumSystemVersion 13.0.0)`. | |
| 15 | +3. Relisez `git diff build/`, puis commitez et poussez avec le reste de la release. Écrivez aussi `docs/release-notes/v<version>.md` (et `.fr.md`). | |
| 16 | +4. Mettez `TAG="v<version>"` dans `.release.env`. | |
| 17 | + | |
| 18 | +Vous pouvez sauter l'étape 2 : `local-ci-02-build.sh` lance le même script. Mais quand il modifie un fichier suivi, il s'arrête (le tag doit décrire ce qui a été construit) : vous commiteriez, puis relanceriez. Faire l'étape 2 vous-même évite cet aller-retour. | |
| 19 | + | |
| 20 | +## Pourquoi un script | |
| 21 | + | |
| 22 | +La version de l'application est écrite à plusieurs endroits, et seul `build/config.yml` s'édite à la main. Les autres sont **générés** par `wails3 task common:update:build-assets` : | |
| 23 | + | |
| 24 | +| Fichier | Contient | | |
| 25 | +| --- | --- | | |
| 26 | +| `build/darwin/Info.plist`, `Info.dev.plist` | `CFBundleShortVersionString`, `CFBundleVersion`, `LSMinimumSystemVersion` | | |
| 27 | +| `build/windows/info.json`, `wails.exe.manifest`, `nsis/wails_tools.nsh` | la version de l'exécutable et de l'installateur Windows | | |
| 28 | +| `build/linux/nfpm/nfpm.yaml` | la version des paquets Linux | | |
| 29 | + | |
| 30 | +S'ils ne sont pas régénérés, la fenêtre « À propos », le Finder et les propriétés Windows affichent la version précédente alors que les paquets portent le nom de la nouvelle. | |
| 31 | + | |
| 32 | +Le générateur a un défaut : il remet **`LSMinimumSystemVersion` à `12.0.0`**. Sidekicks est construit pour macOS 13 ou plus (`-mmacosx-version-min=13.0` dans `build/darwin/Taskfile.yml`) : une release à 12.0.0 laisserait macOS 12 ouvrir une application qui n'y fonctionne pas. `scripts/sync-build-assets.sh` lance le générateur, remet `13.0.0` dans les deux plist et vérifie le résultat (`--check` vérifie sans rien changer). | |
| 33 | + | |
| 34 | +Les fichiers générés sont suivis par git et le tag de la release pointe sur `HEAD` : c'est pourquoi on les commite, et pourquoi la CI locale refuse d'avancer quand la synchronisation les modifie. | |
| 35 | + | |
| 36 | +## Releases de test | |
| 37 | + | |
| 38 | +Pour un tag de test (`v9.9.9`), la version ne change pas : les paquets gardent le vrai `info.version`, et la synchronisation n'a rien à faire. | |
| 39 | + | |
| 40 | +## Voir aussi | |
| 41 | + | |
| 42 | +- [Publier une release](publier-une-release.md) · [RELEASING.fr.md](../../../RELEASING.fr.md) | |
| 43 | +- [Référence : commandes](../reference/commandes.md) — `scripts/sync-build-assets.sh` | |
| new file mode 100644 | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | +# Définir la version de Sidekicks | ||
| 2 | + | ||
| 3 | +Ce guide montre comment changer la version de Sidekicks avant une release, et explique pourquoi une seule commande ne suffit pas. Il suppose `wails3` (voir [Développer l'application](developper-l-application.md)). | ||
| 4 | + | ||
| 5 | +## Étapes | ||
| 6 | + | ||
| 7 | +1. Dans `build/config.yml`, fixez `info.version` (p. ex. `"1.3.0"`). | ||
| 8 | +2. Lancez : | ||
| 9 | + | ||
| 10 | + ```bash | ||
| 11 | + scripts/sync-build-assets.sh | ||
| 12 | + ``` | ||
| 13 | + | ||
| 14 | + Elle se termine par `build assets are in sync with info.version 1.3.0 (LSMinimumSystemVersion 13.0.0)`. | ||
| 15 | +3. Relisez `git diff build/`, puis commitez et poussez avec le reste de la release. Écrivez aussi `docs/release-notes/v<version>.md` (et `.fr.md`). | ||
| 16 | +4. Mettez `TAG="v<version>"` dans `.release.env`. | ||
| 17 | + | ||
| 18 | +Vous pouvez sauter l'étape 2 : `local-ci-02-build.sh` lance le même script. Mais quand il modifie un fichier suivi, il s'arrête (le tag doit décrire ce qui a été construit) : vous commiteriez, puis relanceriez. Faire l'étape 2 vous-même évite cet aller-retour. | ||
| 19 | + | ||
| 20 | +## Pourquoi un script | ||
| 21 | + | ||
| 22 | +La version de l'application est écrite à plusieurs endroits, et seul `build/config.yml` s'édite à la main. Les autres sont **générés** par `wails3 task common:update:build-assets` : | ||
| 23 | + | ||
| 24 | +| Fichier | Contient | | ||
| 25 | +| --- | --- | | ||
| 26 | +| `build/darwin/Info.plist`, `Info.dev.plist` | `CFBundleShortVersionString`, `CFBundleVersion`, `LSMinimumSystemVersion` | | ||
| 27 | +| `build/windows/info.json`, `wails.exe.manifest`, `nsis/wails_tools.nsh` | la version de l'exécutable et de l'installateur Windows | | ||
| 28 | +| `build/linux/nfpm/nfpm.yaml` | la version des paquets Linux | | ||
| 29 | + | ||
| 30 | +S'ils ne sont pas régénérés, la fenêtre « À propos », le Finder et les propriétés Windows affichent la version précédente alors que les paquets portent le nom de la nouvelle. | ||
| 31 | + | ||
| 32 | +Le générateur a un défaut : il remet **`LSMinimumSystemVersion` à `12.0.0`**. Sidekicks est construit pour macOS 13 ou plus (`-mmacosx-version-min=13.0` dans `build/darwin/Taskfile.yml`) : une release à 12.0.0 laisserait macOS 12 ouvrir une application qui n'y fonctionne pas. `scripts/sync-build-assets.sh` lance le générateur, remet `13.0.0` dans les deux plist et vérifie le résultat (`--check` vérifie sans rien changer). | ||
| 33 | + | ||
| 34 | +Les fichiers générés sont suivis par git et le tag de la release pointe sur `HEAD` : c'est pourquoi on les commite, et pourquoi la CI locale refuse d'avancer quand la synchronisation les modifie. | ||
| 35 | + | ||
| 36 | +## Releases de test | ||
| 37 | + | ||
| 38 | +Pour un tag de test (`v9.9.9`), la version ne change pas : les paquets gardent le vrai `info.version`, et la synchronisation n'a rien à faire. | ||
| 39 | + | ||
| 40 | +## Voir aussi | ||
| 41 | + | ||
| 42 | +- [Publier une release](publier-une-release.md) · [RELEASING.fr.md](../../../RELEASING.fr.md) | ||
| 43 | +- [Référence : commandes](../reference/commandes.md) — `scripts/sync-build-assets.sh` | ||
modified
docs/fr/how-to/publier-une-release.md +18 -12 | @@ -1,25 +1,31 @@ | ||
| 1 | 1 | # Publier une release |
| 2 | 2 | |
| 3 | -Ce guide montre comment publier une release de Sidekicks depuis un Mac : construire tous les paquets, tagger, attacher les fichiers à la release que Rickub crée. Il suppose les outils de [Développer l'application](developper-l-application.md), `brew install makensis`, et le droit de pousser des tags. [RELEASING.fr.md](../../../RELEASING.fr.md) donne la même procédure en liste de contrôle. | |
| 3 | +Ce guide montre comment publier une release de Sidekicks depuis un Mac avec la CI locale : construire, signer et notariser, créer un brouillon sur Rickub, envoyer, publier. Il suppose les outils de [Développer l'application](developper-l-application.md), `brew install makensis`, la signature de [Signer et notariser Sidekicks pour macOS](signer-et-notariser-sous-macos.md) (partie A) et un jeton dans `.ci.cd.token.env`. [RELEASING.fr.md](../../../RELEASING.fr.md) donne la même procédure en liste de contrôle, avec les réglages. | |
| 4 | 4 | |
| 5 | 5 | ## Étapes |
| 6 | 6 | |
| 7 | -1. **Fixez la version** dans `build/config.yml` (`info.version`), lancez `wails3 task common:update:build-assets`, remettez `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `Info.dev.plist`, puis commitez, fusionnez dans `main` et `git checkout main && git pull`. | |
| 8 | -2. **Construisez tout** : `make release-build`. `dist/` contient alors les paquets macOS (`.dmg` et `.zip` pour Apple Silicon), Windows (installateur et `.zip`, pour x86-64 et pour Arm) et `SHA256SUMS`. | |
| 9 | -3. **Taggez** : `make release-tag`. Le tag `v<version>` est poussé, et le workflow **Release** crée la release sur Rickub avec des notes qui listent les fichiers. | |
| 10 | -4. **Attachez les fichiers** : sur Rickub, ouvrez **Releases → v<version>** et attachez tous les fichiers de `dist/`. | |
| 11 | -5. **Récupérez le tag** dans chaque autre copie du dépôt (une autre machine, une sandbox) : `git fetch --tags`, puis `git tag --list 'v*'` affiche `v<version>`. | |
| 7 | +1. **Fixez la version** ([Définir la version](definir-la-version.md) : `info.version`, puis `scripts/sync-build-assets.sh`), écrivez `docs/release-notes/v<version>.md`, mettez `TAG="v<version>"` dans `.release.env`, puis commitez, fusionnez dans `main` et poussez. | |
| 8 | +2. `./local-ci-01-check.sh` : `make verify`. | |
| 9 | +3. `./local-ci-02-build.sh` : `release/<TAG>/` contient le `.dmg` et le `.zip` macOS signés et notarisés, les paquets Windows et `SHA256SUMS`. | |
| 10 | +4. `./local-ci-03-create-draft.sh` : le tag et une préversion en brouillon. | |
| 11 | +5. `./local-ci-04-upload.sh` : les fichiers montent par une branche temporaire. | |
| 12 | +6. `./local-ci-05-publish.sh` : tapez le tag ; les fichiers publics sont téléchargés et comparés. | |
| 13 | +7. Facultatif, `./local-ci-06-promote.sh` : la préversion devient une release. | |
| 14 | +8. `git fetch --tags` dans chaque copie du dépôt. | |
| 15 | + | |
| 16 | +Répétez d'abord avec `TAG="v9.9.9"`. | |
| 12 | 17 | |
| 13 | 18 | ## Variantes |
| 14 | 19 | |
| 15 | -- **Les paquets Linux aussi** (pas publiés pour le moment) : `LINUX_ARCHES=amd64 make release-build`, avec Docker Desktop démarré. | |
| 16 | -- **Laisser un système de côté** : `SKIP="windows"` (ou `macos`) avant `make release-build` ; `WINDOWS_ARCHES=amd64` pour une seule architecture Windows. | |
| 17 | -- **Tagger sans pousser** : `scripts/tag-release.sh --no-push`, puis `git push origin v<version>` le moment venu. | |
| 18 | -- **Mauvais tag** : `git push origin :refs/tags/v<version>` et `git tag -d v<version>`, supprimez la release si elle a été créée, corrigez la version et taggez à nouveau. | |
| 19 | -- **Un seul système** : `make package-macos`, `make package-windows` (les deux architectures) ou `make package-linux` (sous Linux, pour l'architecture de la machine). | |
| 20 | +- **Les paquets Linux aussi** (pas publiés pour le moment) : `LINUX_ARCHES=amd64 ./local-ci-02-build.sh`, avec Docker Desktop démarré ; ils restent dans `dist/`. | |
| 21 | +- **Laisser un système de côté** : `SKIP="windows" ./local-ci-02-build.sh` (ou `macos`) ; `WINDOWS_ARCHES=amd64` pour une seule architecture Windows. | |
| 22 | +- **Construction non signée** : laissez `SIGN_IDENTITY` vide. | |
| 23 | +- **Seulement les paquets non signés** : `make release-build` (dans `dist/`). | |
| 24 | +- **Mauvaise release** : supprimez la release et son tag sur Rickub, corrigez, reprenez à l'étape 4. | |
| 20 | 25 | |
| 21 | 26 | ## Voir aussi |
| 22 | 27 | |
| 28 | +- [Définir la version](definir-la-version.md) | |
| 23 | 29 | - [Signer et notariser Sidekicks pour macOS](signer-et-notariser-sous-macos.md) |
| 24 | 30 | - [Installer Sidekicks](installer-sidekicks.md) |
| 25 | -- [Référence : commandes](../reference/commandes.md) — `make release-*`, `scripts/build-release.sh`, `scripts/tag-release.sh`, le workflow Release | |
| 31 | +- [Référence : commandes](../reference/commandes.md) — `make release-*`, `scripts/build-release.sh`, `local-ci-*.sh` | |
| @@ -1,25 +1,31 @@ | |||
| 1 | # Publier une release | 1 | # Publier une release |
| 2 | 2 | ||
| 3 | -Ce guide montre comment publier une release de Sidekicks depuis un Mac : construire tous les paquets, tagger, attacher les fichiers à la release que Rickub crée. Il suppose les outils de [Développer l'application](developper-l-application.md), `brew install makensis`, et le droit de pousser des tags. [RELEASING.fr.md](../../../RELEASING.fr.md) donne la même procédure en liste de contrôle. | 3 | +Ce guide montre comment publier une release de Sidekicks depuis un Mac avec la CI locale : construire, signer et notariser, créer un brouillon sur Rickub, envoyer, publier. Il suppose les outils de [Développer l'application](developper-l-application.md), `brew install makensis`, la signature de [Signer et notariser Sidekicks pour macOS](signer-et-notariser-sous-macos.md) (partie A) et un jeton dans `.ci.cd.token.env`. [RELEASING.fr.md](../../../RELEASING.fr.md) donne la même procédure en liste de contrôle, avec les réglages. |
| 4 | 4 | ||
| 5 | ## Étapes | 5 | ## Étapes |
| 6 | 6 | ||
| 7 | -1. **Fixez la version** dans `build/config.yml` (`info.version`), lancez `wails3 task common:update:build-assets`, remettez `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `Info.dev.plist`, puis commitez, fusionnez dans `main` et `git checkout main && git pull`. | 7 | +1. **Fixez la version** ([Définir la version](definir-la-version.md) : `info.version`, puis `scripts/sync-build-assets.sh`), écrivez `docs/release-notes/v<version>.md`, mettez `TAG="v<version>"` dans `.release.env`, puis commitez, fusionnez dans `main` et poussez. |
| 8 | -2. **Construisez tout** : `make release-build`. `dist/` contient alors les paquets macOS (`.dmg` et `.zip` pour Apple Silicon), Windows (installateur et `.zip`, pour x86-64 et pour Arm) et `SHA256SUMS`. | 8 | +2. `./local-ci-01-check.sh` : `make verify`. |
| 9 | -3. **Taggez** : `make release-tag`. Le tag `v<version>` est poussé, et le workflow **Release** crée la release sur Rickub avec des notes qui listent les fichiers. | 9 | +3. `./local-ci-02-build.sh` : `release/<TAG>/` contient le `.dmg` et le `.zip` macOS signés et notarisés, les paquets Windows et `SHA256SUMS`. |
| 10 | -4. **Attachez les fichiers** : sur Rickub, ouvrez **Releases → v<version>** et attachez tous les fichiers de `dist/`. | 10 | +4. `./local-ci-03-create-draft.sh` : le tag et une préversion en brouillon. |
| 11 | -5. **Récupérez le tag** dans chaque autre copie du dépôt (une autre machine, une sandbox) : `git fetch --tags`, puis `git tag --list 'v*'` affiche `v<version>`. | 11 | +5. `./local-ci-04-upload.sh` : les fichiers montent par une branche temporaire. |
| 12 | +6. `./local-ci-05-publish.sh` : tapez le tag ; les fichiers publics sont téléchargés et comparés. | ||
| 13 | +7. Facultatif, `./local-ci-06-promote.sh` : la préversion devient une release. | ||
| 14 | +8. `git fetch --tags` dans chaque copie du dépôt. | ||
| 15 | + | ||
| 16 | +Répétez d'abord avec `TAG="v9.9.9"`. | ||
| 12 | 17 | ||
| 13 | ## Variantes | 18 | ## Variantes |
| 14 | 19 | ||
| 15 | -- **Les paquets Linux aussi** (pas publiés pour le moment) : `LINUX_ARCHES=amd64 make release-build`, avec Docker Desktop démarré. | 20 | +- **Les paquets Linux aussi** (pas publiés pour le moment) : `LINUX_ARCHES=amd64 ./local-ci-02-build.sh`, avec Docker Desktop démarré ; ils restent dans `dist/`. |
| 16 | -- **Laisser un système de côté** : `SKIP="windows"` (ou `macos`) avant `make release-build` ; `WINDOWS_ARCHES=amd64` pour une seule architecture Windows. | 21 | +- **Laisser un système de côté** : `SKIP="windows" ./local-ci-02-build.sh` (ou `macos`) ; `WINDOWS_ARCHES=amd64` pour une seule architecture Windows. |
| 17 | -- **Tagger sans pousser** : `scripts/tag-release.sh --no-push`, puis `git push origin v<version>` le moment venu. | 22 | +- **Construction non signée** : laissez `SIGN_IDENTITY` vide. |
| 18 | -- **Mauvais tag** : `git push origin :refs/tags/v<version>` et `git tag -d v<version>`, supprimez la release si elle a été créée, corrigez la version et taggez à nouveau. | 23 | +- **Seulement les paquets non signés** : `make release-build` (dans `dist/`). |
| 19 | -- **Un seul système** : `make package-macos`, `make package-windows` (les deux architectures) ou `make package-linux` (sous Linux, pour l'architecture de la machine). | 24 | +- **Mauvaise release** : supprimez la release et son tag sur Rickub, corrigez, reprenez à l'étape 4. |
| 20 | 25 | ||
| 21 | ## Voir aussi | 26 | ## Voir aussi |
| 22 | 27 | ||
| 28 | +- [Définir la version](definir-la-version.md) | ||
| 23 | - [Signer et notariser Sidekicks pour macOS](signer-et-notariser-sous-macos.md) | 29 | - [Signer et notariser Sidekicks pour macOS](signer-et-notariser-sous-macos.md) |
| 24 | - [Installer Sidekicks](installer-sidekicks.md) | 30 | - [Installer Sidekicks](installer-sidekicks.md) |
| 25 | -- [Référence : commandes](../reference/commandes.md) — `make release-*`, `scripts/build-release.sh`, `scripts/tag-release.sh`, le workflow Release | 31 | +- [Référence : commandes](../reference/commandes.md) — `make release-*`, `scripts/build-release.sh`, `local-ci-*.sh` |
modified
docs/fr/how-to/signer-et-notariser-sous-macos.md +2 -2 | @@ -3,7 +3,7 @@ | ||
| 3 | 3 | Ce guide montre comment signer Sidekicks avec un certificat **Developer ID** et le faire **notariser** par Apple, pour qu'il s'ouvre sur n'importe quel Mac sans passer par **Ouvrir quand même**. Il suppose une adhésion payante à l'Apple Developer Program dont vous êtes le **titulaire du compte** (Account Holder : seul ce rôle peut créer un certificat Developer ID), un Mac Apple Silicon avec les outils de développement du projet ([Développer l'application](developper-l-application.md)), et une release déjà construite comme le décrit [RELEASING.fr.md](../../../RELEASING.fr.md). |
| 4 | 4 | |
| 5 | 5 | - La **partie A** se fait **une seule fois** (compter 30 minutes). |
| 6 | -- La **partie B** se fait **à chaque release**, après `make release-build`, tant que la signature n'est pas automatisée (issue #58). Comptez 10 à 20 minutes, surtout de l'attente chez Apple. | |
| 6 | +- La **partie B** est ce que fait `local-ci-02-build.sh` à chaque release quand `SIGN_IDENTITY` est fixé dans `.release.env` (il lit `SIDEKICKS_SIGN_IDENTITY` et `SIDEKICKS_NOTARY_PROFILE`). Ne la faites à la main que pour la comprendre ou refaire une étape. Comptez 10 à 20 minutes, surtout de l'attente chez Apple. | |
| 7 | 7 | |
| 8 | 8 | Gardez une fenêtre du Terminal ouverte à la racine du dépôt. |
| 9 | 9 | |
| @@ -87,7 +87,7 @@ export SIDEKICKS_SIGN_IDENTITY="Developer ID Application: Prénom Nom (AB12CD34E | ||
| 87 | 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" |
| 88 | 88 | ``` |
| 89 | 89 | |
| 90 | -La partie B les utilise ; l'automatisation (issue #58) les utilisera aussi. | |
| 90 | +La partie B et `local-ci-02-build.sh` les utilisent. | |
| 91 | 91 | |
| 92 | 92 | ### A8. Garder l'identifiant de l'app |
| 93 | 93 | |
| @@ -3,7 +3,7 @@ | |||
| 3 | Ce guide montre comment signer Sidekicks avec un certificat **Developer ID** et le faire **notariser** par Apple, pour qu'il s'ouvre sur n'importe quel Mac sans passer par **Ouvrir quand même**. Il suppose une adhésion payante à l'Apple Developer Program dont vous êtes le **titulaire du compte** (Account Holder : seul ce rôle peut créer un certificat Developer ID), un Mac Apple Silicon avec les outils de développement du projet ([Développer l'application](developper-l-application.md)), et une release déjà construite comme le décrit [RELEASING.fr.md](../../../RELEASING.fr.md). | 3 | Ce guide montre comment signer Sidekicks avec un certificat **Developer ID** et le faire **notariser** par Apple, pour qu'il s'ouvre sur n'importe quel Mac sans passer par **Ouvrir quand même**. Il suppose une adhésion payante à l'Apple Developer Program dont vous êtes le **titulaire du compte** (Account Holder : seul ce rôle peut créer un certificat Developer ID), un Mac Apple Silicon avec les outils de développement du projet ([Développer l'application](developper-l-application.md)), et une release déjà construite comme le décrit [RELEASING.fr.md](../../../RELEASING.fr.md). |
| 4 | 4 | ||
| 5 | - La **partie A** se fait **une seule fois** (compter 30 minutes). | 5 | - La **partie A** se fait **une seule fois** (compter 30 minutes). |
| 6 | -- La **partie B** se fait **à chaque release**, après `make release-build`, tant que la signature n'est pas automatisée (issue #58). Comptez 10 à 20 minutes, surtout de l'attente chez Apple. | 6 | +- La **partie B** est ce que fait `local-ci-02-build.sh` à chaque release quand `SIGN_IDENTITY` est fixé dans `.release.env` (il lit `SIDEKICKS_SIGN_IDENTITY` et `SIDEKICKS_NOTARY_PROFILE`). Ne la faites à la main que pour la comprendre ou refaire une étape. Comptez 10 à 20 minutes, surtout de l'attente chez Apple. |
| 7 | 7 | ||
| 8 | Gardez une fenêtre du Terminal ouverte à la racine du dépôt. | 8 | Gardez une fenêtre du Terminal ouverte à la racine du dépôt. |
| 9 | 9 | ||
| @@ -87,7 +87,7 @@ export SIDEKICKS_SIGN_IDENTITY="Developer ID Application: Prénom Nom (AB12CD34E | |||
| 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" | 87 | export SIDEKICKS_NOTARY_PROFILE="sidekicks-notary" |
| 88 | ``` | 88 | ``` |
| 89 | 89 | ||
| 90 | -La partie B les utilise ; l'automatisation (issue #58) les utilisera aussi. | 90 | +La partie B et `local-ci-02-build.sh` les utilisent. |
| 91 | 91 | ||
| 92 | ### A8. Garder l'identifiant de l'app | 92 | ### A8. Garder l'identifiant de l'app |
| 93 | 93 | ||
added
docs/fr/how-to/tester-la-ci-locale.md +170 -0 | new file mode 100644 | ||
| @@ -0,0 +1,170 @@ | ||
| 1 | +# Tester la CI locale de release (guide temporaire) | |
| 2 | + | |
| 3 | +> Guide **temporaire**, en français seulement : il sert à valider une première fois la nouvelle méthode de release (scripts `local-ci-*.sh`, signature et notarisation, `.dmg`, branche temporaire d'envoi). Une fois la méthode éprouvée, il est supprimé ; la procédure durable est [RELEASING.fr.md](../../../RELEASING.fr.md). | |
| 4 | + | |
| 5 | +Ce guide vérifie sur le Mac, avec la release de test **v9.9.9**, chaque étape de la CI locale, puis ce que voit un utilisateur qui télécharge. Il suppose : | |
| 6 | + | |
| 7 | +- la signature préparée ([partie A du guide de signature](signer-et-notariser-sous-macos.md)) : `security find-identity -v -p codesigning` montre le certificat, `xcrun notarytool history --keychain-profile sidekicks-notary` répond sans erreur ; | |
| 8 | +- `SIDEKICKS_SIGN_IDENTITY` et `SIDEKICKS_NOTARY_PROFILE` dans l'environnement (`echo "$SIDEKICKS_SIGN_IDENTITY"`), `jq` et `makensis` installés (`brew install jq makensis zip`) ; | |
| 9 | +- les outils de [Développer l'application](developper-l-application.md). | |
| 10 | + | |
| 11 | +Comptez 45 minutes, surtout l'attente d'Apple (deux notarisations). **Mettez en pause la synchronisation de kDrive** si vous le pouvez ; les scripts signent dans un dossier temporaire, mais la pause évite des surprises. Gardez un Terminal ouvert à la racine du dépôt. | |
| 12 | + | |
| 13 | +## 0. Préparer | |
| 14 | + | |
| 15 | +1. La branche : `git switch main && git pull`, arbre propre (`git status`). Les changements de la CI locale (scripts `local-ci-*.sh`, `.github.bak/`, docs) doivent être **commités et poussés** : l'étape 3 refuse sinon. | |
| 16 | +2. `.release.env` : `TAG="v9.9.9"`, `OWNER="bots-garden"`, `REPO="sidekicks"`. | |
| 17 | +3. `.ci.cd.token.env` : `CI_TOKEN=…` (fichier de mode 600). Vérifiez que le jeton est accepté : | |
| 18 | + | |
| 19 | + ```bash | |
| 20 | + source .ci.cd.token.env | |
| 21 | + curl -sS -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $CI_TOKEN" https://rickub.com/api/v1/repos/bots-garden/sidekicks/releases | |
| 22 | + ``` | |
| 23 | + | |
| 24 | + Attendu : `200`. `401` ou `403` : le jeton, copié de mini-me, n'a pas les droits sur ce dépôt ; créez-en un pour sidekicks. | |
| 25 | +4. Rien d'un essai précédent : pas de release `v9.9.9` sur Rickub, pas de branche `local-ci-publish-v9.9.9` (`git ls-remote origin 'refs/heads/local-ci-publish-*'` ne répond rien). | |
| 26 | + | |
| 27 | +- [ ] Arbre propre, poussé ; jeton accepté (`200`) ; aucun reste d'un essai. | |
| 28 | + | |
| 29 | +## 1. La synchronisation de la version | |
| 30 | + | |
| 31 | +```bash | |
| 32 | +scripts/sync-build-assets.sh --check # attendu : build assets are in sync with info.version 1.2.0 (LSMinimumSystemVersion 13.0.0) | |
| 33 | +``` | |
| 34 | + | |
| 35 | +Puis provoquez le défaut que le script corrige : | |
| 36 | + | |
| 37 | +```bash | |
| 38 | +sed -i '' '/LSMinimumSystemVersion/{n;s/13.0.0/12.0.0/;}' build/darwin/Info.plist | |
| 39 | +scripts/sync-build-assets.sh --check # attendu : échec, « LSMinimumSystemVersion is not 13.0.0 » | |
| 40 | +scripts/sync-build-assets.sh # attendu : « in sync », via wails3 task common:update:build-assets | |
| 41 | +git status --short build # attendu : rien (le fichier est revenu à son état commité) | |
| 42 | +``` | |
| 43 | + | |
| 44 | +- [ ] `--check` passe, puis échoue sur le plist abîmé. | |
| 45 | +- [ ] Le script répare le plist : `git status` ne montre aucun changement dans `build/`. | |
| 46 | +- [ ] Si `git status` montre d'autres fichiers de `build/` modifiés (icônes, `Info.dev.plist`…), notez lesquels : c'est que le générateur n'est pas idempotent et que l'étape 2 s'arrêtera à chaque fois. Ce serait un défaut à corriger dans `scripts/sync-build-assets.sh`. | |
| 47 | + | |
| 48 | +## 2. Étape 1 : les vérifications | |
| 49 | + | |
| 50 | +```bash | |
| 51 | +./local-ci-01-check.sh # attendu : « ✅ checks passed » | |
| 52 | +``` | |
| 53 | + | |
| 54 | +- [ ] `make verify` passe (lint, tests, bindings). | |
| 55 | + | |
| 56 | +## 3. Étape 2 : construire, signer, notariser | |
| 57 | + | |
| 58 | +Une fois sans signature pour la mécanique, une fois avec. `.release.env` est relu par le script et l'emporte sur l'environnement : pour l'essai non signé, utilisez un fichier de réglages temporaire. | |
| 59 | + | |
| 60 | +```bash | |
| 61 | +printf 'TAG="v9.9.9"\nOWNER="bots-garden"\nREPO="sidekicks"\nSIGN_IDENTITY=""\n' > /tmp/sans-signature.env | |
| 62 | +LOCAL_CI_ENV_FILE=/tmp/sans-signature.env ./local-ci-02-build.sh | |
| 63 | +# attendu : « ⚠️ the macOS packages are not signed », puis « ✅ release/v9.9.9/ is ready » | |
| 64 | +``` | |
| 65 | + | |
| 66 | +Puis le vrai essai, signé : | |
| 67 | + | |
| 68 | +```bash | |
| 69 | +./local-ci-02-build.sh | |
| 70 | +``` | |
| 71 | + | |
| 72 | +Attendu, dans l'ordre : « build assets are in sync… », le build de chaque plateforme, « app signed (Developer ID, hardened runtime, timestamp) », « waiting for Apple's notary service (the app…) », « app notarized … and stapled », « dmg signed, notarized … and stapled », « Staging release/v9.9.9/ », la liste des sommes, « ✅ release/v9.9.9/ is ready ». | |
| 73 | + | |
| 74 | +Vérifiez ensuite : | |
| 75 | + | |
| 76 | +```bash | |
| 77 | +ls -l release/v9.9.9 # 2 fichiers macOS, 2 installateurs/zip Windows ×2, SHA256SUMS, macos-signature.txt | |
| 78 | +cat release/v9.9.9/macos-signature.txt # Authority=Developer ID Application…, TeamIdentifier, deux notarisations Accepted | |
| 79 | +(cd release/v9.9.9 && shasum -a 256 -c SHA256SUMS) # tous « OK » | |
| 80 | +spctl -a -vvv -t open --context context:primary-signature release/v9.9.9/Sidekicks-1.2.0-macos-arm64.dmg | |
| 81 | + # attendu : accepted, source=Notarized Developer ID | |
| 82 | +xcrun stapler validate release/v9.9.9/Sidekicks-1.2.0-macos-arm64.dmg # attendu : The validate action worked! | |
| 83 | +``` | |
| 84 | + | |
| 85 | +Les paquets s'appellent `…1.2.0…` alors que le tag est `v9.9.9` : c'est voulu (la version vient de `build/config.yml`). | |
| 86 | + | |
| 87 | +- [ ] Les deux notarisations sont `Accepted` ; `SHA256SUMS` est juste ; `spctl` et `stapler` sont contents. | |
| 88 | +- [ ] Le `.zip` macOS contient l'app agrafée : `ditto -x -k release/v9.9.9/Sidekicks-1.2.0-macos-arm64.zip /tmp/zipcheck && xcrun stapler validate /tmp/zipcheck/sidekicks.app`. | |
| 89 | + | |
| 90 | +## 4. Les refus de l'étape 3 | |
| 91 | + | |
| 92 | +Avant de créer quoi que ce soit, vérifiez que les garde-fous parlent : | |
| 93 | + | |
| 94 | +1. Modifiez un fichier suivi (`echo >> README.md`) : `./local-ci-03-create-draft.sh` doit répondre « the working tree is not clean ». Annulez : `git checkout README.md`. | |
| 95 | +2. Un tag qui n'est pas la version : mettez `TAG="v1.5.0"` dans un fichier `/tmp/essai.env` et lancez `LOCAL_CI_ENV_FILE=/tmp/essai.env ./local-ci-02-build.sh` : « TAG is v1.5.0 but build/config.yml says 1.2.0 » (avant tout build). | |
| 96 | +3. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` : les notes s'affichent (version, commit, « signed … notarized », liens d'installation, tableau des fichiers, sommes) et **rien n'est créé** (vérifiez sur Rickub). | |
| 97 | + | |
| 98 | +- [ ] Les trois refus ou aperçus se comportent comme attendu. | |
| 99 | + | |
| 100 | +## 5. Étape 3 : le brouillon | |
| 101 | + | |
| 102 | +```bash | |
| 103 | +./local-ci-03-create-draft.sh # attendu : « ✅ draft v9.9.9 created » | |
| 104 | +``` | |
| 105 | + | |
| 106 | +Sur Rickub (**Releases**), le brouillon `Sidekicks v9.9.9` est visible de vous seul, marqué préversion, avec les notes. Relancer la commande doit répondre « the release v9.9.9 already exists ». | |
| 107 | + | |
| 108 | +- [ ] Brouillon créé, notes lisibles, deuxième lancement refusé. | |
| 109 | + | |
| 110 | +## 6. Étape 4 : l'envoi | |
| 111 | + | |
| 112 | +```bash | |
| 113 | +./local-ci-04-upload.sh | |
| 114 | +``` | |
| 115 | + | |
| 116 | +Attendu : « preparing the temporary branch », « pushing local-ci-publish-v9.9.9 », des lignes `run N: …` toutes les 10 secondes, `uploaded …` pour chaque fichier, « deleting the branch », puis « ✅ N files on the draft v9.9.9 ». | |
| 117 | + | |
| 118 | +Pendant l'attente, regardez l'onglet **Actions** de Rickub : un job « local ci publish » tourne. Ensuite : | |
| 119 | + | |
| 120 | +```bash | |
| 121 | +git ls-remote origin 'refs/heads/local-ci-publish-*' # attendu : rien, la branche est supprimée | |
| 122 | +git status --short # attendu : rien, le dépôt local n'a pas été touché | |
| 123 | +``` | |
| 124 | + | |
| 125 | +- [ ] Tous les fichiers sont sur le brouillon (page de la release) ; la branche temporaire a disparu ; le dépôt local est intact. | |
| 126 | + | |
| 127 | +## 7. Étape 5 : la publication | |
| 128 | + | |
| 129 | +```bash | |
| 130 | +./local-ci-05-publish.sh | |
| 131 | +``` | |
| 132 | + | |
| 133 | +Tapez d'abord un mauvais texte : « not published ». Relancez et tapez `v9.9.9`. Attendu : « published », le téléchargement de chaque fichier public, `sha256sum -c` en `OK`, `/releases/latest -> …/v9.9.9`, « ✅ v9.9.9 is public ». (Sous macOS, `sha256sum` peut manquer : le script le signale ; `brew install coreutils`, ou comparez à la main avec `shasum -a 256`.) | |
| 134 | + | |
| 135 | +- [ ] Refus sur mauvaise saisie ; publication ; les fichiers publics ont les bonnes sommes. | |
| 136 | + | |
| 137 | +## 8. Ce que voit l'utilisateur | |
| 138 | + | |
| 139 | +1. Téléchargez le `.dmg` **depuis la page de la release, dans un navigateur**, sur un autre Mac ou un autre compte (il doit porter l'attribut de quarantaine d'un vrai téléchargement). | |
| 140 | +2. Ouvrez-le, glissez **sidekicks** dans **Applications**, lancez : l'application s'ouvre **directement**, sans **Ouvrir quand même**. | |
| 141 | +3. **Sidekicks → À propos** (ou la barre d'état) indique la version `1.2.0` ; sur un Mac sous macOS 12, le système doit la refuser (`LSMinimumSystemVersion`). | |
| 142 | +4. Parcourez ce que le runtime durci peut gêner : un agent local, un agent en conteneur ou sbx, l'onglet Terminal, ouvrir un fichier, glisser-déposer, **Réglages → Open…**. En cas de panne, voir « The signed app does not start » dans le guide de signature (entitlements). | |
| 143 | +5. Facultatif, `./local-ci-06-promote.sh` : tapez `v9.9.9` ; la release perd son étiquette de préversion, `/releases/latest` ne change pas. | |
| 144 | + | |
| 145 | +- [ ] L'application s'ouvre sans avertissement et fonctionne. | |
| 146 | + | |
| 147 | +## 9. Nettoyer | |
| 148 | + | |
| 149 | +La release de test ne doit pas rester : elle est la « dernière » version pour tout le monde. | |
| 150 | + | |
| 151 | +1. Sur Rickub, supprimez la release **v9.9.9**, puis son tag **v9.9.9** (la suppression de la release ne supprime pas toujours le tag). | |
| 152 | +2. Vérifiez : `git fetch --prune --tags origin && git tag --list 'v9.9.9'` ne répond rien ; `curl -sI https://rickub.com/bots-garden/sidekicks/releases/latest` redirige de nouveau vers la dernière vraie release (ou 404 s'il n'y en a pas). | |
| 153 | +3. `rm -rf release/v9.9.9 dist` (ignorés par git). | |
| 154 | +4. Reprenez la synchronisation de kDrive. | |
| 155 | +5. Passez `TAG` à la version réelle dans `.release.env` quand vous voudrez publier pour de bon. | |
| 156 | + | |
| 157 | +## Si quelque chose échoue | |
| 158 | + | |
| 159 | +| Symptôme | Que faire | | |
| 160 | +| --- | --- | | |
| 161 | +| L'étape 2 s'arrête : « the sync changed the build assets » | Relisez `git diff build/`, commitez, poussez, relancez. Si cela revient à chaque fois, voir la case de l'étape 1. | | |
| 162 | +| `no valid identity` / `the notarytool profile … does not work` | Les commandes affichées dans le message ; partie A du guide de signature. | | |
| 163 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"` donne la raison. | | |
| 164 | +| `wails3 tool package` échoue | Même commande que dans la partie B5 du guide de signature : lancez-la à la main pour voir l'erreur. | | |
| 165 | +| L'étape 3 : `HTTP 401` ou `403` | Le jeton (étape 0.3). | | |
| 166 | +| L'étape 3 : « still has .github/workflows » | Le commit qui renomme `.github` en `.github.bak` n'est pas poussé. | | |
| 167 | +| L'étape 4 : « the job did not succeed » | Lisez les lignes du journal affichées ; la branche temporaire est supprimée, sinon `git push origin --delete local-ci-publish-v9.9.9`. | | |
| 168 | +| L'étape 4 attend sans fin | Aucun runner ne prend le job : regardez **Actions** sur Rickub ; le script abandonne après 15 minutes et supprime la branche. | | |
| 169 | + | |
| 170 | +Notez ce qui a surpris ou échoué (message exact, étape) : c'est ce qui sert à corriger les scripts avant la première vraie release. | |
| new file mode 100644 | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | +# Tester la CI locale de release (guide temporaire) | ||
| 2 | + | ||
| 3 | +> Guide **temporaire**, en français seulement : il sert à valider une première fois la nouvelle méthode de release (scripts `local-ci-*.sh`, signature et notarisation, `.dmg`, branche temporaire d'envoi). Une fois la méthode éprouvée, il est supprimé ; la procédure durable est [RELEASING.fr.md](../../../RELEASING.fr.md). | ||
| 4 | + | ||
| 5 | +Ce guide vérifie sur le Mac, avec la release de test **v9.9.9**, chaque étape de la CI locale, puis ce que voit un utilisateur qui télécharge. Il suppose : | ||
| 6 | + | ||
| 7 | +- la signature préparée ([partie A du guide de signature](signer-et-notariser-sous-macos.md)) : `security find-identity -v -p codesigning` montre le certificat, `xcrun notarytool history --keychain-profile sidekicks-notary` répond sans erreur ; | ||
| 8 | +- `SIDEKICKS_SIGN_IDENTITY` et `SIDEKICKS_NOTARY_PROFILE` dans l'environnement (`echo "$SIDEKICKS_SIGN_IDENTITY"`), `jq` et `makensis` installés (`brew install jq makensis zip`) ; | ||
| 9 | +- les outils de [Développer l'application](developper-l-application.md). | ||
| 10 | + | ||
| 11 | +Comptez 45 minutes, surtout l'attente d'Apple (deux notarisations). **Mettez en pause la synchronisation de kDrive** si vous le pouvez ; les scripts signent dans un dossier temporaire, mais la pause évite des surprises. Gardez un Terminal ouvert à la racine du dépôt. | ||
| 12 | + | ||
| 13 | +## 0. Préparer | ||
| 14 | + | ||
| 15 | +1. La branche : `git switch main && git pull`, arbre propre (`git status`). Les changements de la CI locale (scripts `local-ci-*.sh`, `.github.bak/`, docs) doivent être **commités et poussés** : l'étape 3 refuse sinon. | ||
| 16 | +2. `.release.env` : `TAG="v9.9.9"`, `OWNER="bots-garden"`, `REPO="sidekicks"`. | ||
| 17 | +3. `.ci.cd.token.env` : `CI_TOKEN=…` (fichier de mode 600). Vérifiez que le jeton est accepté : | ||
| 18 | + | ||
| 19 | + ```bash | ||
| 20 | + source .ci.cd.token.env | ||
| 21 | + curl -sS -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $CI_TOKEN" https://rickub.com/api/v1/repos/bots-garden/sidekicks/releases | ||
| 22 | + ``` | ||
| 23 | + | ||
| 24 | + Attendu : `200`. `401` ou `403` : le jeton, copié de mini-me, n'a pas les droits sur ce dépôt ; créez-en un pour sidekicks. | ||
| 25 | +4. Rien d'un essai précédent : pas de release `v9.9.9` sur Rickub, pas de branche `local-ci-publish-v9.9.9` (`git ls-remote origin 'refs/heads/local-ci-publish-*'` ne répond rien). | ||
| 26 | + | ||
| 27 | +- [ ] Arbre propre, poussé ; jeton accepté (`200`) ; aucun reste d'un essai. | ||
| 28 | + | ||
| 29 | +## 1. La synchronisation de la version | ||
| 30 | + | ||
| 31 | +```bash | ||
| 32 | +scripts/sync-build-assets.sh --check # attendu : build assets are in sync with info.version 1.2.0 (LSMinimumSystemVersion 13.0.0) | ||
| 33 | +``` | ||
| 34 | + | ||
| 35 | +Puis provoquez le défaut que le script corrige : | ||
| 36 | + | ||
| 37 | +```bash | ||
| 38 | +sed -i '' '/LSMinimumSystemVersion/{n;s/13.0.0/12.0.0/;}' build/darwin/Info.plist | ||
| 39 | +scripts/sync-build-assets.sh --check # attendu : échec, « LSMinimumSystemVersion is not 13.0.0 » | ||
| 40 | +scripts/sync-build-assets.sh # attendu : « in sync », via wails3 task common:update:build-assets | ||
| 41 | +git status --short build # attendu : rien (le fichier est revenu à son état commité) | ||
| 42 | +``` | ||
| 43 | + | ||
| 44 | +- [ ] `--check` passe, puis échoue sur le plist abîmé. | ||
| 45 | +- [ ] Le script répare le plist : `git status` ne montre aucun changement dans `build/`. | ||
| 46 | +- [ ] Si `git status` montre d'autres fichiers de `build/` modifiés (icônes, `Info.dev.plist`…), notez lesquels : c'est que le générateur n'est pas idempotent et que l'étape 2 s'arrêtera à chaque fois. Ce serait un défaut à corriger dans `scripts/sync-build-assets.sh`. | ||
| 47 | + | ||
| 48 | +## 2. Étape 1 : les vérifications | ||
| 49 | + | ||
| 50 | +```bash | ||
| 51 | +./local-ci-01-check.sh # attendu : « ✅ checks passed » | ||
| 52 | +``` | ||
| 53 | + | ||
| 54 | +- [ ] `make verify` passe (lint, tests, bindings). | ||
| 55 | + | ||
| 56 | +## 3. Étape 2 : construire, signer, notariser | ||
| 57 | + | ||
| 58 | +Une fois sans signature pour la mécanique, une fois avec. `.release.env` est relu par le script et l'emporte sur l'environnement : pour l'essai non signé, utilisez un fichier de réglages temporaire. | ||
| 59 | + | ||
| 60 | +```bash | ||
| 61 | +printf 'TAG="v9.9.9"\nOWNER="bots-garden"\nREPO="sidekicks"\nSIGN_IDENTITY=""\n' > /tmp/sans-signature.env | ||
| 62 | +LOCAL_CI_ENV_FILE=/tmp/sans-signature.env ./local-ci-02-build.sh | ||
| 63 | +# attendu : « ⚠️ the macOS packages are not signed », puis « ✅ release/v9.9.9/ is ready » | ||
| 64 | +``` | ||
| 65 | + | ||
| 66 | +Puis le vrai essai, signé : | ||
| 67 | + | ||
| 68 | +```bash | ||
| 69 | +./local-ci-02-build.sh | ||
| 70 | +``` | ||
| 71 | + | ||
| 72 | +Attendu, dans l'ordre : « build assets are in sync… », le build de chaque plateforme, « app signed (Developer ID, hardened runtime, timestamp) », « waiting for Apple's notary service (the app…) », « app notarized … and stapled », « dmg signed, notarized … and stapled », « Staging release/v9.9.9/ », la liste des sommes, « ✅ release/v9.9.9/ is ready ». | ||
| 73 | + | ||
| 74 | +Vérifiez ensuite : | ||
| 75 | + | ||
| 76 | +```bash | ||
| 77 | +ls -l release/v9.9.9 # 2 fichiers macOS, 2 installateurs/zip Windows ×2, SHA256SUMS, macos-signature.txt | ||
| 78 | +cat release/v9.9.9/macos-signature.txt # Authority=Developer ID Application…, TeamIdentifier, deux notarisations Accepted | ||
| 79 | +(cd release/v9.9.9 && shasum -a 256 -c SHA256SUMS) # tous « OK » | ||
| 80 | +spctl -a -vvv -t open --context context:primary-signature release/v9.9.9/Sidekicks-1.2.0-macos-arm64.dmg | ||
| 81 | + # attendu : accepted, source=Notarized Developer ID | ||
| 82 | +xcrun stapler validate release/v9.9.9/Sidekicks-1.2.0-macos-arm64.dmg # attendu : The validate action worked! | ||
| 83 | +``` | ||
| 84 | + | ||
| 85 | +Les paquets s'appellent `…1.2.0…` alors que le tag est `v9.9.9` : c'est voulu (la version vient de `build/config.yml`). | ||
| 86 | + | ||
| 87 | +- [ ] Les deux notarisations sont `Accepted` ; `SHA256SUMS` est juste ; `spctl` et `stapler` sont contents. | ||
| 88 | +- [ ] Le `.zip` macOS contient l'app agrafée : `ditto -x -k release/v9.9.9/Sidekicks-1.2.0-macos-arm64.zip /tmp/zipcheck && xcrun stapler validate /tmp/zipcheck/sidekicks.app`. | ||
| 89 | + | ||
| 90 | +## 4. Les refus de l'étape 3 | ||
| 91 | + | ||
| 92 | +Avant de créer quoi que ce soit, vérifiez que les garde-fous parlent : | ||
| 93 | + | ||
| 94 | +1. Modifiez un fichier suivi (`echo >> README.md`) : `./local-ci-03-create-draft.sh` doit répondre « the working tree is not clean ». Annulez : `git checkout README.md`. | ||
| 95 | +2. Un tag qui n'est pas la version : mettez `TAG="v1.5.0"` dans un fichier `/tmp/essai.env` et lancez `LOCAL_CI_ENV_FILE=/tmp/essai.env ./local-ci-02-build.sh` : « TAG is v1.5.0 but build/config.yml says 1.2.0 » (avant tout build). | ||
| 96 | +3. `LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.sh` : les notes s'affichent (version, commit, « signed … notarized », liens d'installation, tableau des fichiers, sommes) et **rien n'est créé** (vérifiez sur Rickub). | ||
| 97 | + | ||
| 98 | +- [ ] Les trois refus ou aperçus se comportent comme attendu. | ||
| 99 | + | ||
| 100 | +## 5. Étape 3 : le brouillon | ||
| 101 | + | ||
| 102 | +```bash | ||
| 103 | +./local-ci-03-create-draft.sh # attendu : « ✅ draft v9.9.9 created » | ||
| 104 | +``` | ||
| 105 | + | ||
| 106 | +Sur Rickub (**Releases**), le brouillon `Sidekicks v9.9.9` est visible de vous seul, marqué préversion, avec les notes. Relancer la commande doit répondre « the release v9.9.9 already exists ». | ||
| 107 | + | ||
| 108 | +- [ ] Brouillon créé, notes lisibles, deuxième lancement refusé. | ||
| 109 | + | ||
| 110 | +## 6. Étape 4 : l'envoi | ||
| 111 | + | ||
| 112 | +```bash | ||
| 113 | +./local-ci-04-upload.sh | ||
| 114 | +``` | ||
| 115 | + | ||
| 116 | +Attendu : « preparing the temporary branch », « pushing local-ci-publish-v9.9.9 », des lignes `run N: …` toutes les 10 secondes, `uploaded …` pour chaque fichier, « deleting the branch », puis « ✅ N files on the draft v9.9.9 ». | ||
| 117 | + | ||
| 118 | +Pendant l'attente, regardez l'onglet **Actions** de Rickub : un job « local ci publish » tourne. Ensuite : | ||
| 119 | + | ||
| 120 | +```bash | ||
| 121 | +git ls-remote origin 'refs/heads/local-ci-publish-*' # attendu : rien, la branche est supprimée | ||
| 122 | +git status --short # attendu : rien, le dépôt local n'a pas été touché | ||
| 123 | +``` | ||
| 124 | + | ||
| 125 | +- [ ] Tous les fichiers sont sur le brouillon (page de la release) ; la branche temporaire a disparu ; le dépôt local est intact. | ||
| 126 | + | ||
| 127 | +## 7. Étape 5 : la publication | ||
| 128 | + | ||
| 129 | +```bash | ||
| 130 | +./local-ci-05-publish.sh | ||
| 131 | +``` | ||
| 132 | + | ||
| 133 | +Tapez d'abord un mauvais texte : « not published ». Relancez et tapez `v9.9.9`. Attendu : « published », le téléchargement de chaque fichier public, `sha256sum -c` en `OK`, `/releases/latest -> …/v9.9.9`, « ✅ v9.9.9 is public ». (Sous macOS, `sha256sum` peut manquer : le script le signale ; `brew install coreutils`, ou comparez à la main avec `shasum -a 256`.) | ||
| 134 | + | ||
| 135 | +- [ ] Refus sur mauvaise saisie ; publication ; les fichiers publics ont les bonnes sommes. | ||
| 136 | + | ||
| 137 | +## 8. Ce que voit l'utilisateur | ||
| 138 | + | ||
| 139 | +1. Téléchargez le `.dmg` **depuis la page de la release, dans un navigateur**, sur un autre Mac ou un autre compte (il doit porter l'attribut de quarantaine d'un vrai téléchargement). | ||
| 140 | +2. Ouvrez-le, glissez **sidekicks** dans **Applications**, lancez : l'application s'ouvre **directement**, sans **Ouvrir quand même**. | ||
| 141 | +3. **Sidekicks → À propos** (ou la barre d'état) indique la version `1.2.0` ; sur un Mac sous macOS 12, le système doit la refuser (`LSMinimumSystemVersion`). | ||
| 142 | +4. Parcourez ce que le runtime durci peut gêner : un agent local, un agent en conteneur ou sbx, l'onglet Terminal, ouvrir un fichier, glisser-déposer, **Réglages → Open…**. En cas de panne, voir « The signed app does not start » dans le guide de signature (entitlements). | ||
| 143 | +5. Facultatif, `./local-ci-06-promote.sh` : tapez `v9.9.9` ; la release perd son étiquette de préversion, `/releases/latest` ne change pas. | ||
| 144 | + | ||
| 145 | +- [ ] L'application s'ouvre sans avertissement et fonctionne. | ||
| 146 | + | ||
| 147 | +## 9. Nettoyer | ||
| 148 | + | ||
| 149 | +La release de test ne doit pas rester : elle est la « dernière » version pour tout le monde. | ||
| 150 | + | ||
| 151 | +1. Sur Rickub, supprimez la release **v9.9.9**, puis son tag **v9.9.9** (la suppression de la release ne supprime pas toujours le tag). | ||
| 152 | +2. Vérifiez : `git fetch --prune --tags origin && git tag --list 'v9.9.9'` ne répond rien ; `curl -sI https://rickub.com/bots-garden/sidekicks/releases/latest` redirige de nouveau vers la dernière vraie release (ou 404 s'il n'y en a pas). | ||
| 153 | +3. `rm -rf release/v9.9.9 dist` (ignorés par git). | ||
| 154 | +4. Reprenez la synchronisation de kDrive. | ||
| 155 | +5. Passez `TAG` à la version réelle dans `.release.env` quand vous voudrez publier pour de bon. | ||
| 156 | + | ||
| 157 | +## Si quelque chose échoue | ||
| 158 | + | ||
| 159 | +| Symptôme | Que faire | | ||
| 160 | +| --- | --- | | ||
| 161 | +| L'étape 2 s'arrête : « the sync changed the build assets » | Relisez `git diff build/`, commitez, poussez, relancez. Si cela revient à chaque fois, voir la case de l'étape 1. | | ||
| 162 | +| `no valid identity` / `the notarytool profile … does not work` | Les commandes affichées dans le message ; partie A du guide de signature. | | ||
| 163 | +| `notarization … Invalid` | `xcrun notarytool log <id> --keychain-profile "$SIDEKICKS_NOTARY_PROFILE"` donne la raison. | | ||
| 164 | +| `wails3 tool package` échoue | Même commande que dans la partie B5 du guide de signature : lancez-la à la main pour voir l'erreur. | | ||
| 165 | +| L'étape 3 : `HTTP 401` ou `403` | Le jeton (étape 0.3). | | ||
| 166 | +| L'étape 3 : « still has .github/workflows » | Le commit qui renomme `.github` en `.github.bak` n'est pas poussé. | | ||
| 167 | +| L'étape 4 : « the job did not succeed » | Lisez les lignes du journal affichées ; la branche temporaire est supprimée, sinon `git push origin --delete local-ci-publish-v9.9.9`. | | ||
| 168 | +| L'étape 4 attend sans fin | Aucun runner ne prend le job : regardez **Actions** sur Rickub ; le script abandonne après 15 minutes et supprime la branche. | | ||
| 169 | + | ||
| 170 | +Notez ce qui a surpris ou échoué (message exact, étape) : c'est ce qui sert à corriger les scripts avant la première vraie release. | ||
modified
docs/fr/how-to/verifier-avant-de-fusionner.md +1 -1 | @@ -14,7 +14,7 @@ Sidekicks n'a pas de CI : les vérifications se font sur votre machine. Ce guide | ||
| 14 | 14 | La commande lance `make check` — golangci-lint, svelte-check, les en-têtes de licence, puis les tests Go, frontend et shell — puis `make bindings-check` : les bindings TypeScript sont régénérés et doivent être identiques à ceux indexés. Un passage réussi se termine par : |
| 15 | 15 | |
| 16 | 16 | ```text |
| 17 | - all tag-release tests passed | |
| 17 | + all package tests passed | |
| 18 | 18 | ``` |
| 19 | 19 | |
| 20 | 20 | sans sortie de `git diff`. |
| @@ -14,7 +14,7 @@ Sidekicks n'a pas de CI : les vérifications se font sur votre machine. Ce guide | |||
| 14 | La commande lance `make check` — golangci-lint, svelte-check, les en-têtes de licence, puis les tests Go, frontend et shell — puis `make bindings-check` : les bindings TypeScript sont régénérés et doivent être identiques à ceux indexés. Un passage réussi se termine par : | 14 | La commande lance `make check` — golangci-lint, svelte-check, les en-têtes de licence, puis les tests Go, frontend et shell — puis `make bindings-check` : les bindings TypeScript sont régénérés et doivent être identiques à ceux indexés. Un passage réussi se termine par : |
| 15 | 15 | ||
| 16 | ```text | 16 | ```text |
| 17 | - all tag-release tests passed | 17 | + all package tests passed |
| 18 | ``` | 18 | ``` |
| 19 | 19 | ||
| 20 | sans sortie de `git diff`. | 20 | sans sortie de `git diff`. |
modified
docs/fr/reference/commandes.md +19 -8 | @@ -28,7 +28,8 @@ L'ordre est détaillé dans la [référence de la configuration](configuration.m | ||
| 28 | 28 | | `package-linux` | `scripts/package.sh linux` : `.deb`, `.rpm`, `.AppImage` et `.tar.gz` pour l'architecture de la machine, dans `dist/`. Demande `file` (AppImage) et `rpm`. | |
| 29 | 29 | | `package-windows` | `scripts/package.sh windows amd64` puis `arm64` : installateur NSIS et `.zip` pour chacun, compilés depuis Linux ou macOS, dans `dist/`. Demande `makensis` et `zip`. | |
| 30 | 30 | | `release-build` | `scripts/build-release.sh` : sur le Mac, tous les paquets de release (macOS arm64, Windows amd64 et arm64) dans `dist/` et `SHA256SUMS`. | |
| 31 | -| `release-tag` | `scripts/tag-release.sh` : tague `v<version>` sur `main` et le pousse. | | |
| 31 | +| `release-check` | `local-ci-01-check.sh` : `make verify`. | | |
| 32 | +| `release-package` | `local-ci-02-build.sh` : construit, signe et notarise dans `release/<TAG>/`. | | |
| 32 | 33 | | `package-macos` | `scripts/package.sh macos` : `.dmg` et `.zip` pour Apple Silicon (arm64, signés ad hoc ; pas de build Intel), dans `dist/`. macOS seulement. | |
| 33 | 34 | | `install-test-config` | `scripts/install-test-config.sh` : écrit `examples/test-agents.yaml` à l'emplacement par défaut de la configuration, avec des chemins absolus vers le dépôt : chaque agent est `mm -acp -config agent.yaml` lancé dans son dossier, avec `afterStop: [<dépôt>/scripts/agents.sh, unload, <agent>]` pour décharger son modèle à l'arrêt, `mm` écrit avec son chemin absolu (`MM_BIN`, ou celui du `PATH`), et le `PATH` courant dans l'`env` de chaque agent ; un fichier existant est gardé sous `config.yaml.<date>.bak`. | |
| 34 | 35 | | `check` | `lint` puis `test`. | |
| @@ -37,7 +38,7 @@ L'ordre est détaillé dans la [référence de la configuration](configuration.m | ||
| 37 | 38 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | |
| 38 | 39 | | `test-go` | `go test ./...` (construit `frontend/dist` d'abord s'il manque). | |
| 39 | 40 | | `test-frontend` | `vitest run` dans `frontend/`. | |
| 40 | -| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh` et `scripts/tag-release_test.sh`. | | |
| 41 | +| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh`. | | |
| 41 | 42 | | `test-real` | `go test -tags realagents -count=1 ./...` — nécessite `mm` et llmman. | |
| 42 | 43 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | |
| 43 | 44 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | |
| @@ -66,7 +67,7 @@ scripts/package.sh version | ||
| 66 | 67 | | --- | --- | |
| 67 | 68 | | `linux`, `windows`, `macos` | Construit les paquets de ce système dans `dist/` (voir les cibles `package-*`), puis liste `dist/`. | |
| 68 | 69 | | `names <système> <arch>` | Affiche les noms des fichiers qu'un build produit, un par ligne ; ne construit rien. | |
| 69 | -| `release-names` | Affiche les fichiers d'une release : les noms de chaque cible de `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), puis `SHA256SUMS`. Utilisé par `tag-release.sh` et le workflow Release. | | |
| 70 | +| `release-names` | Affiche les fichiers d'une release : les noms de chaque cible de `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), puis `SHA256SUMS`. Utilisé par `local-ci-02-build.sh`. | | |
| 70 | 71 | | `version` | Affiche `info.version` de `build/config.yml`. | |
| 71 | 72 | |
| 72 | 73 | | Système | Fichiers (`<v>` = version) | |
| @@ -83,14 +84,24 @@ scripts/package.sh version | ||
| 83 | 84 | |
| 84 | 85 | Vérifie d'abord tous les prérequis, puis vide `dist/` et construit : macOS avec `scripts/package.sh macos` (macOS seulement), Windows avec `scripts/package.sh windows <arch>` pour chaque architecture de `WINDOWS_ARCHES` (par défaut `amd64 arm64` ; demande `makensis` et `zip`), et, seulement si `LINUX_ARCHES` est défini (vide par défaut : pas de Linux dans les releases pour le moment), Linux avec `scripts/package.sh linux` dans un conteneur par architecture, construit depuis `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go de `go.mod`, pnpm de `frontend/package.json`, CLI Wails) avec le dépôt monté sur `/src` et le cache des modules Go dans le volume `sidekicks-gomod-<arch>`. Écrit enfin `dist/SHA256SUMS`. `SKIP` laisse de côté les systèmes qu'il nomme. Échoue, avant de rien construire, si un prérequis manque (hôte macOS, `makensis`, `zip`, Docker pour Linux). |
| 85 | 86 | |
| 86 | -## `scripts/tag-release.sh` | |
| 87 | +## `scripts/sync-build-assets.sh` | |
| 87 | 88 | |
| 88 | 89 | ```text |
| 89 | -scripts/tag-release.sh [--remote <nom>] [--no-push] | |
| 90 | +scripts/sync-build-assets.sh [--check] | |
| 90 | 91 | ``` |
| 91 | 92 | |
| 92 | -Crée le tag annoté `v<version>` (`info.version` de `build/config.yml`, message `Sidekicks <version>`) et le pousse sur `--remote` (par défaut `origin`). Refuse si des fichiers suivis sont modifiés, si la branche courante n'est pas `main`, si `main` diffère de `<remote>/main` après un fetch, ou si le tag existe en local. Avertit, sans refuser, s'il manque dans `dist/` un paquet de la version ou `SHA256SUMS`. `--no-push` tague en local seulement. | |
| 93 | +Lance `wails3 task common:update:build-assets` (régénère les Info.plist et les fichiers Windows et Linux à partir de `build/config.yml`), remet `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `Info.dev.plist`, puis vérifie que les deux plist portent `info.version` et `13.0.0`. `--check` vérifie seulement. Lancé par `local-ci-02-build.sh`. Pourquoi : [Définir la version](../how-to/definir-la-version.md). | |
| 93 | 94 | |
| 94 | -## Workflow de release | |
| 95 | +## `local-ci-*.sh` | |
| 95 | 96 | |
| 96 | -`.github/workflows/release.yml`, au push d'un tag `v*`, avec `permissions: contents: write` : échoue si le tag n'est pas `v` + `info.version` de `build/config.yml`, puis crée la release `<tag>` nommée `Sidekicks <tag>` (`softprops/action-gh-release@v2`, via l'API compatible GitHub de Rickub derrière `GITHUB_API_URL`), avec des notes qui donnent le commit, les guides d'installation et le tableau des fichiers attendus (tirés de `scripts/package.sh release-names`). Il n'attache aucun fichier : les paquets sont attachés à la main. | |
| 97 | +La CI locale, à la racine du dépôt (procédure : [RELEASING.fr.md](../../../RELEASING.fr.md)). Tous lisent `.release.env` (`TAG`, `ABOUT`, `OWNER`, `REPO`, `SIGN_IDENTITY`, `NOTARY_PROFILE` ; un autre fichier avec `LOCAL_CI_ENV_FILE`) et, pour Rickub, `CI_TOKEN` dans `.ci.cd.token.env`. | |
| 98 | + | |
| 99 | +| Script | Ce qu'il fait | | |
| 100 | +| --- | --- | | |
| 101 | +| `local-ci-00-common.sh` | Partagé par les autres (sourcé). | | |
| 102 | +| `local-ci-01-check.sh` | `make verify`. | | |
| 103 | +| `local-ci-02-build.sh` | `scripts/build-release.sh`, puis, avec `SIGN_IDENTITY`, signe, notarise et agrafe l'app et le `.dmg` ; range `release/<TAG>/` et son `SHA256SUMS`. `TAG` doit être `v` + `info.version`, ou `v9.9.9…` (test). | | |
| 104 | +| `local-ci-03-create-draft.sh` | Crée le tag et une préversion en brouillon avec ses notes. Refuse un arbre de travail modifié, un `HEAD` qui n'est pas le `main` distant, un `HEAD` qui a `.github/workflows`. `LOCAL_CI_PRINT_NOTES=1` affiche les notes seulement ; `LOCAL_CI_SKIP_GIT_CHECK=1` saute les contrôles git. | | |
| 105 | +| `local-ci-04-upload.sh` | Pousse une branche orpheline temporaire `local-ci-publish-<TAG>` dont le workflow à un job envoie sur le brouillon les fichiers de `SHA256SUMS`, attend le job, supprime la branche. | | |
| 106 | +| `local-ci-05-publish.sh` | Publie le brouillon en préversion après que vous avez tapé le tag, télécharge et compare les fichiers publics. | | |
| 107 | +| `local-ci-06-promote.sh [tag]` | Retire l'étiquette de préversion après que vous avez tapé le tag. | | |
| @@ -28,7 +28,8 @@ L'ordre est détaillé dans la [référence de la configuration](configuration.m | |||
| 28 | | `package-linux` | `scripts/package.sh linux` : `.deb`, `.rpm`, `.AppImage` et `.tar.gz` pour l'architecture de la machine, dans `dist/`. Demande `file` (AppImage) et `rpm`. | | 28 | | `package-linux` | `scripts/package.sh linux` : `.deb`, `.rpm`, `.AppImage` et `.tar.gz` pour l'architecture de la machine, dans `dist/`. Demande `file` (AppImage) et `rpm`. | |
| 29 | | `package-windows` | `scripts/package.sh windows amd64` puis `arm64` : installateur NSIS et `.zip` pour chacun, compilés depuis Linux ou macOS, dans `dist/`. Demande `makensis` et `zip`. | | 29 | | `package-windows` | `scripts/package.sh windows amd64` puis `arm64` : installateur NSIS et `.zip` pour chacun, compilés depuis Linux ou macOS, dans `dist/`. Demande `makensis` et `zip`. | |
| 30 | | `release-build` | `scripts/build-release.sh` : sur le Mac, tous les paquets de release (macOS arm64, Windows amd64 et arm64) dans `dist/` et `SHA256SUMS`. | | 30 | | `release-build` | `scripts/build-release.sh` : sur le Mac, tous les paquets de release (macOS arm64, Windows amd64 et arm64) dans `dist/` et `SHA256SUMS`. | |
| 31 | -| `release-tag` | `scripts/tag-release.sh` : tague `v<version>` sur `main` et le pousse. | | 31 | +| `release-check` | `local-ci-01-check.sh` : `make verify`. | |
| 32 | +| `release-package` | `local-ci-02-build.sh` : construit, signe et notarise dans `release/<TAG>/`. | | ||
| 32 | | `package-macos` | `scripts/package.sh macos` : `.dmg` et `.zip` pour Apple Silicon (arm64, signés ad hoc ; pas de build Intel), dans `dist/`. macOS seulement. | | 33 | | `package-macos` | `scripts/package.sh macos` : `.dmg` et `.zip` pour Apple Silicon (arm64, signés ad hoc ; pas de build Intel), dans `dist/`. macOS seulement. | |
| 33 | | `install-test-config` | `scripts/install-test-config.sh` : écrit `examples/test-agents.yaml` à l'emplacement par défaut de la configuration, avec des chemins absolus vers le dépôt : chaque agent est `mm -acp -config agent.yaml` lancé dans son dossier, avec `afterStop: [<dépôt>/scripts/agents.sh, unload, <agent>]` pour décharger son modèle à l'arrêt, `mm` écrit avec son chemin absolu (`MM_BIN`, ou celui du `PATH`), et le `PATH` courant dans l'`env` de chaque agent ; un fichier existant est gardé sous `config.yaml.<date>.bak`. | | 34 | | `install-test-config` | `scripts/install-test-config.sh` : écrit `examples/test-agents.yaml` à l'emplacement par défaut de la configuration, avec des chemins absolus vers le dépôt : chaque agent est `mm -acp -config agent.yaml` lancé dans son dossier, avec `afterStop: [<dépôt>/scripts/agents.sh, unload, <agent>]` pour décharger son modèle à l'arrêt, `mm` écrit avec son chemin absolu (`MM_BIN`, ou celui du `PATH`), et le `PATH` courant dans l'`env` de chaque agent ; un fichier existant est gardé sous `config.yaml.<date>.bak`. | |
| 34 | | `check` | `lint` puis `test`. | | 35 | | `check` | `lint` puis `test`. | |
| @@ -37,7 +38,7 @@ L'ordre est détaillé dans la [référence de la configuration](configuration.m | |||
| 37 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | | 38 | | `test` | `test-go`, `test-frontend`, `test-scripts`. | |
| 38 | | `test-go` | `go test ./...` (construit `frontend/dist` d'abord s'il manque). | | 39 | | `test-go` | `go test ./...` (construit `frontend/dist` d'abord s'il manque). | |
| 39 | | `test-frontend` | `vitest run` dans `frontend/`. | | 40 | | `test-frontend` | `vitest run` dans `frontend/`. | |
| 40 | -| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh` et `scripts/tag-release_test.sh`. | | 41 | +| `test-scripts` | `scripts/agents_test.sh`, `scripts/check-license-headers_test.sh`, `scripts/package_test.sh`. | |
| 41 | | `test-real` | `go test -tags realagents -count=1 ./...` — nécessite `mm` et llmman. | | 42 | | `test-real` | `go test -tags realagents -count=1 ./...` — nécessite `mm` et llmman. | |
| 42 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | | 43 | | `lint` | `lint-go`, `lint-frontend`, `lint-headers`. | |
| 43 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | | 44 | | `lint-go` | golangci-lint v2.14.0 (`tools/go.mod`), configuration `.golangci.yml`. | |
| @@ -66,7 +67,7 @@ scripts/package.sh version | |||
| 66 | | --- | --- | | 67 | | --- | --- | |
| 67 | | `linux`, `windows`, `macos` | Construit les paquets de ce système dans `dist/` (voir les cibles `package-*`), puis liste `dist/`. | | 68 | | `linux`, `windows`, `macos` | Construit les paquets de ce système dans `dist/` (voir les cibles `package-*`), puis liste `dist/`. | |
| 68 | | `names <système> <arch>` | Affiche les noms des fichiers qu'un build produit, un par ligne ; ne construit rien. | | 69 | | `names <système> <arch>` | Affiche les noms des fichiers qu'un build produit, un par ligne ; ne construit rien. | |
| 69 | -| `release-names` | Affiche les fichiers d'une release : les noms de chaque cible de `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), puis `SHA256SUMS`. Utilisé par `tag-release.sh` et le workflow Release. | | 70 | +| `release-names` | Affiche les fichiers d'une release : les noms de chaque cible de `RELEASE_TARGETS` (`macos/arm64 windows/amd64 windows/arm64`), puis `SHA256SUMS`. Utilisé par `local-ci-02-build.sh`. | |
| 70 | | `version` | Affiche `info.version` de `build/config.yml`. | | 71 | | `version` | Affiche `info.version` de `build/config.yml`. | |
| 71 | 72 | ||
| 72 | | Système | Fichiers (`<v>` = version) | | 73 | | Système | Fichiers (`<v>` = version) | |
| @@ -83,14 +84,24 @@ scripts/package.sh version | |||
| 83 | 84 | ||
| 84 | Vérifie d'abord tous les prérequis, puis vide `dist/` et construit : macOS avec `scripts/package.sh macos` (macOS seulement), Windows avec `scripts/package.sh windows <arch>` pour chaque architecture de `WINDOWS_ARCHES` (par défaut `amd64 arm64` ; demande `makensis` et `zip`), et, seulement si `LINUX_ARCHES` est défini (vide par défaut : pas de Linux dans les releases pour le moment), Linux avec `scripts/package.sh linux` dans un conteneur par architecture, construit depuis `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go de `go.mod`, pnpm de `frontend/package.json`, CLI Wails) avec le dépôt monté sur `/src` et le cache des modules Go dans le volume `sidekicks-gomod-<arch>`. Écrit enfin `dist/SHA256SUMS`. `SKIP` laisse de côté les systèmes qu'il nomme. Échoue, avant de rien construire, si un prérequis manque (hôte macOS, `makensis`, `zip`, Docker pour Linux). | 85 | Vérifie d'abord tous les prérequis, puis vide `dist/` et construit : macOS avec `scripts/package.sh macos` (macOS seulement), Windows avec `scripts/package.sh windows <arch>` pour chaque architecture de `WINDOWS_ARCHES` (par défaut `amd64 arm64` ; demande `makensis` et `zip`), et, seulement si `LINUX_ARCHES` est défini (vide par défaut : pas de Linux dans les releases pour le moment), Linux avec `scripts/package.sh linux` dans un conteneur par architecture, construit depuis `scripts/linux-packages.Dockerfile` (`ubuntu:26.04`, Go de `go.mod`, pnpm de `frontend/package.json`, CLI Wails) avec le dépôt monté sur `/src` et le cache des modules Go dans le volume `sidekicks-gomod-<arch>`. Écrit enfin `dist/SHA256SUMS`. `SKIP` laisse de côté les systèmes qu'il nomme. Échoue, avant de rien construire, si un prérequis manque (hôte macOS, `makensis`, `zip`, Docker pour Linux). |
| 85 | 86 | ||
| 86 | -## `scripts/tag-release.sh` | 87 | +## `scripts/sync-build-assets.sh` |
| 87 | 88 | ||
| 88 | ```text | 89 | ```text |
| 89 | -scripts/tag-release.sh [--remote <nom>] [--no-push] | 90 | +scripts/sync-build-assets.sh [--check] |
| 90 | ``` | 91 | ``` |
| 91 | 92 | ||
| 92 | -Crée le tag annoté `v<version>` (`info.version` de `build/config.yml`, message `Sidekicks <version>`) et le pousse sur `--remote` (par défaut `origin`). Refuse si des fichiers suivis sont modifiés, si la branche courante n'est pas `main`, si `main` diffère de `<remote>/main` après un fetch, ou si le tag existe en local. Avertit, sans refuser, s'il manque dans `dist/` un paquet de la version ou `SHA256SUMS`. `--no-push` tague en local seulement. | 93 | +Lance `wails3 task common:update:build-assets` (régénère les Info.plist et les fichiers Windows et Linux à partir de `build/config.yml`), remet `LSMinimumSystemVersion` à `13.0.0` dans `build/darwin/Info.plist` et `Info.dev.plist`, puis vérifie que les deux plist portent `info.version` et `13.0.0`. `--check` vérifie seulement. Lancé par `local-ci-02-build.sh`. Pourquoi : [Définir la version](../how-to/definir-la-version.md). |
| 93 | 94 | ||
| 94 | -## Workflow de release | 95 | +## `local-ci-*.sh` |
| 95 | 96 | ||
| 96 | -`.github/workflows/release.yml`, au push d'un tag `v*`, avec `permissions: contents: write` : échoue si le tag n'est pas `v` + `info.version` de `build/config.yml`, puis crée la release `<tag>` nommée `Sidekicks <tag>` (`softprops/action-gh-release@v2`, via l'API compatible GitHub de Rickub derrière `GITHUB_API_URL`), avec des notes qui donnent le commit, les guides d'installation et le tableau des fichiers attendus (tirés de `scripts/package.sh release-names`). Il n'attache aucun fichier : les paquets sont attachés à la main. | 97 | +La CI locale, à la racine du dépôt (procédure : [RELEASING.fr.md](../../../RELEASING.fr.md)). Tous lisent `.release.env` (`TAG`, `ABOUT`, `OWNER`, `REPO`, `SIGN_IDENTITY`, `NOTARY_PROFILE` ; un autre fichier avec `LOCAL_CI_ENV_FILE`) et, pour Rickub, `CI_TOKEN` dans `.ci.cd.token.env`. |
| 98 | + | ||
| 99 | +| Script | Ce qu'il fait | | ||
| 100 | +| --- | --- | | ||
| 101 | +| `local-ci-00-common.sh` | Partagé par les autres (sourcé). | | ||
| 102 | +| `local-ci-01-check.sh` | `make verify`. | | ||
| 103 | +| `local-ci-02-build.sh` | `scripts/build-release.sh`, puis, avec `SIGN_IDENTITY`, signe, notarise et agrafe l'app et le `.dmg` ; range `release/<TAG>/` et son `SHA256SUMS`. `TAG` doit être `v` + `info.version`, ou `v9.9.9…` (test). | | ||
| 104 | +| `local-ci-03-create-draft.sh` | Crée le tag et une préversion en brouillon avec ses notes. Refuse un arbre de travail modifié, un `HEAD` qui n'est pas le `main` distant, un `HEAD` qui a `.github/workflows`. `LOCAL_CI_PRINT_NOTES=1` affiche les notes seulement ; `LOCAL_CI_SKIP_GIT_CHECK=1` saute les contrôles git. | | ||
| 105 | +| `local-ci-04-upload.sh` | Pousse une branche orpheline temporaire `local-ci-publish-<TAG>` dont le workflow à un job envoie sur le brouillon les fichiers de `SHA256SUMS`, attend le job, supprime la branche. | | ||
| 106 | +| `local-ci-05-publish.sh` | Publie le brouillon en préversion après que vous avez tapé le tag, télécharge et compare les fichiers publics. | | ||
| 107 | +| `local-ci-06-promote.sh [tag]` | Retire l'étiquette de préversion après que vous avez tapé le tag. | | ||
added
local-ci-00-common.sh +70 -0 | new file mode 100755 | ||
| @@ -0,0 +1,70 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-00-common.sh — what the local-ci-*.sh steps share. Sourced, not run. | |
| 5 | +# | |
| 6 | +# The steps, in order: | |
| 7 | +# ./local-ci-01-check.sh gofmt, vet, tests | |
| 8 | +# ./local-ci-02-build.sh the packages, in release/<TAG>/ (scripts/build-release.sh); | |
| 9 | +# signs and notarizes the macOS app and the dmg | |
| 10 | +# when SIGN_IDENTITY is set (docs/en/how-to/sign-and-notarize-on-macos.md) | |
| 11 | +# ./local-ci-03-create-draft.sh the tag and a draft prerelease | |
| 12 | +# ./local-ci-04-upload.sh the packages, through a temporary branch | |
| 13 | +# ./local-ci-05-publish.sh the draft becomes public; asks first | |
| 14 | +# ./local-ci-06-promote.sh optional: the prerelease becomes a release; asks first | |
| 15 | +# | |
| 16 | +# Reads TAG, ABOUT, OWNER, REPO, SIGN_IDENTITY and NOTARY_PROFILE from | |
| 17 | +# .release.env, and CI_TOKEN from | |
| 18 | +# .ci.cd.token.env. The token never reaches argv: curl and git read it from | |
| 19 | +# files of mode 600 in a temporary folder. | |
| 20 | +set -euo pipefail | |
| 21 | +cd "$(dirname "${BASH_SOURCE[0]}")" | |
| 22 | + | |
| 23 | +# shellcheck disable=SC1090 | |
| 24 | +source "${LOCAL_CI_ENV_FILE:-./.release.env}" | |
| 25 | +: "${TAG:?TAG is not set in .release.env}" | |
| 26 | +OWNER="${OWNER:-bots-garden}" | |
| 27 | +REPO="${REPO:-sidekicks}" | |
| 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 | +work="$(mktemp -d)" | |
| 36 | +cleanup_work() { rm -rf "${work}"; } | |
| 37 | +trap cleanup_work EXIT | |
| 38 | + | |
| 39 | +# load_token prepares the token for curl and git. | |
| 40 | +load_token() { | |
| 41 | + # shellcheck disable=SC1091 | |
| 42 | + source ./.ci.cd.token.env | |
| 43 | + [ -n "${CI_TOKEN:-}" ] || { echo "❌ CI_TOKEN is not set in .ci.cd.token.env"; exit 2; } | |
| 44 | + export CI_TOKEN | |
| 45 | + ( umask 077; printf 'header = "Authorization: Bearer %s"\n' "${CI_TOKEN}" > "${work}/curl.conf" ) | |
| 46 | + ( umask 077; printf '#!/bin/sh\nprintf "%%s" "$CI_TOKEN"\n' > "${work}/askpass.sh" ) | |
| 47 | + chmod 700 "${work}/askpass.sh" | |
| 48 | + export GIT_ASKPASS="${work}/askpass.sh" GIT_TERMINAL_PROMPT=0 | |
| 49 | +} | |
| 50 | + | |
| 51 | +# call METHOD PATH [curl args]: the body lands in ${work}/body, the status is printed. | |
| 52 | +call() { | |
| 53 | + local method="$1" path="$2" | |
| 54 | + shift 2 | |
| 55 | + curl -sS -m 60 -o "${work}/body" -w '%{http_code}' -K "${work}/curl.conf" -X "${method}" "$@" "${api}${path}" | |
| 56 | +} | |
| 57 | + | |
| 58 | +# release_field FIELD prints a field of the release of TAG, or nothing. | |
| 59 | +release_field() { | |
| 60 | + local status | |
| 61 | + status="$(call GET /releases)" | |
| 62 | + [ "${status}" = "200" ] || { echo "❌ HTTP ${status} listing the releases: $(cat "${work}/body")" >&2; exit 1; } | |
| 63 | + # Not `// empty`: jq's // also drops false, and "draft": false would read as nothing. | |
| 64 | + jq -r --arg tag "${TAG}" --arg field "$1" '[.[] | select(.tag == $tag)][0][$field] | if . == null then empty else tostring end' "${work}/body" | |
| 65 | +} | |
| 66 | + | |
| 67 | +# latest_location prints where /releases/latest redirects to. | |
| 68 | +latest_location() { | |
| 69 | + curl -sI -m 20 "${web}/releases/latest" | tr -d '\r' | awk 'tolower($1) == "location:" {print $2}' | |
| 70 | +} | |
| new file mode 100755 | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-00-common.sh — what the local-ci-*.sh steps share. Sourced, not run. | ||
| 5 | +# | ||
| 6 | +# The steps, in order: | ||
| 7 | +# ./local-ci-01-check.sh gofmt, vet, tests | ||
| 8 | +# ./local-ci-02-build.sh the packages, in release/<TAG>/ (scripts/build-release.sh); | ||
| 9 | +# signs and notarizes the macOS app and the dmg | ||
| 10 | +# when SIGN_IDENTITY is set (docs/en/how-to/sign-and-notarize-on-macos.md) | ||
| 11 | +# ./local-ci-03-create-draft.sh the tag and a draft prerelease | ||
| 12 | +# ./local-ci-04-upload.sh the packages, through a temporary branch | ||
| 13 | +# ./local-ci-05-publish.sh the draft becomes public; asks first | ||
| 14 | +# ./local-ci-06-promote.sh optional: the prerelease becomes a release; asks first | ||
| 15 | +# | ||
| 16 | +# Reads TAG, ABOUT, OWNER, REPO, SIGN_IDENTITY and NOTARY_PROFILE from | ||
| 17 | +# .release.env, and CI_TOKEN from | ||
| 18 | +# .ci.cd.token.env. The token never reaches argv: curl and git read it from | ||
| 19 | +# files of mode 600 in a temporary folder. | ||
| 20 | +set -euo pipefail | ||
| 21 | +cd "$(dirname "${BASH_SOURCE[0]}")" | ||
| 22 | + | ||
| 23 | +# shellcheck disable=SC1090 | ||
| 24 | +source "${LOCAL_CI_ENV_FILE:-./.release.env}" | ||
| 25 | +: "${TAG:?TAG is not set in .release.env}" | ||
| 26 | +OWNER="${OWNER:-bots-garden}" | ||
| 27 | +REPO="${REPO:-sidekicks}" | ||
| 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 | +work="$(mktemp -d)" | ||
| 36 | +cleanup_work() { rm -rf "${work}"; } | ||
| 37 | +trap cleanup_work EXIT | ||
| 38 | + | ||
| 39 | +# load_token prepares the token for curl and git. | ||
| 40 | +load_token() { | ||
| 41 | + # shellcheck disable=SC1091 | ||
| 42 | + source ./.ci.cd.token.env | ||
| 43 | + [ -n "${CI_TOKEN:-}" ] || { echo "❌ CI_TOKEN is not set in .ci.cd.token.env"; exit 2; } | ||
| 44 | + export CI_TOKEN | ||
| 45 | + ( umask 077; printf 'header = "Authorization: Bearer %s"\n' "${CI_TOKEN}" > "${work}/curl.conf" ) | ||
| 46 | + ( umask 077; printf '#!/bin/sh\nprintf "%%s" "$CI_TOKEN"\n' > "${work}/askpass.sh" ) | ||
| 47 | + chmod 700 "${work}/askpass.sh" | ||
| 48 | + export GIT_ASKPASS="${work}/askpass.sh" GIT_TERMINAL_PROMPT=0 | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +# call METHOD PATH [curl args]: the body lands in ${work}/body, the status is printed. | ||
| 52 | +call() { | ||
| 53 | + local method="$1" path="$2" | ||
| 54 | + shift 2 | ||
| 55 | + curl -sS -m 60 -o "${work}/body" -w '%{http_code}' -K "${work}/curl.conf" -X "${method}" "$@" "${api}${path}" | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +# release_field FIELD prints a field of the release of TAG, or nothing. | ||
| 59 | +release_field() { | ||
| 60 | + local status | ||
| 61 | + status="$(call GET /releases)" | ||
| 62 | + [ "${status}" = "200" ] || { echo "❌ HTTP ${status} listing the releases: $(cat "${work}/body")" >&2; exit 1; } | ||
| 63 | + # Not `// empty`: jq's // also drops false, and "draft": false would read as nothing. | ||
| 64 | + jq -r --arg tag "${TAG}" --arg field "$1" '[.[] | select(.tag == $tag)][0][$field] | if . == null then empty else tostring end' "${work}/body" | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +# latest_location prints where /releases/latest redirects to. | ||
| 68 | +latest_location() { | ||
| 69 | + curl -sI -m 20 "${web}/releases/latest" | tr -d '\r' | awk 'tolower($1) == "location:" {print $2}' | ||
| 70 | +} | ||
added
local-ci-01-check.sh +11 -0 | new file mode 100755 | ||
| @@ -0,0 +1,11 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-01-check.sh — what the old pipeline checked: `make verify` (lint, all | |
| 5 | +# the tests, the bindings up to date). | |
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 7 | + | |
| 8 | +echo "==> make verify" | |
| 9 | +make verify | |
| 10 | + | |
| 11 | +echo "✅ checks passed" | |
| new file mode 100755 | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-01-check.sh — what the old pipeline checked: `make verify` (lint, all | ||
| 5 | +# the tests, the bindings up to date). | ||
| 6 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 7 | + | ||
| 8 | +echo "==> make verify" | ||
| 9 | +make verify | ||
| 10 | + | ||
| 11 | +echo "✅ checks passed" | ||
added
local-ci-02-build.sh +221 -0 | new file mode 100644 | ||
| @@ -0,0 +1,221 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-02-build.sh — the packages of a release, in release/<TAG>/. | |
| 5 | +# | |
| 6 | +# scripts/build-release.sh builds them into dist/ (macOS arm64, Windows amd64 | |
| 7 | +# and arm64; SKIP=windows, LINUX_ARCHES=amd64… work as there). Then, when | |
| 8 | +# SIGN_IDENTITY is set in .release.env, this script signs, notarizes and | |
| 9 | +# staples the macOS app, makes the .dmg from the stapled app, signs, notarizes | |
| 10 | +# and staples the .dmg too (docs/en/how-to/sign-and-notarize-on-macos.md, part B, | |
| 11 | +# done by a script). Last, it stages everything in release/<TAG>/ with one | |
| 12 | +# SHA256SUMS. | |
| 13 | +# | |
| 14 | +# release/<TAG>/ holds: | |
| 15 | +# the packages of scripts/package.sh release-names | |
| 16 | +# SHA256SUMS | |
| 17 | +# macos-signature.txt only when the macOS packages were signed | |
| 18 | +# | |
| 19 | +# The files are named after the version of build/config.yml, not after TAG: a | |
| 20 | +# test release (v9.9.9) holds packages named 1.2.0. TAG must be v<version>, | |
| 21 | +# unless it is a test tag (v9.9.9…). | |
| 22 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 23 | + | |
| 24 | +SIGN_IDENTITY="${SIGN_IDENTITY:-}" | |
| 25 | +NOTARY_PROFILE="${NOTARY_PROFILE:-}" | |
| 26 | +SKIP="${SKIP:-}" | |
| 27 | + | |
| 28 | +if ! [[ "${TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then | |
| 29 | + echo "❌ TAG must look like v1.2.3 or v1.2.3-rc.1, got '${TAG}' (check .release.env)" | |
| 30 | + exit 1 | |
| 31 | +fi | |
| 32 | +VERSION="$(scripts/package.sh version)" | |
| 33 | +case "${TAG}" in | |
| 34 | + "v${VERSION}" | v9.9.9*) ;; | |
| 35 | + *) | |
| 36 | + echo "❌ TAG is ${TAG} but build/config.yml says ${VERSION}: raise info.version, or fix .release.env" | |
| 37 | + exit 1 | |
| 38 | + ;; | |
| 39 | +esac | |
| 40 | + | |
| 41 | +# The files generated from build/config.yml (Info.plist, the Windows manifest, | |
| 42 | +# nfpm…) are brought up to date, and LSMinimumSystemVersion is put back to | |
| 43 | +# 13.0.0, which the generator resets to 12.0.0 (scripts/sync-build-assets.sh, | |
| 44 | +# docs/en/how-to/set-the-version.md). They are tracked files: when the sync | |
| 45 | +# changes any of them, the tag would not describe the build, so it stops here. | |
| 46 | +before="$(git status --porcelain --untracked-files=no -- build)" | |
| 47 | +scripts/sync-build-assets.sh | |
| 48 | +after="$(git status --porcelain --untracked-files=no -- build)" | |
| 49 | +if [ "${before}" != "${after}" ]; then | |
| 50 | + echo "❌ the sync changed the build assets: review, commit and push them, then run this script again" | |
| 51 | + git status --short --untracked-files=no -- build | |
| 52 | + exit 1 | |
| 53 | +fi | |
| 54 | + | |
| 55 | +# The app that scripts/package.sh macos leaves. | |
| 56 | +APP="bin/sidekicks.app" | |
| 57 | + | |
| 58 | +macos_built=true | |
| 59 | +case " ${SKIP} " in *" macos "*) macos_built=false ;; esac | |
| 60 | + | |
| 61 | +# checkSigningSetup fails now, before minutes of building, when the signature | |
| 62 | +# was asked for but cannot be done on this machine. | |
| 63 | +checkSigningSetup() { | |
| 64 | + if [ "$(uname -s)" != "Darwin" ]; then | |
| 65 | + echo "❌ SIGN_IDENTITY is set, but signing needs macOS (codesign, notarytool)" | |
| 66 | + exit 1 | |
| 67 | + fi | |
| 68 | + if [ -z "${NOTARY_PROFILE}" ]; then | |
| 69 | + echo "❌ SIGN_IDENTITY is set but NOTARY_PROFILE is not: a signed app that is not notarized is still blocked by Gatekeeper" | |
| 70 | + exit 1 | |
| 71 | + fi | |
| 72 | + local identities | |
| 73 | + identities="$(security find-identity -v -p codesigning)" | |
| 74 | + if ! grep -qF -- "\"${SIGN_IDENTITY}\"" <<<"${identities}"; then | |
| 75 | + echo "❌ no valid identity \"${SIGN_IDENTITY}\" in the keychain" | |
| 76 | + echo " 💡 security find-identity -v -p codesigning" | |
| 77 | + exit 1 | |
| 78 | + fi | |
| 79 | + if ! xcrun notarytool history --keychain-profile "${NOTARY_PROFILE}" >/dev/null 2>&1; then | |
| 80 | + echo "❌ the notarytool profile \"${NOTARY_PROFILE}\" does not work" | |
| 81 | + echo " 💡 xcrun notarytool history --keychain-profile \"${NOTARY_PROFILE}\"" | |
| 82 | + exit 1 | |
| 83 | + fi | |
| 84 | +} | |
| 85 | + | |
| 86 | +# notarize FILE: submits FILE to Apple, waits, fails unless it is Accepted; | |
| 87 | +# prints the submission id. | |
| 88 | +notarize() { | |
| 89 | + local file=$1 out="${work}/notary.json" status submission | |
| 90 | + if ! xcrun notarytool submit "${file}" --keychain-profile "${NOTARY_PROFILE}" --wait --output-format json >"${out}"; then | |
| 91 | + echo " ❌ notarytool submit failed:" >&2 | |
| 92 | + cat "${out}" >&2 | |
| 93 | + exit 1 | |
| 94 | + fi | |
| 95 | + status="$(jq -r '.status // empty' "${out}")" | |
| 96 | + submission="$(jq -r '.id // empty' "${out}")" | |
| 97 | + if [ "${status}" != "Accepted" ]; then | |
| 98 | + echo " ❌ notarization ${submission}: ${status:-no status}" >&2 | |
| 99 | + echo " 💡 xcrun notarytool log ${submission} --keychain-profile \"${NOTARY_PROFILE}\"" >&2 | |
| 100 | + exit 1 | |
| 101 | + fi | |
| 102 | + printf '%s\n' "${submission}" | |
| 103 | +} | |
| 104 | + | |
| 105 | +# signMacPackages replaces the .dmg and the .zip of dist/ with the signed, | |
| 106 | +# notarized and stapled ones. The work happens in the temporary folder: the | |
| 107 | +# repository may sit in a synced folder (kDrive, iCloud…) whose client writes | |
| 108 | +# metadata into files while codesign and stapler rewrite them. | |
| 109 | +signMacPackages() { | |
| 110 | + local dmg zip dir="${work}/sign" details submission_app submission_dmg | |
| 111 | + dmg="$(scripts/package.sh names macos arm64 | sed -n 1p)" | |
| 112 | + zip="$(scripts/package.sh names macos arm64 | sed -n 2p)" | |
| 113 | + [ -d "${APP}" ] || { echo "❌ no ${APP}: did the macOS build run?"; exit 1; } | |
| 114 | + mkdir -p "${dir}" | |
| 115 | + ditto "${APP}" "${dir}/sidekicks.app" | |
| 116 | + xattr -cr "${dir}/sidekicks.app" | |
| 117 | + | |
| 118 | + # The app. --options runtime (hardened runtime) and --timestamp are what the | |
| 119 | + # notary service requires. | |
| 120 | + codesign --force --options runtime --timestamp --sign "${SIGN_IDENTITY}" "${dir}/sidekicks.app" | |
| 121 | + codesign --verify --strict --verbose=2 "${dir}/sidekicks.app" | |
| 122 | + details="$(codesign -dv --verbose=4 "${dir}/sidekicks.app" 2>&1)" | |
| 123 | + local expected | |
| 124 | + for expected in "Authority=Developer ID Application" "flags=.*runtime" "Timestamp="; do | |
| 125 | + if ! grep -q -- "${expected}" <<<"${details}"; then | |
| 126 | + echo " ❌ the app signature has no ${expected}" | |
| 127 | + printf '%s\n' "${details}" | |
| 128 | + exit 1 | |
| 129 | + fi | |
| 130 | + done | |
| 131 | + echo " ✅ app signed (Developer ID, hardened runtime, timestamp)" | |
| 132 | + | |
| 133 | + ditto -c -k --keepParent "${dir}/sidekicks.app" "${dir}/notarize.zip" | |
| 134 | + echo " ⏳ waiting for Apple's notary service (the app, a few minutes)..." | |
| 135 | + submission_app="$(notarize "${dir}/notarize.zip")" | |
| 136 | + xcrun stapler staple "${dir}/sidekicks.app" | |
| 137 | + spctl -a -vvv -t exec "${dir}/sidekicks.app" 2>&1 | tee "${dir}/spctl-app.txt" | |
| 138 | + grep -q "source=Notarized Developer ID" "${dir}/spctl-app.txt" || { echo " ❌ Gatekeeper does not accept the app"; exit 1; } | |
| 139 | + echo " ✅ app notarized (submission ${submission_app}) and stapled" | |
| 140 | + | |
| 141 | + # The .dmg, made from the stapled app, with the layout of `make package-macos`. | |
| 142 | + wails3 tool package --format dmg --name sidekicks --out "${dir}" \ | |
| 143 | + --background build/darwin/dmg-background.png \ | |
| 144 | + --volume-icon build/darwin/icons.icns \ | |
| 145 | + --file-icon build/darwin/dmg-file-icon.icns \ | |
| 146 | + --window-width 540 --window-height 380 | |
| 147 | + hdiutil verify "${dir}/sidekicks.dmg" | |
| 148 | + codesign --force --timestamp --sign "${SIGN_IDENTITY}" "${dir}/sidekicks.dmg" | |
| 149 | + echo " ⏳ waiting for Apple's notary service (the dmg, a few minutes)..." | |
| 150 | + submission_dmg="$(notarize "${dir}/sidekicks.dmg")" | |
| 151 | + xcrun stapler staple "${dir}/sidekicks.dmg" | |
| 152 | + hdiutil verify "${dir}/sidekicks.dmg" | |
| 153 | + spctl -a -vvv -t open --context context:primary-signature "${dir}/sidekicks.dmg" 2>&1 | tee "${dir}/spctl-dmg.txt" | |
| 154 | + grep -q "source=Notarized Developer ID" "${dir}/spctl-dmg.txt" || { echo " ❌ Gatekeeper does not accept the dmg"; exit 1; } | |
| 155 | + echo " ✅ dmg signed, notarized (submission ${submission_dmg}) and stapled" | |
| 156 | + | |
| 157 | + # Back to dist/, then a copy that must be identical. | |
| 158 | + cp "${dir}/sidekicks.dmg" "dist/${dmg}" | |
| 159 | + rm -f "dist/${zip}" | |
| 160 | + ditto -c -k --keepParent "${dir}/sidekicks.app" "dist/${zip}" | |
| 161 | + if ! cmp -s "${dir}/sidekicks.dmg" "dist/${dmg}"; then | |
| 162 | + echo " ❌ dist/${dmg} differs from the signed copy (a synced folder?)" | |
| 163 | + exit 1 | |
| 164 | + fi | |
| 165 | + | |
| 166 | + { | |
| 167 | + printf 'assets: %s %s\n' "${dmg}" "${zip}" | |
| 168 | + grep '^Authority=Developer ID Application' <<<"${details}" | |
| 169 | + grep '^TeamIdentifier=' <<<"${details}" || true | |
| 170 | + printf 'notarization app: %s Accepted\n' "${submission_app}" | |
| 171 | + printf 'notarization dmg: %s Accepted\n' "${submission_dmg}" | |
| 172 | + } >"${work}/macos-signature.txt" | |
| 173 | +} | |
| 174 | + | |
| 175 | +if [ -n "${SIGN_IDENTITY}" ] && [ "${macos_built}" = true ]; then | |
| 176 | + checkSigningSetup | |
| 177 | +fi | |
| 178 | + | |
| 179 | +echo "🚀 Building Sidekicks ${VERSION} for ${TAG} — ${ABOUT:-Sidekicks}" | |
| 180 | +scripts/build-release.sh | |
| 181 | + | |
| 182 | +if [ "${macos_built}" = true ]; then | |
| 183 | + echo "" | |
| 184 | + if [ -n "${SIGN_IDENTITY}" ]; then | |
| 185 | + echo "🔏 Signing and notarizing the macOS packages..." | |
| 186 | + signMacPackages | |
| 187 | + else | |
| 188 | + echo "⚠️ the macOS packages are not signed: SIGN_IDENTITY is not set in .release.env" | |
| 189 | + fi | |
| 190 | +fi | |
| 191 | + | |
| 192 | +echo "" | |
| 193 | +echo "📦 Staging release/${TAG}/" | |
| 194 | +rm -rf "${assets_dir}" | |
| 195 | +mkdir -p "${assets_dir}" | |
| 196 | +# build-release.sh's SHA256SUMS describes the unsigned macOS files: dropped, and | |
| 197 | +# written again over what ships. | |
| 198 | +find dist -maxdepth 1 -type f ! -name SHA256SUMS -exec cp {} "${assets_dir}/" \; | |
| 199 | +if [ -f "${work}/macos-signature.txt" ]; then | |
| 200 | + cp "${work}/macos-signature.txt" "${assets_dir}/macos-signature.txt" | |
| 201 | +fi | |
| 202 | + | |
| 203 | +# What ships is what scripts/package.sh release-names says, no more, no less. | |
| 204 | +sums_tmp="${work}/SHA256SUMS" | |
| 205 | +: >"${sums_tmp}" | |
| 206 | +for name in $(scripts/package.sh release-names); do | |
| 207 | + [ "${name}" = SHA256SUMS ] && continue | |
| 208 | + case "${name}" in | |
| 209 | + *macos*) [ "${macos_built}" = true ] || continue ;; | |
| 210 | + *windows*) case " ${SKIP} " in *" windows "*) continue ;; esac ;; | |
| 211 | + esac | |
| 212 | + [ -f "${assets_dir}/${name}" ] || { echo "❌ ${assets_dir}/${name} is missing"; exit 1; } | |
| 213 | + (cd "${assets_dir}" && if command -v sha256sum >/dev/null; then sha256sum -- "${name}"; else shasum -a 256 -- "${name}"; fi) >>"${sums_tmp}" | |
| 214 | +done | |
| 215 | +cp "${sums_tmp}" "${assets_dir}/SHA256SUMS" | |
| 216 | +chmod 644 "${assets_dir}/SHA256SUMS" | |
| 217 | +cat "${assets_dir}/SHA256SUMS" | |
| 218 | + | |
| 219 | +echo "" | |
| 220 | +ls -lh "${assets_dir}" | |
| 221 | +echo "✅ ${assets_dir}/ is ready" | |
| new file mode 100644 | |||
| @@ -0,0 +1,221 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-02-build.sh — the packages of a release, in release/<TAG>/. | ||
| 5 | +# | ||
| 6 | +# scripts/build-release.sh builds them into dist/ (macOS arm64, Windows amd64 | ||
| 7 | +# and arm64; SKIP=windows, LINUX_ARCHES=amd64… work as there). Then, when | ||
| 8 | +# SIGN_IDENTITY is set in .release.env, this script signs, notarizes and | ||
| 9 | +# staples the macOS app, makes the .dmg from the stapled app, signs, notarizes | ||
| 10 | +# and staples the .dmg too (docs/en/how-to/sign-and-notarize-on-macos.md, part B, | ||
| 11 | +# done by a script). Last, it stages everything in release/<TAG>/ with one | ||
| 12 | +# SHA256SUMS. | ||
| 13 | +# | ||
| 14 | +# release/<TAG>/ holds: | ||
| 15 | +# the packages of scripts/package.sh release-names | ||
| 16 | +# SHA256SUMS | ||
| 17 | +# macos-signature.txt only when the macOS packages were signed | ||
| 18 | +# | ||
| 19 | +# The files are named after the version of build/config.yml, not after TAG: a | ||
| 20 | +# test release (v9.9.9) holds packages named 1.2.0. TAG must be v<version>, | ||
| 21 | +# unless it is a test tag (v9.9.9…). | ||
| 22 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 23 | + | ||
| 24 | +SIGN_IDENTITY="${SIGN_IDENTITY:-}" | ||
| 25 | +NOTARY_PROFILE="${NOTARY_PROFILE:-}" | ||
| 26 | +SKIP="${SKIP:-}" | ||
| 27 | + | ||
| 28 | +if ! [[ "${TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then | ||
| 29 | + echo "❌ TAG must look like v1.2.3 or v1.2.3-rc.1, got '${TAG}' (check .release.env)" | ||
| 30 | + exit 1 | ||
| 31 | +fi | ||
| 32 | +VERSION="$(scripts/package.sh version)" | ||
| 33 | +case "${TAG}" in | ||
| 34 | + "v${VERSION}" | v9.9.9*) ;; | ||
| 35 | + *) | ||
| 36 | + echo "❌ TAG is ${TAG} but build/config.yml says ${VERSION}: raise info.version, or fix .release.env" | ||
| 37 | + exit 1 | ||
| 38 | + ;; | ||
| 39 | +esac | ||
| 40 | + | ||
| 41 | +# The files generated from build/config.yml (Info.plist, the Windows manifest, | ||
| 42 | +# nfpm…) are brought up to date, and LSMinimumSystemVersion is put back to | ||
| 43 | +# 13.0.0, which the generator resets to 12.0.0 (scripts/sync-build-assets.sh, | ||
| 44 | +# docs/en/how-to/set-the-version.md). They are tracked files: when the sync | ||
| 45 | +# changes any of them, the tag would not describe the build, so it stops here. | ||
| 46 | +before="$(git status --porcelain --untracked-files=no -- build)" | ||
| 47 | +scripts/sync-build-assets.sh | ||
| 48 | +after="$(git status --porcelain --untracked-files=no -- build)" | ||
| 49 | +if [ "${before}" != "${after}" ]; then | ||
| 50 | + echo "❌ the sync changed the build assets: review, commit and push them, then run this script again" | ||
| 51 | + git status --short --untracked-files=no -- build | ||
| 52 | + exit 1 | ||
| 53 | +fi | ||
| 54 | + | ||
| 55 | +# The app that scripts/package.sh macos leaves. | ||
| 56 | +APP="bin/sidekicks.app" | ||
| 57 | + | ||
| 58 | +macos_built=true | ||
| 59 | +case " ${SKIP} " in *" macos "*) macos_built=false ;; esac | ||
| 60 | + | ||
| 61 | +# checkSigningSetup fails now, before minutes of building, when the signature | ||
| 62 | +# was asked for but cannot be done on this machine. | ||
| 63 | +checkSigningSetup() { | ||
| 64 | + if [ "$(uname -s)" != "Darwin" ]; then | ||
| 65 | + echo "❌ SIGN_IDENTITY is set, but signing needs macOS (codesign, notarytool)" | ||
| 66 | + exit 1 | ||
| 67 | + fi | ||
| 68 | + if [ -z "${NOTARY_PROFILE}" ]; then | ||
| 69 | + echo "❌ SIGN_IDENTITY is set but NOTARY_PROFILE is not: a signed app that is not notarized is still blocked by Gatekeeper" | ||
| 70 | + exit 1 | ||
| 71 | + fi | ||
| 72 | + local identities | ||
| 73 | + identities="$(security find-identity -v -p codesigning)" | ||
| 74 | + if ! grep -qF -- "\"${SIGN_IDENTITY}\"" <<<"${identities}"; then | ||
| 75 | + echo "❌ no valid identity \"${SIGN_IDENTITY}\" in the keychain" | ||
| 76 | + echo " 💡 security find-identity -v -p codesigning" | ||
| 77 | + exit 1 | ||
| 78 | + fi | ||
| 79 | + if ! xcrun notarytool history --keychain-profile "${NOTARY_PROFILE}" >/dev/null 2>&1; then | ||
| 80 | + echo "❌ the notarytool profile \"${NOTARY_PROFILE}\" does not work" | ||
| 81 | + echo " 💡 xcrun notarytool history --keychain-profile \"${NOTARY_PROFILE}\"" | ||
| 82 | + exit 1 | ||
| 83 | + fi | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +# notarize FILE: submits FILE to Apple, waits, fails unless it is Accepted; | ||
| 87 | +# prints the submission id. | ||
| 88 | +notarize() { | ||
| 89 | + local file=$1 out="${work}/notary.json" status submission | ||
| 90 | + if ! xcrun notarytool submit "${file}" --keychain-profile "${NOTARY_PROFILE}" --wait --output-format json >"${out}"; then | ||
| 91 | + echo " ❌ notarytool submit failed:" >&2 | ||
| 92 | + cat "${out}" >&2 | ||
| 93 | + exit 1 | ||
| 94 | + fi | ||
| 95 | + status="$(jq -r '.status // empty' "${out}")" | ||
| 96 | + submission="$(jq -r '.id // empty' "${out}")" | ||
| 97 | + if [ "${status}" != "Accepted" ]; then | ||
| 98 | + echo " ❌ notarization ${submission}: ${status:-no status}" >&2 | ||
| 99 | + echo " 💡 xcrun notarytool log ${submission} --keychain-profile \"${NOTARY_PROFILE}\"" >&2 | ||
| 100 | + exit 1 | ||
| 101 | + fi | ||
| 102 | + printf '%s\n' "${submission}" | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +# signMacPackages replaces the .dmg and the .zip of dist/ with the signed, | ||
| 106 | +# notarized and stapled ones. The work happens in the temporary folder: the | ||
| 107 | +# repository may sit in a synced folder (kDrive, iCloud…) whose client writes | ||
| 108 | +# metadata into files while codesign and stapler rewrite them. | ||
| 109 | +signMacPackages() { | ||
| 110 | + local dmg zip dir="${work}/sign" details submission_app submission_dmg | ||
| 111 | + dmg="$(scripts/package.sh names macos arm64 | sed -n 1p)" | ||
| 112 | + zip="$(scripts/package.sh names macos arm64 | sed -n 2p)" | ||
| 113 | + [ -d "${APP}" ] || { echo "❌ no ${APP}: did the macOS build run?"; exit 1; } | ||
| 114 | + mkdir -p "${dir}" | ||
| 115 | + ditto "${APP}" "${dir}/sidekicks.app" | ||
| 116 | + xattr -cr "${dir}/sidekicks.app" | ||
| 117 | + | ||
| 118 | + # The app. --options runtime (hardened runtime) and --timestamp are what the | ||
| 119 | + # notary service requires. | ||
| 120 | + codesign --force --options runtime --timestamp --sign "${SIGN_IDENTITY}" "${dir}/sidekicks.app" | ||
| 121 | + codesign --verify --strict --verbose=2 "${dir}/sidekicks.app" | ||
| 122 | + details="$(codesign -dv --verbose=4 "${dir}/sidekicks.app" 2>&1)" | ||
| 123 | + local expected | ||
| 124 | + for expected in "Authority=Developer ID Application" "flags=.*runtime" "Timestamp="; do | ||
| 125 | + if ! grep -q -- "${expected}" <<<"${details}"; then | ||
| 126 | + echo " ❌ the app signature has no ${expected}" | ||
| 127 | + printf '%s\n' "${details}" | ||
| 128 | + exit 1 | ||
| 129 | + fi | ||
| 130 | + done | ||
| 131 | + echo " ✅ app signed (Developer ID, hardened runtime, timestamp)" | ||
| 132 | + | ||
| 133 | + ditto -c -k --keepParent "${dir}/sidekicks.app" "${dir}/notarize.zip" | ||
| 134 | + echo " ⏳ waiting for Apple's notary service (the app, a few minutes)..." | ||
| 135 | + submission_app="$(notarize "${dir}/notarize.zip")" | ||
| 136 | + xcrun stapler staple "${dir}/sidekicks.app" | ||
| 137 | + spctl -a -vvv -t exec "${dir}/sidekicks.app" 2>&1 | tee "${dir}/spctl-app.txt" | ||
| 138 | + grep -q "source=Notarized Developer ID" "${dir}/spctl-app.txt" || { echo " ❌ Gatekeeper does not accept the app"; exit 1; } | ||
| 139 | + echo " ✅ app notarized (submission ${submission_app}) and stapled" | ||
| 140 | + | ||
| 141 | + # The .dmg, made from the stapled app, with the layout of `make package-macos`. | ||
| 142 | + wails3 tool package --format dmg --name sidekicks --out "${dir}" \ | ||
| 143 | + --background build/darwin/dmg-background.png \ | ||
| 144 | + --volume-icon build/darwin/icons.icns \ | ||
| 145 | + --file-icon build/darwin/dmg-file-icon.icns \ | ||
| 146 | + --window-width 540 --window-height 380 | ||
| 147 | + hdiutil verify "${dir}/sidekicks.dmg" | ||
| 148 | + codesign --force --timestamp --sign "${SIGN_IDENTITY}" "${dir}/sidekicks.dmg" | ||
| 149 | + echo " ⏳ waiting for Apple's notary service (the dmg, a few minutes)..." | ||
| 150 | + submission_dmg="$(notarize "${dir}/sidekicks.dmg")" | ||
| 151 | + xcrun stapler staple "${dir}/sidekicks.dmg" | ||
| 152 | + hdiutil verify "${dir}/sidekicks.dmg" | ||
| 153 | + spctl -a -vvv -t open --context context:primary-signature "${dir}/sidekicks.dmg" 2>&1 | tee "${dir}/spctl-dmg.txt" | ||
| 154 | + grep -q "source=Notarized Developer ID" "${dir}/spctl-dmg.txt" || { echo " ❌ Gatekeeper does not accept the dmg"; exit 1; } | ||
| 155 | + echo " ✅ dmg signed, notarized (submission ${submission_dmg}) and stapled" | ||
| 156 | + | ||
| 157 | + # Back to dist/, then a copy that must be identical. | ||
| 158 | + cp "${dir}/sidekicks.dmg" "dist/${dmg}" | ||
| 159 | + rm -f "dist/${zip}" | ||
| 160 | + ditto -c -k --keepParent "${dir}/sidekicks.app" "dist/${zip}" | ||
| 161 | + if ! cmp -s "${dir}/sidekicks.dmg" "dist/${dmg}"; then | ||
| 162 | + echo " ❌ dist/${dmg} differs from the signed copy (a synced folder?)" | ||
| 163 | + exit 1 | ||
| 164 | + fi | ||
| 165 | + | ||
| 166 | + { | ||
| 167 | + printf 'assets: %s %s\n' "${dmg}" "${zip}" | ||
| 168 | + grep '^Authority=Developer ID Application' <<<"${details}" | ||
| 169 | + grep '^TeamIdentifier=' <<<"${details}" || true | ||
| 170 | + printf 'notarization app: %s Accepted\n' "${submission_app}" | ||
| 171 | + printf 'notarization dmg: %s Accepted\n' "${submission_dmg}" | ||
| 172 | + } >"${work}/macos-signature.txt" | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +if [ -n "${SIGN_IDENTITY}" ] && [ "${macos_built}" = true ]; then | ||
| 176 | + checkSigningSetup | ||
| 177 | +fi | ||
| 178 | + | ||
| 179 | +echo "🚀 Building Sidekicks ${VERSION} for ${TAG} — ${ABOUT:-Sidekicks}" | ||
| 180 | +scripts/build-release.sh | ||
| 181 | + | ||
| 182 | +if [ "${macos_built}" = true ]; then | ||
| 183 | + echo "" | ||
| 184 | + if [ -n "${SIGN_IDENTITY}" ]; then | ||
| 185 | + echo "🔏 Signing and notarizing the macOS packages..." | ||
| 186 | + signMacPackages | ||
| 187 | + else | ||
| 188 | + echo "⚠️ the macOS packages are not signed: SIGN_IDENTITY is not set in .release.env" | ||
| 189 | + fi | ||
| 190 | +fi | ||
| 191 | + | ||
| 192 | +echo "" | ||
| 193 | +echo "📦 Staging release/${TAG}/" | ||
| 194 | +rm -rf "${assets_dir}" | ||
| 195 | +mkdir -p "${assets_dir}" | ||
| 196 | +# build-release.sh's SHA256SUMS describes the unsigned macOS files: dropped, and | ||
| 197 | +# written again over what ships. | ||
| 198 | +find dist -maxdepth 1 -type f ! -name SHA256SUMS -exec cp {} "${assets_dir}/" \; | ||
| 199 | +if [ -f "${work}/macos-signature.txt" ]; then | ||
| 200 | + cp "${work}/macos-signature.txt" "${assets_dir}/macos-signature.txt" | ||
| 201 | +fi | ||
| 202 | + | ||
| 203 | +# What ships is what scripts/package.sh release-names says, no more, no less. | ||
| 204 | +sums_tmp="${work}/SHA256SUMS" | ||
| 205 | +: >"${sums_tmp}" | ||
| 206 | +for name in $(scripts/package.sh release-names); do | ||
| 207 | + [ "${name}" = SHA256SUMS ] && continue | ||
| 208 | + case "${name}" in | ||
| 209 | + *macos*) [ "${macos_built}" = true ] || continue ;; | ||
| 210 | + *windows*) case " ${SKIP} " in *" windows "*) continue ;; esac ;; | ||
| 211 | + esac | ||
| 212 | + [ -f "${assets_dir}/${name}" ] || { echo "❌ ${assets_dir}/${name} is missing"; exit 1; } | ||
| 213 | + (cd "${assets_dir}" && if command -v sha256sum >/dev/null; then sha256sum -- "${name}"; else shasum -a 256 -- "${name}"; fi) >>"${sums_tmp}" | ||
| 214 | +done | ||
| 215 | +cp "${sums_tmp}" "${assets_dir}/SHA256SUMS" | ||
| 216 | +chmod 644 "${assets_dir}/SHA256SUMS" | ||
| 217 | +cat "${assets_dir}/SHA256SUMS" | ||
| 218 | + | ||
| 219 | +echo "" | ||
| 220 | +ls -lh "${assets_dir}" | ||
| 221 | +echo "✅ ${assets_dir}/ is ready" | ||
added
local-ci-03-create-draft.sh +84 -0 | new file mode 100755 | ||
| @@ -0,0 +1,84 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-03-create-draft.sh — the tag and a draft prerelease on Rickub. | |
| 5 | +# | |
| 6 | +# Refuses when the packages would not be what the tag names: the working tree | |
| 7 | +# must be clean and HEAD must be on the remote's main. | |
| 8 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 9 | +load_token | |
| 10 | + | |
| 11 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 12 | + | |
| 13 | +head_sha="$(git rev-parse HEAD)" | |
| 14 | +if [ -z "${LOCAL_CI_SKIP_GIT_CHECK:-}" ]; then | |
| 15 | + if [ -n "$(git status --porcelain --untracked-files=no)" ]; then | |
| 16 | + echo "❌ the working tree is not clean: commit first" | |
| 17 | + git status --short --untracked-files=no | |
| 18 | + exit 1 | |
| 19 | + fi | |
| 20 | + remote_main="$(git ls-remote "${git_url}" refs/heads/main | cut -f1)" | |
| 21 | + if [ "${head_sha}" != "${remote_main}" ]; then | |
| 22 | + echo "❌ HEAD (${head_sha}) is not the remote's main (${remote_main}): push first" | |
| 23 | + exit 1 | |
| 24 | + fi | |
| 25 | +fi | |
| 26 | + | |
| 27 | +# With the old workflow on that commit, a v* tag would also start a CI release. | |
| 28 | +case "${TAG}" in | |
| 29 | + v*) | |
| 30 | + if [ -n "$(git ls-tree "${head_sha}" .github/workflows)" ]; then | |
| 31 | + echo "❌ ${head_sha} still has .github/workflows: a tag there would start the old Release workflow. Push the commit that renames it." | |
| 32 | + exit 1 | |
| 33 | + fi | |
| 34 | + ;; | |
| 35 | +esac | |
| 36 | + | |
| 37 | +# The notes have the shape of the ones the old workflow published: version, | |
| 38 | +# commit, install guides, what is new, then a table of the files. | |
| 39 | +version="$(scripts/package.sh version)" | |
| 40 | +base="https://rickub.com/${OWNER}/${REPO}" | |
| 41 | +whats_new="docs/release-notes/v${version}.md" | |
| 42 | +{ | |
| 43 | + printf '## Sidekicks %s\n\n' "${version}" | |
| 44 | + [ -z "${ABOUT:-}" ] || printf '%s\n\n' "${ABOUT}" | |
| 45 | + printf 'Commit `%s`. Built on a local machine with %s.\n' "${head_sha}" "$(go env GOVERSION)" | |
| 46 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | |
| 47 | + printf 'The macOS packages are signed with a Developer ID and notarized by Apple.\n' | |
| 48 | + fi | |
| 49 | + printf '\nInstall: [English](%s/blob/main/docs/en/how-to/install-sidekicks.md) · [Français](%s/blob/main/docs/fr/how-to/installer-sidekicks.md)\n\n' "${base}" "${base}" | |
| 50 | + if [ -f "${whats_new}" ]; then | |
| 51 | + tail -n +2 "${whats_new}" | |
| 52 | + printf '\n' | |
| 53 | + fi | |
| 54 | + printf '| File | System |\n| --- | --- |\n' | |
| 55 | + while read -r _ name; do | |
| 56 | + case "${name}" in | |
| 57 | + *macos-arm64*) system="macOS 13 or later, Apple Silicon" ;; | |
| 58 | + *windows?amd64*) system="Windows x86-64" ;; | |
| 59 | + *windows?arm64*) system="Windows on Arm" ;; | |
| 60 | + *) system="" ;; | |
| 61 | + esac | |
| 62 | + printf '| `%s` | %s |\n' "${name}" "${system}" | |
| 63 | + done <"${assets_dir}/SHA256SUMS" | |
| 64 | + printf '| `SHA256SUMS` | checksums: `shasum -a 256 -c SHA256SUMS` (macOS), `Get-FileHash` (Windows) |\n' | |
| 65 | + printf '\n## Checksums\n\n```\n' | |
| 66 | + cat "${assets_dir}/SHA256SUMS" | |
| 67 | + printf '```\n' | |
| 68 | +} >"${work}/notes.md" | |
| 69 | + | |
| 70 | +# LOCAL_CI_PRINT_NOTES=1 shows the notes and stops: nothing is created. | |
| 71 | +if [ -n "${LOCAL_CI_PRINT_NOTES:-}" ]; then | |
| 72 | + cat "${work}/notes.md" | |
| 73 | + exit 0 | |
| 74 | +fi | |
| 75 | + | |
| 76 | +echo "==> creating the draft prerelease ${TAG} on ${head_sha}" | |
| 77 | +payload="$(jq -n --arg tag "${TAG}" --arg name "Sidekicks ${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ | |
| 78 | + '{tag: $tag, title: $name, target: $target, body: $body, prerelease: true, draft: true}')" | |
| 79 | +status="$(call POST /releases -H 'Content-Type: application/json' -d "${payload}")" | |
| 80 | +case "${status}" in | |
| 81 | + 201) echo "✅ draft ${TAG} created" ;; | |
| 82 | + 409) echo "❌ the release ${TAG} already exists"; exit 1 ;; | |
| 83 | + *) echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1 ;; | |
| 84 | +esac | |
| new file mode 100755 | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-03-create-draft.sh — the tag and a draft prerelease on Rickub. | ||
| 5 | +# | ||
| 6 | +# Refuses when the packages would not be what the tag names: the working tree | ||
| 7 | +# must be clean and HEAD must be on the remote's main. | ||
| 8 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 9 | +load_token | ||
| 10 | + | ||
| 11 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 12 | + | ||
| 13 | +head_sha="$(git rev-parse HEAD)" | ||
| 14 | +if [ -z "${LOCAL_CI_SKIP_GIT_CHECK:-}" ]; then | ||
| 15 | + if [ -n "$(git status --porcelain --untracked-files=no)" ]; then | ||
| 16 | + echo "❌ the working tree is not clean: commit first" | ||
| 17 | + git status --short --untracked-files=no | ||
| 18 | + exit 1 | ||
| 19 | + fi | ||
| 20 | + remote_main="$(git ls-remote "${git_url}" refs/heads/main | cut -f1)" | ||
| 21 | + if [ "${head_sha}" != "${remote_main}" ]; then | ||
| 22 | + echo "❌ HEAD (${head_sha}) is not the remote's main (${remote_main}): push first" | ||
| 23 | + exit 1 | ||
| 24 | + fi | ||
| 25 | +fi | ||
| 26 | + | ||
| 27 | +# With the old workflow on that commit, a v* tag would also start a CI release. | ||
| 28 | +case "${TAG}" in | ||
| 29 | + v*) | ||
| 30 | + if [ -n "$(git ls-tree "${head_sha}" .github/workflows)" ]; then | ||
| 31 | + echo "❌ ${head_sha} still has .github/workflows: a tag there would start the old Release workflow. Push the commit that renames it." | ||
| 32 | + exit 1 | ||
| 33 | + fi | ||
| 34 | + ;; | ||
| 35 | +esac | ||
| 36 | + | ||
| 37 | +# The notes have the shape of the ones the old workflow published: version, | ||
| 38 | +# commit, install guides, what is new, then a table of the files. | ||
| 39 | +version="$(scripts/package.sh version)" | ||
| 40 | +base="https://rickub.com/${OWNER}/${REPO}" | ||
| 41 | +whats_new="docs/release-notes/v${version}.md" | ||
| 42 | +{ | ||
| 43 | + printf '## Sidekicks %s\n\n' "${version}" | ||
| 44 | + [ -z "${ABOUT:-}" ] || printf '%s\n\n' "${ABOUT}" | ||
| 45 | + printf 'Commit `%s`. Built on a local machine with %s.\n' "${head_sha}" "$(go env GOVERSION)" | ||
| 46 | + if [ -f "${assets_dir}/macos-signature.txt" ]; then | ||
| 47 | + printf 'The macOS packages are signed with a Developer ID and notarized by Apple.\n' | ||
| 48 | + fi | ||
| 49 | + printf '\nInstall: [English](%s/blob/main/docs/en/how-to/install-sidekicks.md) · [Français](%s/blob/main/docs/fr/how-to/installer-sidekicks.md)\n\n' "${base}" "${base}" | ||
| 50 | + if [ -f "${whats_new}" ]; then | ||
| 51 | + tail -n +2 "${whats_new}" | ||
| 52 | + printf '\n' | ||
| 53 | + fi | ||
| 54 | + printf '| File | System |\n| --- | --- |\n' | ||
| 55 | + while read -r _ name; do | ||
| 56 | + case "${name}" in | ||
| 57 | + *macos-arm64*) system="macOS 13 or later, Apple Silicon" ;; | ||
| 58 | + *windows?amd64*) system="Windows x86-64" ;; | ||
| 59 | + *windows?arm64*) system="Windows on Arm" ;; | ||
| 60 | + *) system="" ;; | ||
| 61 | + esac | ||
| 62 | + printf '| `%s` | %s |\n' "${name}" "${system}" | ||
| 63 | + done <"${assets_dir}/SHA256SUMS" | ||
| 64 | + printf '| `SHA256SUMS` | checksums: `shasum -a 256 -c SHA256SUMS` (macOS), `Get-FileHash` (Windows) |\n' | ||
| 65 | + printf '\n## Checksums\n\n```\n' | ||
| 66 | + cat "${assets_dir}/SHA256SUMS" | ||
| 67 | + printf '```\n' | ||
| 68 | +} >"${work}/notes.md" | ||
| 69 | + | ||
| 70 | +# LOCAL_CI_PRINT_NOTES=1 shows the notes and stops: nothing is created. | ||
| 71 | +if [ -n "${LOCAL_CI_PRINT_NOTES:-}" ]; then | ||
| 72 | + cat "${work}/notes.md" | ||
| 73 | + exit 0 | ||
| 74 | +fi | ||
| 75 | + | ||
| 76 | +echo "==> creating the draft prerelease ${TAG} on ${head_sha}" | ||
| 77 | +payload="$(jq -n --arg tag "${TAG}" --arg name "Sidekicks ${TAG}" --arg target "${head_sha}" --rawfile body "${work}/notes.md" \ | ||
| 78 | + '{tag: $tag, title: $name, target: $target, body: $body, prerelease: true, draft: true}')" | ||
| 79 | +status="$(call POST /releases -H 'Content-Type: application/json' -d "${payload}")" | ||
| 80 | +case "${status}" in | ||
| 81 | + 201) echo "✅ draft ${TAG} created" ;; | ||
| 82 | + 409) echo "❌ the release ${TAG} already exists"; exit 1 ;; | ||
| 83 | + *) echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1 ;; | ||
| 84 | +esac | ||
added
local-ci-04-upload.sh +114 -0 | new file mode 100755 | ||
| @@ -0,0 +1,114 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-04-upload.sh — the packages of release/<TAG>/ onto the draft. | |
| 5 | +# | |
| 6 | +# Rickub only accepts uploads from the token of a CI job. So this pushes a | |
| 7 | +# temporary orphan branch holding the packages and a one-job workflow, waits for | |
| 8 | +# the job, and deletes the branch, whatever happened. The local checkout is | |
| 9 | +# never touched. | |
| 10 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 11 | +load_token | |
| 12 | + | |
| 13 | +branch="local-ci-publish-${TAG}" | |
| 14 | +run_timeout_seconds=900 | |
| 15 | +branch_pushed="" | |
| 16 | + | |
| 17 | +remove_branch() { | |
| 18 | + if [ -n "${branch_pushed}" ]; then | |
| 19 | + echo "==> deleting the branch ${branch}" | |
| 20 | + git -C "${work}/branch" push -q "${git_url}" --delete "${branch}" \ | |
| 21 | + || echo "⚠️ could not delete ${branch}: delete it by hand" | |
| 22 | + fi | |
| 23 | + cleanup_work | |
| 24 | +} | |
| 25 | +trap remove_branch EXIT | |
| 26 | + | |
| 27 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 28 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is not a draft: run local-ci-03-create-draft.sh"; exit 1; } | |
| 29 | + | |
| 30 | +echo "==> preparing the temporary branch" | |
| 31 | +git init -q -b "${branch}" "${work}/branch" | |
| 32 | +mkdir -p "${work}/branch/assets" "${work}/branch/.github/workflows" | |
| 33 | +# What goes up is what SHA256SUMS lists, and SHA256SUMS itself. | |
| 34 | +while read -r _ name; do | |
| 35 | + cp "${assets_dir}/${name}" "${work}/branch/assets/" | |
| 36 | +done < "${assets_dir}/SHA256SUMS" | |
| 37 | +cp "${assets_dir}/SHA256SUMS" "${work}/branch/assets/" | |
| 38 | +printf '%s\n' "${TAG}" > "${work}/branch/TAG" | |
| 39 | +cat > "${work}/branch/.github/workflows/local-ci-publish.yml" <<'WORKFLOW' | |
| 40 | +name: local ci publish | |
| 41 | +on: | |
| 42 | + push: | |
| 43 | + branches: | |
| 44 | + - "local-ci-publish-*" | |
| 45 | +permissions: | |
| 46 | + contents: write | |
| 47 | +jobs: | |
| 48 | + upload: | |
| 49 | + runs-on: ubuntu-latest | |
| 50 | + steps: | |
| 51 | + - uses: actions/checkout@v4 | |
| 52 | + - name: Upload the binaries to the release | |
| 53 | + env: | |
| 54 | + GITHUB_TOKEN: ${{ github.token }} | |
| 55 | + run: bash ./upload.sh | |
| 56 | +WORKFLOW | |
| 57 | +cat > "${work}/branch/upload.sh" <<'UPLOAD' | |
| 58 | +#!/usr/bin/env bash | |
| 59 | +set -euo pipefail | |
| 60 | +tag="$(cat TAG)" | |
| 61 | +api="${GITHUB_API_URL%/}/repos/${GITHUB_REPOSITORY}" | |
| 62 | +config="$(mktemp)" | |
| 63 | +printf 'header = "Authorization: Bearer %s"\n' "${GITHUB_TOKEN}" > "${config}" | |
| 64 | +curl -fsS -K "${config}" "${api}/releases?per_page=100" > releases.json | |
| 65 | +upload_url="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].upload_url // empty' releases.json | sed 's/{[^}]*}$//')" | |
| 66 | +[ -n "${upload_url}" ] || { echo "::error::no release ${tag} visible to the job"; exit 1; } | |
| 67 | +for file in assets/*; do | |
| 68 | + name="$(basename "${file}")" | |
| 69 | + status="$(curl -sS -o response.json -w '%{http_code}' -K "${config}" -X POST \ | |
| 70 | + -H 'Content-Type: application/octet-stream' --data-binary @"${file}" "${upload_url}?name=${name}")" | |
| 71 | + [ "${status}" = "201" ] || { echo "::error::HTTP ${status} uploading ${name}: $(cat response.json)"; exit 1; } | |
| 72 | + echo "uploaded ${name}" | |
| 73 | +done | |
| 74 | +release_id="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].id' releases.json)" | |
| 75 | +curl -fsS -K "${config}" "${api}/releases/${release_id}/assets" | jq -r '.[] | "asset \(.name) \(.size)"' | |
| 76 | +UPLOAD | |
| 77 | +git -C "${work}/branch" add -A | |
| 78 | +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}" | |
| 79 | +head_sha="$(git -C "${work}/branch" rev-parse HEAD)" | |
| 80 | +echo " $(du -sh "${work}/branch/assets" | cut -f1) of packages" | |
| 81 | + | |
| 82 | +echo "==> pushing ${branch}" | |
| 83 | +git -C "${work}/branch" push -q "${git_url}" "HEAD:refs/heads/${branch}" | |
| 84 | +branch_pushed="yes" | |
| 85 | + | |
| 86 | +echo "==> waiting for the CI job" | |
| 87 | +deadline=$(( SECONDS + run_timeout_seconds )) | |
| 88 | +run_number="" | |
| 89 | +run_status="" | |
| 90 | +while [ "${SECONDS}" -lt "${deadline}" ]; do | |
| 91 | + sleep 10 | |
| 92 | + status="$(call GET /actions/runs)" | |
| 93 | + [ "${status}" = "200" ] || continue | |
| 94 | + run="$(jq -c --arg sha "${head_sha}" '[.items[] | select(.head_sha == $sha)][0] // empty' "${work}/body")" | |
| 95 | + [ -n "${run}" ] || continue | |
| 96 | + run_number="$(jq -r '.number' <<<"${run}")" | |
| 97 | + run_status="$(jq -r '.status' <<<"${run}")" | |
| 98 | + echo " run ${run_number}: ${run_status}" | |
| 99 | + case "${run_status}" in | |
| 100 | + queued | pending | running | in_progress | waiting) ;; | |
| 101 | + *) break ;; | |
| 102 | + esac | |
| 103 | +done | |
| 104 | + | |
| 105 | +if [ -n "${run_number}" ] && [ "$(call GET "/actions/runs/${run_number}/logs")" = "200" ]; then | |
| 106 | + jq -r '.jobs[].log // empty' "${work}/body" > "${work}/run.log" | |
| 107 | + grep -E '(^| )(uploaded |asset |::error::)' "${work}/run.log" | cut -c1-160 || true | |
| 108 | +fi | |
| 109 | +[ "${run_status}" = "success" ] || { echo "❌ the job did not succeed (run ${run_number:-none}: ${run_status:-no run seen})"; exit 1; } | |
| 110 | + | |
| 111 | +expected="$(find "${work}/branch/assets" -type f | wc -l | tr -d ' ')" | |
| 112 | +uploaded="$(grep -cE '(^| )asset ' "${work}/run.log" || true)" | |
| 113 | +[ "${uploaded}" = "${expected}" ] || { echo "❌ ${uploaded} assets on the release, ${expected} expected"; exit 1; } | |
| 114 | +echo "✅ ${expected} files on the draft ${TAG}" | |
| new file mode 100755 | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-04-upload.sh — the packages of release/<TAG>/ onto the draft. | ||
| 5 | +# | ||
| 6 | +# Rickub only accepts uploads from the token of a CI job. So this pushes a | ||
| 7 | +# temporary orphan branch holding the packages and a one-job workflow, waits for | ||
| 8 | +# the job, and deletes the branch, whatever happened. The local checkout is | ||
| 9 | +# never touched. | ||
| 10 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 11 | +load_token | ||
| 12 | + | ||
| 13 | +branch="local-ci-publish-${TAG}" | ||
| 14 | +run_timeout_seconds=900 | ||
| 15 | +branch_pushed="" | ||
| 16 | + | ||
| 17 | +remove_branch() { | ||
| 18 | + if [ -n "${branch_pushed}" ]; then | ||
| 19 | + echo "==> deleting the branch ${branch}" | ||
| 20 | + git -C "${work}/branch" push -q "${git_url}" --delete "${branch}" \ | ||
| 21 | + || echo "⚠️ could not delete ${branch}: delete it by hand" | ||
| 22 | + fi | ||
| 23 | + cleanup_work | ||
| 24 | +} | ||
| 25 | +trap remove_branch EXIT | ||
| 26 | + | ||
| 27 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 28 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is not a draft: run local-ci-03-create-draft.sh"; exit 1; } | ||
| 29 | + | ||
| 30 | +echo "==> preparing the temporary branch" | ||
| 31 | +git init -q -b "${branch}" "${work}/branch" | ||
| 32 | +mkdir -p "${work}/branch/assets" "${work}/branch/.github/workflows" | ||
| 33 | +# What goes up is what SHA256SUMS lists, and SHA256SUMS itself. | ||
| 34 | +while read -r _ name; do | ||
| 35 | + cp "${assets_dir}/${name}" "${work}/branch/assets/" | ||
| 36 | +done < "${assets_dir}/SHA256SUMS" | ||
| 37 | +cp "${assets_dir}/SHA256SUMS" "${work}/branch/assets/" | ||
| 38 | +printf '%s\n' "${TAG}" > "${work}/branch/TAG" | ||
| 39 | +cat > "${work}/branch/.github/workflows/local-ci-publish.yml" <<'WORKFLOW' | ||
| 40 | +name: local ci publish | ||
| 41 | +on: | ||
| 42 | + push: | ||
| 43 | + branches: | ||
| 44 | + - "local-ci-publish-*" | ||
| 45 | +permissions: | ||
| 46 | + contents: write | ||
| 47 | +jobs: | ||
| 48 | + upload: | ||
| 49 | + runs-on: ubuntu-latest | ||
| 50 | + steps: | ||
| 51 | + - uses: actions/checkout@v4 | ||
| 52 | + - name: Upload the binaries to the release | ||
| 53 | + env: | ||
| 54 | + GITHUB_TOKEN: ${{ github.token }} | ||
| 55 | + run: bash ./upload.sh | ||
| 56 | +WORKFLOW | ||
| 57 | +cat > "${work}/branch/upload.sh" <<'UPLOAD' | ||
| 58 | +#!/usr/bin/env bash | ||
| 59 | +set -euo pipefail | ||
| 60 | +tag="$(cat TAG)" | ||
| 61 | +api="${GITHUB_API_URL%/}/repos/${GITHUB_REPOSITORY}" | ||
| 62 | +config="$(mktemp)" | ||
| 63 | +printf 'header = "Authorization: Bearer %s"\n' "${GITHUB_TOKEN}" > "${config}" | ||
| 64 | +curl -fsS -K "${config}" "${api}/releases?per_page=100" > releases.json | ||
| 65 | +upload_url="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].upload_url // empty' releases.json | sed 's/{[^}]*}$//')" | ||
| 66 | +[ -n "${upload_url}" ] || { echo "::error::no release ${tag} visible to the job"; exit 1; } | ||
| 67 | +for file in assets/*; do | ||
| 68 | + name="$(basename "${file}")" | ||
| 69 | + status="$(curl -sS -o response.json -w '%{http_code}' -K "${config}" -X POST \ | ||
| 70 | + -H 'Content-Type: application/octet-stream' --data-binary @"${file}" "${upload_url}?name=${name}")" | ||
| 71 | + [ "${status}" = "201" ] || { echo "::error::HTTP ${status} uploading ${name}: $(cat response.json)"; exit 1; } | ||
| 72 | + echo "uploaded ${name}" | ||
| 73 | +done | ||
| 74 | +release_id="$(jq -r --arg tag "${tag}" '[.[] | select(.tag_name == $tag)][0].id' releases.json)" | ||
| 75 | +curl -fsS -K "${config}" "${api}/releases/${release_id}/assets" | jq -r '.[] | "asset \(.name) \(.size)"' | ||
| 76 | +UPLOAD | ||
| 77 | +git -C "${work}/branch" add -A | ||
| 78 | +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}" | ||
| 79 | +head_sha="$(git -C "${work}/branch" rev-parse HEAD)" | ||
| 80 | +echo " $(du -sh "${work}/branch/assets" | cut -f1) of packages" | ||
| 81 | + | ||
| 82 | +echo "==> pushing ${branch}" | ||
| 83 | +git -C "${work}/branch" push -q "${git_url}" "HEAD:refs/heads/${branch}" | ||
| 84 | +branch_pushed="yes" | ||
| 85 | + | ||
| 86 | +echo "==> waiting for the CI job" | ||
| 87 | +deadline=$(( SECONDS + run_timeout_seconds )) | ||
| 88 | +run_number="" | ||
| 89 | +run_status="" | ||
| 90 | +while [ "${SECONDS}" -lt "${deadline}" ]; do | ||
| 91 | + sleep 10 | ||
| 92 | + status="$(call GET /actions/runs)" | ||
| 93 | + [ "${status}" = "200" ] || continue | ||
| 94 | + run="$(jq -c --arg sha "${head_sha}" '[.items[] | select(.head_sha == $sha)][0] // empty' "${work}/body")" | ||
| 95 | + [ -n "${run}" ] || continue | ||
| 96 | + run_number="$(jq -r '.number' <<<"${run}")" | ||
| 97 | + run_status="$(jq -r '.status' <<<"${run}")" | ||
| 98 | + echo " run ${run_number}: ${run_status}" | ||
| 99 | + case "${run_status}" in | ||
| 100 | + queued | pending | running | in_progress | waiting) ;; | ||
| 101 | + *) break ;; | ||
| 102 | + esac | ||
| 103 | +done | ||
| 104 | + | ||
| 105 | +if [ -n "${run_number}" ] && [ "$(call GET "/actions/runs/${run_number}/logs")" = "200" ]; then | ||
| 106 | + jq -r '.jobs[].log // empty' "${work}/body" > "${work}/run.log" | ||
| 107 | + grep -E '(^| )(uploaded |asset |::error::)' "${work}/run.log" | cut -c1-160 || true | ||
| 108 | +fi | ||
| 109 | +[ "${run_status}" = "success" ] || { echo "❌ the job did not succeed (run ${run_number:-none}: ${run_status:-no run seen})"; exit 1; } | ||
| 110 | + | ||
| 111 | +expected="$(find "${work}/branch/assets" -type f | wc -l | tr -d ' ')" | ||
| 112 | +uploaded="$(grep -cE '(^| )asset ' "${work}/run.log" || true)" | ||
| 113 | +[ "${uploaded}" = "${expected}" ] || { echo "❌ ${uploaded} assets on the release, ${expected} expected"; exit 1; } | ||
| 114 | +echo "✅ ${expected} files on the draft ${TAG}" | ||
added
local-ci-05-publish.sh +42 -0 | new file mode 100755 | ||
| @@ -0,0 +1,42 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-05-publish.sh — the draft becomes public, as a prerelease. | |
| 5 | +# | |
| 6 | +# On Rickub a published prerelease becomes /releases/latest, so everybody who | |
| 7 | +# downloads the latest version gets this one. It asks you to type the tag first, | |
| 8 | +# then downloads what is public and compares it with release/<TAG>/. | |
| 9 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 10 | +load_token | |
| 11 | + | |
| 12 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | |
| 13 | +id="$(release_field id)" | |
| 14 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}: run local-ci-03-create-draft.sh"; exit 1; } | |
| 15 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is already public"; exit 1; } | |
| 16 | + | |
| 17 | +echo "/releases/latest is now: $(latest_location)" | |
| 18 | +echo "Publishing makes ${TAG} the latest version for everybody." | |
| 19 | +printf 'Type %s to publish: ' "${TAG}" | |
| 20 | +read -r answer || answer="" | |
| 21 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not published"; exit 1; } | |
| 22 | + | |
| 23 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"draft": false, "prerelease": true}')" | |
| 24 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | |
| 25 | +echo "==> published" | |
| 26 | + | |
| 27 | +echo "==> checking what is public" | |
| 28 | +mkdir -p "${work}/download" | |
| 29 | +curl -fsSL -m 60 "${web}/releases/download/${TAG}/SHA256SUMS" -o "${work}/download/SHA256SUMS" | |
| 30 | +cmp "${work}/download/SHA256SUMS" "${assets_dir}/SHA256SUMS" || { echo "❌ SHA256SUMS differs"; exit 1; } | |
| 31 | +while read -r _ name; do | |
| 32 | + curl -fsSL -m 300 "${web}/releases/download/${TAG}/${name}" -o "${work}/download/${name}" | |
| 33 | +done < "${assets_dir}/SHA256SUMS" | |
| 34 | +( cd "${work}/download" && sha256sum -c SHA256SUMS ) | |
| 35 | + | |
| 36 | +location="$(latest_location)" | |
| 37 | +echo "/releases/latest -> ${location}" | |
| 38 | +case "${location}" in | |
| 39 | + *"/${TAG}") ;; | |
| 40 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | |
| 41 | +esac | |
| 42 | +echo "✅ ${TAG} is public" | |
| new file mode 100755 | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-05-publish.sh — the draft becomes public, as a prerelease. | ||
| 5 | +# | ||
| 6 | +# On Rickub a published prerelease becomes /releases/latest, so everybody who | ||
| 7 | +# downloads the latest version gets this one. It asks you to type the tag first, | ||
| 8 | +# then downloads what is public and compares it with release/<TAG>/. | ||
| 9 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 10 | +load_token | ||
| 11 | + | ||
| 12 | +[ -f "${assets_dir}/SHA256SUMS" ] || { echo "❌ no ${assets_dir}/SHA256SUMS: run local-ci-02-build.sh"; exit 2; } | ||
| 13 | +id="$(release_field id)" | ||
| 14 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}: run local-ci-03-create-draft.sh"; exit 1; } | ||
| 15 | +[ "$(release_field draft)" = "true" ] || { echo "❌ ${TAG} is already public"; exit 1; } | ||
| 16 | + | ||
| 17 | +echo "/releases/latest is now: $(latest_location)" | ||
| 18 | +echo "Publishing makes ${TAG} the latest version for everybody." | ||
| 19 | +printf 'Type %s to publish: ' "${TAG}" | ||
| 20 | +read -r answer || answer="" | ||
| 21 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not published"; exit 1; } | ||
| 22 | + | ||
| 23 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"draft": false, "prerelease": true}')" | ||
| 24 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | ||
| 25 | +echo "==> published" | ||
| 26 | + | ||
| 27 | +echo "==> checking what is public" | ||
| 28 | +mkdir -p "${work}/download" | ||
| 29 | +curl -fsSL -m 60 "${web}/releases/download/${TAG}/SHA256SUMS" -o "${work}/download/SHA256SUMS" | ||
| 30 | +cmp "${work}/download/SHA256SUMS" "${assets_dir}/SHA256SUMS" || { echo "❌ SHA256SUMS differs"; exit 1; } | ||
| 31 | +while read -r _ name; do | ||
| 32 | + curl -fsSL -m 300 "${web}/releases/download/${TAG}/${name}" -o "${work}/download/${name}" | ||
| 33 | +done < "${assets_dir}/SHA256SUMS" | ||
| 34 | +( cd "${work}/download" && sha256sum -c SHA256SUMS ) | ||
| 35 | + | ||
| 36 | +location="$(latest_location)" | ||
| 37 | +echo "/releases/latest -> ${location}" | ||
| 38 | +case "${location}" in | ||
| 39 | + *"/${TAG}") ;; | ||
| 40 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | ||
| 41 | +esac | ||
| 42 | +echo "✅ ${TAG} is public" | ||
added
local-ci-06-promote.sh +46 -0 | new file mode 100755 | ||
| @@ -0,0 +1,46 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# local-ci-06-promote.sh — a published prerelease becomes a release. | |
| 5 | +# | |
| 6 | +# ./local-ci-06-promote.sh # the TAG of .release.env | |
| 7 | +# ./local-ci-06-promote.sh v1.0.5 # another published prerelease | |
| 8 | +# | |
| 9 | +# Only the "pre-release" label goes: the files, the notes and the tag stay as | |
| 10 | +# they are. On Rickub a published prerelease is already /releases/latest, so | |
| 11 | +# downloads should not change. It asks you to type the tag first. | |
| 12 | +source "$(dirname "$0")/local-ci-00-common.sh" | |
| 13 | +load_token | |
| 14 | + | |
| 15 | +TAG="${1:-${TAG}}" | |
| 16 | + | |
| 17 | +id="$(release_field id)" | |
| 18 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}"; exit 1; } | |
| 19 | +[ "$(release_field draft)" = "false" ] || { echo "❌ ${TAG} is still a draft: run local-ci-05-publish.sh first"; exit 1; } | |
| 20 | +[ "$(release_field prerelease)" = "true" ] || { echo "❌ ${TAG} is not a prerelease: nothing to do"; exit 1; } | |
| 21 | + | |
| 22 | +echo "/releases/latest is now: $(latest_location)" | |
| 23 | +echo "Promoting removes the pre-release label from ${TAG}." | |
| 24 | +printf 'Type %s to promote: ' "${TAG}" | |
| 25 | +read -r answer || answer="" | |
| 26 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not promoted"; exit 1; } | |
| 27 | + | |
| 28 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"prerelease": false}')" | |
| 29 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | |
| 30 | + | |
| 31 | +# Read the release back rather than trusting the 200: a field the server | |
| 32 | +# ignores would answer 200 too. | |
| 33 | +prerelease="$(release_field prerelease)" | |
| 34 | +draft="$(release_field draft)" | |
| 35 | +if [ "${prerelease}" != "false" ] || [ "${draft}" != "false" ]; then | |
| 36 | + echo "❌ ${TAG} reads back as prerelease=${prerelease}, draft=${draft}" | |
| 37 | + exit 1 | |
| 38 | +fi | |
| 39 | + | |
| 40 | +location="$(latest_location)" | |
| 41 | +echo "/releases/latest -> ${location}" | |
| 42 | +case "${location}" in | |
| 43 | + *"/${TAG}") ;; | |
| 44 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | |
| 45 | +esac | |
| 46 | +echo "✅ ${TAG} is a release" | |
| new file mode 100755 | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# local-ci-06-promote.sh — a published prerelease becomes a release. | ||
| 5 | +# | ||
| 6 | +# ./local-ci-06-promote.sh # the TAG of .release.env | ||
| 7 | +# ./local-ci-06-promote.sh v1.0.5 # another published prerelease | ||
| 8 | +# | ||
| 9 | +# Only the "pre-release" label goes: the files, the notes and the tag stay as | ||
| 10 | +# they are. On Rickub a published prerelease is already /releases/latest, so | ||
| 11 | +# downloads should not change. It asks you to type the tag first. | ||
| 12 | +source "$(dirname "$0")/local-ci-00-common.sh" | ||
| 13 | +load_token | ||
| 14 | + | ||
| 15 | +TAG="${1:-${TAG}}" | ||
| 16 | + | ||
| 17 | +id="$(release_field id)" | ||
| 18 | +[ -n "${id}" ] || { echo "❌ no release ${TAG}"; exit 1; } | ||
| 19 | +[ "$(release_field draft)" = "false" ] || { echo "❌ ${TAG} is still a draft: run local-ci-05-publish.sh first"; exit 1; } | ||
| 20 | +[ "$(release_field prerelease)" = "true" ] || { echo "❌ ${TAG} is not a prerelease: nothing to do"; exit 1; } | ||
| 21 | + | ||
| 22 | +echo "/releases/latest is now: $(latest_location)" | ||
| 23 | +echo "Promoting removes the pre-release label from ${TAG}." | ||
| 24 | +printf 'Type %s to promote: ' "${TAG}" | ||
| 25 | +read -r answer || answer="" | ||
| 26 | +[ "${answer}" = "${TAG}" ] || { echo "❌ not promoted"; exit 1; } | ||
| 27 | + | ||
| 28 | +status="$(call PATCH "/releases/${id}" -H 'Content-Type: application/json' -d '{"prerelease": false}')" | ||
| 29 | +[ "${status}" = "200" ] || { echo "❌ HTTP ${status}: $(cat "${work}/body")"; exit 1; } | ||
| 30 | + | ||
| 31 | +# Read the release back rather than trusting the 200: a field the server | ||
| 32 | +# ignores would answer 200 too. | ||
| 33 | +prerelease="$(release_field prerelease)" | ||
| 34 | +draft="$(release_field draft)" | ||
| 35 | +if [ "${prerelease}" != "false" ] || [ "${draft}" != "false" ]; then | ||
| 36 | + echo "❌ ${TAG} reads back as prerelease=${prerelease}, draft=${draft}" | ||
| 37 | + exit 1 | ||
| 38 | +fi | ||
| 39 | + | ||
| 40 | +location="$(latest_location)" | ||
| 41 | +echo "/releases/latest -> ${location}" | ||
| 42 | +case "${location}" in | ||
| 43 | + *"/${TAG}") ;; | ||
| 44 | + *) echo "⚠️ /releases/latest does not point at ${TAG}" ;; | ||
| 45 | +esac | ||
| 46 | +echo "✅ ${TAG} is a release" | ||
modified
scripts/build-release.sh +3 -3 | @@ -2,8 +2,8 @@ | ||
| 2 | 2 | # Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE |
| 3 | 3 | # |
| 4 | 4 | # Builds every release package of Sidekicks on this Mac, into dist/, then |
| 5 | -# writes dist/SHA256SUMS. The files are then attached by hand to the release | |
| 6 | -# that scripts/tag-release.sh starts (see RELEASING.md). | |
| 5 | +# writes dist/SHA256SUMS. These packages are not signed: local-ci-02-build.sh | |
| 6 | +# calls this script, then signs and notarizes the macOS ones (see RELEASING.md). | |
| 7 | 7 | # |
| 8 | 8 | # scripts/build-release.sh # macOS arm64, Windows amd64 and arm64 |
| 9 | 9 | # LINUX_ARCHES="amd64" scripts/build-release.sh # Linux packages too (not released for now) |
| @@ -83,4 +83,4 @@ sums="$(mktemp)" | ||
| 83 | 83 | mv "$sums" "$dist/SHA256SUMS" |
| 84 | 84 | chmod 644 "$dist/SHA256SUMS" |
| 85 | 85 | cat "$dist/SHA256SUMS" |
| 86 | -step "Done: attach every file of dist/ to the release v$version (scripts/tag-release.sh creates it)" | |
| 86 | +step "Done: the packages of $version are in dist/ (local-ci-02-build.sh signs the macOS ones)" | |
| @@ -2,8 +2,8 @@ | |||
| 2 | # Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | 2 | # Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE |
| 3 | # | 3 | # |
| 4 | # Builds every release package of Sidekicks on this Mac, into dist/, then | 4 | # Builds every release package of Sidekicks on this Mac, into dist/, then |
| 5 | -# writes dist/SHA256SUMS. The files are then attached by hand to the release | 5 | +# writes dist/SHA256SUMS. These packages are not signed: local-ci-02-build.sh |
| 6 | -# that scripts/tag-release.sh starts (see RELEASING.md). | 6 | +# calls this script, then signs and notarizes the macOS ones (see RELEASING.md). |
| 7 | # | 7 | # |
| 8 | # scripts/build-release.sh # macOS arm64, Windows amd64 and arm64 | 8 | # scripts/build-release.sh # macOS arm64, Windows amd64 and arm64 |
| 9 | # LINUX_ARCHES="amd64" scripts/build-release.sh # Linux packages too (not released for now) | 9 | # LINUX_ARCHES="amd64" scripts/build-release.sh # Linux packages too (not released for now) |
| @@ -83,4 +83,4 @@ sums="$(mktemp)" | |||
| 83 | mv "$sums" "$dist/SHA256SUMS" | 83 | mv "$sums" "$dist/SHA256SUMS" |
| 84 | chmod 644 "$dist/SHA256SUMS" | 84 | chmod 644 "$dist/SHA256SUMS" |
| 85 | cat "$dist/SHA256SUMS" | 85 | cat "$dist/SHA256SUMS" |
| 86 | -step "Done: attach every file of dist/ to the release v$version (scripts/tag-release.sh creates it)" | 86 | +step "Done: the packages of $version are in dist/ (local-ci-02-build.sh signs the macOS ones)" |
modified
scripts/package.sh +1 -1 | @@ -51,7 +51,7 @@ names() { | ||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | # What a release holds, as <system>/<arch>: the targets scripts/build-release.sh |
| 54 | -# builds and scripts/tag-release.sh expects in dist/. For now: macOS on Apple | |
| 54 | +# builds and local-ci-02-build.sh stages. For now: macOS on Apple | |
| 55 | 55 | # Silicon and Windows; Linux is built on demand (LINUX_ARCHES). |
| 56 | 56 | RELEASE_TARGETS="macos/arm64 windows/amd64 windows/arm64" |
| 57 | 57 | |
| @@ -51,7 +51,7 @@ names() { | |||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | # What a release holds, as <system>/<arch>: the targets scripts/build-release.sh | 53 | # What a release holds, as <system>/<arch>: the targets scripts/build-release.sh |
| 54 | -# builds and scripts/tag-release.sh expects in dist/. For now: macOS on Apple | 54 | +# builds and local-ci-02-build.sh stages. For now: macOS on Apple |
| 55 | # Silicon and Windows; Linux is built on demand (LINUX_ARCHES). | 55 | # Silicon and Windows; Linux is built on demand (LINUX_ARCHES). |
| 56 | RELEASE_TARGETS="macos/arm64 windows/amd64 windows/arm64" | 56 | RELEASE_TARGETS="macos/arm64 windows/amd64 windows/arm64" |
| 57 | 57 | ||
added
scripts/sync-build-assets.sh +55 -0 | new file mode 100755 | ||
| @@ -0,0 +1,55 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | +# | |
| 4 | +# Brings the files generated from build/config.yml up to date, then puts back | |
| 5 | +# what the generator gets wrong. Run it after changing info.version; the | |
| 6 | +# local CI (local-ci-02-build.sh) runs it too, and stops when it changed | |
| 7 | +# something, so that the result is committed before the release. | |
| 8 | +# | |
| 9 | +# scripts/sync-build-assets.sh # update, patch, verify | |
| 10 | +# scripts/sync-build-assets.sh --check # verify only, change nothing | |
| 11 | +# | |
| 12 | +# Why: `wails3 task common:update:build-assets` rewrites build/darwin/Info.plist, | |
| 13 | +# Info.dev.plist, build/windows/info.json, wails.exe.manifest, the NSIS | |
| 14 | +# wails_tools.nsh and build/linux/nfpm/nfpm.yaml from build/config.yml, and | |
| 15 | +# resets LSMinimumSystemVersion to 12.0.0. Sidekicks needs macOS 13 or later | |
| 16 | +# (the Go build targets 13.0 too, see build/darwin/Taskfile.yml). Details: | |
| 17 | +# docs/en/how-to/set-the-version.md. | |
| 18 | +set -euo pipefail | |
| 19 | + | |
| 20 | +root="$(cd "$(dirname "$0")/.." && pwd)" | |
| 21 | +cd "$root" | |
| 22 | + | |
| 23 | +minimum="13.0.0" | |
| 24 | +plists=(build/darwin/Info.plist build/darwin/Info.dev.plist) | |
| 25 | + | |
| 26 | +die() { echo "sync-build-assets.sh: $*" >&2; exit 1; } | |
| 27 | + | |
| 28 | +# plist_value FILE KEY prints the <string> that follows <key>KEY</key>. | |
| 29 | +plist_value() { | |
| 30 | + awk -v key="$2" '$0 ~ "<key>" key "</key>" { getline; gsub(/<[^>]*>|[ \t]/, ""); print; exit }' "$1" | |
| 31 | +} | |
| 32 | + | |
| 33 | +# set_minimum FILE rewrites the <string> that follows LSMinimumSystemVersion. | |
| 34 | +set_minimum() { | |
| 35 | + sed -i.bak "/<key>LSMinimumSystemVersion<\/key>/{n;s|<string>[^<]*</string>|<string>$minimum</string>|;}" "$1" | |
| 36 | + rm -f "$1.bak" | |
| 37 | +} | |
| 38 | + | |
| 39 | +version="$(scripts/package.sh version)" | |
| 40 | + | |
| 41 | +if [ "${1:-}" != "--check" ]; then | |
| 42 | + command -v wails3 >/dev/null || die "wails3 is missing" | |
| 43 | + wails3 task common:update:build-assets | |
| 44 | + for plist in "${plists[@]}"; do set_minimum "$plist"; done | |
| 45 | +fi | |
| 46 | + | |
| 47 | +for plist in "${plists[@]}"; do | |
| 48 | + [ "$(plist_value "$plist" LSMinimumSystemVersion)" = "$minimum" ] \ | |
| 49 | + || die "$plist: LSMinimumSystemVersion is not $minimum" | |
| 50 | + for key in CFBundleShortVersionString CFBundleVersion; do | |
| 51 | + [ "$(plist_value "$plist" "$key")" = "$version" ] \ | |
| 52 | + || die "$plist: $key is not $version (run scripts/sync-build-assets.sh)" | |
| 53 | + done | |
| 54 | +done | |
| 55 | +echo "build assets are in sync with info.version $version (LSMinimumSystemVersion $minimum)" | |
| new file mode 100755 | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | +# | ||
| 4 | +# Brings the files generated from build/config.yml up to date, then puts back | ||
| 5 | +# what the generator gets wrong. Run it after changing info.version; the | ||
| 6 | +# local CI (local-ci-02-build.sh) runs it too, and stops when it changed | ||
| 7 | +# something, so that the result is committed before the release. | ||
| 8 | +# | ||
| 9 | +# scripts/sync-build-assets.sh # update, patch, verify | ||
| 10 | +# scripts/sync-build-assets.sh --check # verify only, change nothing | ||
| 11 | +# | ||
| 12 | +# Why: `wails3 task common:update:build-assets` rewrites build/darwin/Info.plist, | ||
| 13 | +# Info.dev.plist, build/windows/info.json, wails.exe.manifest, the NSIS | ||
| 14 | +# wails_tools.nsh and build/linux/nfpm/nfpm.yaml from build/config.yml, and | ||
| 15 | +# resets LSMinimumSystemVersion to 12.0.0. Sidekicks needs macOS 13 or later | ||
| 16 | +# (the Go build targets 13.0 too, see build/darwin/Taskfile.yml). Details: | ||
| 17 | +# docs/en/how-to/set-the-version.md. | ||
| 18 | +set -euo pipefail | ||
| 19 | + | ||
| 20 | +root="$(cd "$(dirname "$0")/.." && pwd)" | ||
| 21 | +cd "$root" | ||
| 22 | + | ||
| 23 | +minimum="13.0.0" | ||
| 24 | +plists=(build/darwin/Info.plist build/darwin/Info.dev.plist) | ||
| 25 | + | ||
| 26 | +die() { echo "sync-build-assets.sh: $*" >&2; exit 1; } | ||
| 27 | + | ||
| 28 | +# plist_value FILE KEY prints the <string> that follows <key>KEY</key>. | ||
| 29 | +plist_value() { | ||
| 30 | + awk -v key="$2" '$0 ~ "<key>" key "</key>" { getline; gsub(/<[^>]*>|[ \t]/, ""); print; exit }' "$1" | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +# set_minimum FILE rewrites the <string> that follows LSMinimumSystemVersion. | ||
| 34 | +set_minimum() { | ||
| 35 | + sed -i.bak "/<key>LSMinimumSystemVersion<\/key>/{n;s|<string>[^<]*</string>|<string>$minimum</string>|;}" "$1" | ||
| 36 | + rm -f "$1.bak" | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +version="$(scripts/package.sh version)" | ||
| 40 | + | ||
| 41 | +if [ "${1:-}" != "--check" ]; then | ||
| 42 | + command -v wails3 >/dev/null || die "wails3 is missing" | ||
| 43 | + wails3 task common:update:build-assets | ||
| 44 | + for plist in "${plists[@]}"; do set_minimum "$plist"; done | ||
| 45 | +fi | ||
| 46 | + | ||
| 47 | +for plist in "${plists[@]}"; do | ||
| 48 | + [ "$(plist_value "$plist" LSMinimumSystemVersion)" = "$minimum" ] \ | ||
| 49 | + || die "$plist: LSMinimumSystemVersion is not $minimum" | ||
| 50 | + for key in CFBundleShortVersionString CFBundleVersion; do | ||
| 51 | + [ "$(plist_value "$plist" "$key")" = "$version" ] \ | ||
| 52 | + || die "$plist: $key is not $version (run scripts/sync-build-assets.sh)" | ||
| 53 | + done | ||
| 54 | +done | ||
| 55 | +echo "build assets are in sync with info.version $version (LSMinimumSystemVersion $minimum)" | ||
deleted
scripts/tag-release.sh +0 -55 | deleted file mode 100755 | ||
| @@ -1,55 +0,0 @@ | ||
| 1 | -#!/usr/bin/env bash | |
| 2 | -# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | -# | |
| 4 | -# Tags the release of the version of build/config.yml (v<version>) on main | |
| 5 | -# and pushes the tag: the Release workflow then creates the release on | |
| 6 | -# Rickub, and the files of dist/ are attached to it by hand (RELEASING.md). | |
| 7 | -# | |
| 8 | -# scripts/tag-release.sh # checks, tags, pushes to origin | |
| 9 | -# scripts/tag-release.sh --no-push # checks and tags locally only | |
| 10 | -# scripts/tag-release.sh --remote fork | |
| 11 | -# | |
| 12 | -# Refuses when the working tree has changes, when not on main, when main is | |
| 13 | -# not the same as on the remote, or when the tag exists. Warns when dist/ | |
| 14 | -# misses a package of this version (scripts/build-release.sh builds them). | |
| 15 | -set -euo pipefail | |
| 16 | - | |
| 17 | -root="$(cd "$(dirname "$0")/.." && pwd)" | |
| 18 | -remote=origin | |
| 19 | -push=true | |
| 20 | - | |
| 21 | -while [ $# -gt 0 ]; do | |
| 22 | - case "$1" in | |
| 23 | - --remote) remote="${2:?--remote needs a name}"; shift 2 ;; | |
| 24 | - --no-push) push=false; shift ;; | |
| 25 | - *) echo "tag-release.sh: unknown option $1" >&2; exit 2 ;; | |
| 26 | - esac | |
| 27 | -done | |
| 28 | - | |
| 29 | -die() { echo "tag-release.sh: $*" >&2; exit 1; } | |
| 30 | - | |
| 31 | -cd "$root" | |
| 32 | -version="$(scripts/package.sh version)" | |
| 33 | -tag="v$version" | |
| 34 | - | |
| 35 | -[ -z "$(git status --porcelain --untracked-files=no)" ] || die "the working tree has uncommitted changes: commit them first" | |
| 36 | -[ "$(git branch --show-current)" = main ] || die "releases are tagged on main (current branch: $(git branch --show-current))" | |
| 37 | -git fetch --quiet --tags "$remote" main | |
| 38 | -[ "$(git rev-parse HEAD)" = "$(git rev-parse "$remote/main")" ] || die "main differs from $remote/main: pull or push first" | |
| 39 | -if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then | |
| 40 | - die "the tag $tag already exists: raise info.version in build/config.yml" | |
| 41 | -fi | |
| 42 | - | |
| 43 | -missing="" | |
| 44 | -for name in $(scripts/package.sh release-names); do | |
| 45 | - [ -f "dist/$name" ] || missing="$missing $name" | |
| 46 | -done | |
| 47 | -[ -z "$missing" ] || echo "tag-release.sh: warning: dist/ has no$missing (scripts/build-release.sh builds them)" >&2 | |
| 48 | - | |
| 49 | -git tag -a "$tag" -m "Sidekicks $version" | |
| 50 | -if [ "$push" = false ]; then | |
| 51 | - echo "Tagged $tag locally (not pushed)." | |
| 52 | - exit 0 | |
| 53 | -fi | |
| 54 | -git push "$remote" "$tag" | |
| 55 | -echo "Pushed $tag: the Release workflow creates the release; then attach the files of dist/ to it." | |
| deleted file mode 100755 | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | -#!/usr/bin/env bash | ||
| 2 | -# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | -# | ||
| 4 | -# Tags the release of the version of build/config.yml (v<version>) on main | ||
| 5 | -# and pushes the tag: the Release workflow then creates the release on | ||
| 6 | -# Rickub, and the files of dist/ are attached to it by hand (RELEASING.md). | ||
| 7 | -# | ||
| 8 | -# scripts/tag-release.sh # checks, tags, pushes to origin | ||
| 9 | -# scripts/tag-release.sh --no-push # checks and tags locally only | ||
| 10 | -# scripts/tag-release.sh --remote fork | ||
| 11 | -# | ||
| 12 | -# Refuses when the working tree has changes, when not on main, when main is | ||
| 13 | -# not the same as on the remote, or when the tag exists. Warns when dist/ | ||
| 14 | -# misses a package of this version (scripts/build-release.sh builds them). | ||
| 15 | -set -euo pipefail | ||
| 16 | - | ||
| 17 | -root="$(cd "$(dirname "$0")/.." && pwd)" | ||
| 18 | -remote=origin | ||
| 19 | -push=true | ||
| 20 | - | ||
| 21 | -while [ $# -gt 0 ]; do | ||
| 22 | - case "$1" in | ||
| 23 | - --remote) remote="${2:?--remote needs a name}"; shift 2 ;; | ||
| 24 | - --no-push) push=false; shift ;; | ||
| 25 | - *) echo "tag-release.sh: unknown option $1" >&2; exit 2 ;; | ||
| 26 | - esac | ||
| 27 | -done | ||
| 28 | - | ||
| 29 | -die() { echo "tag-release.sh: $*" >&2; exit 1; } | ||
| 30 | - | ||
| 31 | -cd "$root" | ||
| 32 | -version="$(scripts/package.sh version)" | ||
| 33 | -tag="v$version" | ||
| 34 | - | ||
| 35 | -[ -z "$(git status --porcelain --untracked-files=no)" ] || die "the working tree has uncommitted changes: commit them first" | ||
| 36 | -[ "$(git branch --show-current)" = main ] || die "releases are tagged on main (current branch: $(git branch --show-current))" | ||
| 37 | -git fetch --quiet --tags "$remote" main | ||
| 38 | -[ "$(git rev-parse HEAD)" = "$(git rev-parse "$remote/main")" ] || die "main differs from $remote/main: pull or push first" | ||
| 39 | -if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then | ||
| 40 | - die "the tag $tag already exists: raise info.version in build/config.yml" | ||
| 41 | -fi | ||
| 42 | - | ||
| 43 | -missing="" | ||
| 44 | -for name in $(scripts/package.sh release-names); do | ||
| 45 | - [ -f "dist/$name" ] || missing="$missing $name" | ||
| 46 | -done | ||
| 47 | -[ -z "$missing" ] || echo "tag-release.sh: warning: dist/ has no$missing (scripts/build-release.sh builds them)" >&2 | ||
| 48 | - | ||
| 49 | -git tag -a "$tag" -m "Sidekicks $version" | ||
| 50 | -if [ "$push" = false ]; then | ||
| 51 | - echo "Tagged $tag locally (not pushed)." | ||
| 52 | - exit 0 | ||
| 53 | -fi | ||
| 54 | -git push "$remote" "$tag" | ||
| 55 | -echo "Pushed $tag: the Release workflow creates the release; then attach the files of dist/ to it." | ||
deleted
scripts/tag-release_test.sh +0 -67 | deleted file mode 100755 | ||
| @@ -1,67 +0,0 @@ | ||
| 1 | -#!/usr/bin/env bash | |
| 2 | -# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | |
| 3 | -# | |
| 4 | -# Tests for tag-release.sh, on a throwaway clone of a bare repository. | |
| 5 | -# | |
| 6 | -# Usage: scripts/tag-release_test.sh | |
| 7 | - | |
| 8 | -set -eu | |
| 9 | - | |
| 10 | -here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| 11 | -failures=0 | |
| 12 | -work="$(mktemp -d)" | |
| 13 | -trap 'rm -rf "$work"' EXIT | |
| 14 | - | |
| 15 | -ok() { echo "ok $1"; } | |
| 16 | -fail() { echo "FAIL $1"; failures=$((failures + 1)); } | |
| 17 | -export GIT_AUTHOR_NAME=test GIT_AUTHOR_EMAIL=test@example.com GIT_COMMITTER_NAME=test GIT_COMMITTER_EMAIL=test@example.com | |
| 18 | - | |
| 19 | -# expect <name> <0|1> <command…>: the script's success or failure. | |
| 20 | -expect() { | |
| 21 | - local name="$1" want="$2" | |
| 22 | - shift 2 | |
| 23 | - if (cd "$work/repo" && "$@") >"$work/out" 2>&1; then got=0; else got=1; fi | |
| 24 | - if [ "$got" = "$want" ]; then ok "$name"; else fail "$name"; sed 's/^/ /' "$work/out"; fi | |
| 25 | -} | |
| 26 | - | |
| 27 | -git init -q --bare -b main "$work/remote.git" | |
| 28 | -git init -q -b main "$work/repo" | |
| 29 | -mkdir -p "$work/repo/scripts" "$work/repo/build" | |
| 30 | -cp "$here/package.sh" "$here/tag-release.sh" "$work/repo/scripts/" | |
| 31 | -printf 'info:\n version: "1.2.3"\n' > "$work/repo/build/config.yml" | |
| 32 | -printf 'dist/\n' > "$work/repo/.gitignore" | |
| 33 | -git -C "$work/repo" add -A | |
| 34 | -git -C "$work/repo" commit -q -m source | |
| 35 | -git -C "$work/repo" remote add origin "$work/remote.git" | |
| 36 | -git -C "$work/repo" push -q origin main | |
| 37 | - | |
| 38 | -printf 'changed\n' >> "$work/repo/build/config.yml" | |
| 39 | -expect "refuses uncommitted changes" 1 scripts/tag-release.sh | |
| 40 | -git -C "$work/repo" checkout -q -- build/config.yml | |
| 41 | - | |
| 42 | -git -C "$work/repo" checkout -q -b feature | |
| 43 | -expect "refuses another branch than main" 1 scripts/tag-release.sh | |
| 44 | -git -C "$work/repo" checkout -q main | |
| 45 | - | |
| 46 | -git -C "$work/repo" commit -q --allow-empty -m "not pushed" | |
| 47 | -expect "refuses a main that differs from the remote" 1 scripts/tag-release.sh | |
| 48 | -git -C "$work/repo" push -q origin main | |
| 49 | - | |
| 50 | -expect "tags and pushes, warning about missing packages" 0 scripts/tag-release.sh | |
| 51 | -grep -q "warning: dist/ has no" "$work/out" && ok "says which packages are missing" || fail "says which packages are missing" | |
| 52 | -[ "$(git -C "$work/remote.git" tag)" = v1.2.3 ] && ok "the tag v1.2.3 is on the remote" || fail "the tag v1.2.3 is on the remote" | |
| 53 | -[ "$(git -C "$work/remote.git" cat-file -t v1.2.3)" = tag ] && ok "the tag is annotated" || fail "the tag is annotated" | |
| 54 | - | |
| 55 | -expect "refuses an existing tag" 1 scripts/tag-release.sh | |
| 56 | - | |
| 57 | -printf 'info:\n version: "1.2.4"\n' > "$work/repo/build/config.yml" | |
| 58 | -git -C "$work/repo" commit -q -am "1.2.4" | |
| 59 | -git -C "$work/repo" push -q origin main | |
| 60 | -mkdir -p "$work/repo/dist" | |
| 61 | -for name in $("$work/repo/scripts/package.sh" release-names); do : > "$work/repo/dist/$name"; done | |
| 62 | -expect "--no-push tags locally only" 0 scripts/tag-release.sh --no-push | |
| 63 | -grep -q warning "$work/out" && fail "no warning when dist/ is complete" || ok "no warning when dist/ is complete" | |
| 64 | -git -C "$work/repo" rev-parse -q --verify refs/tags/v1.2.4 >/dev/null && [ -z "$(git -C "$work/remote.git" tag -l v1.2.4)" ] && ok "the local tag is not pushed" || fail "the local tag is not pushed" | |
| 65 | - | |
| 66 | -if [ "$failures" -gt 0 ]; then echo "$failures failed"; exit 1; fi | |
| 67 | -echo "all tag-release tests passed" | |
| deleted file mode 100755 | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | -#!/usr/bin/env bash | ||
| 2 | -# Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE | ||
| 3 | -# | ||
| 4 | -# Tests for tag-release.sh, on a throwaway clone of a bare repository. | ||
| 5 | -# | ||
| 6 | -# Usage: scripts/tag-release_test.sh | ||
| 7 | - | ||
| 8 | -set -eu | ||
| 9 | - | ||
| 10 | -here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 11 | -failures=0 | ||
| 12 | -work="$(mktemp -d)" | ||
| 13 | -trap 'rm -rf "$work"' EXIT | ||
| 14 | - | ||
| 15 | -ok() { echo "ok $1"; } | ||
| 16 | -fail() { echo "FAIL $1"; failures=$((failures + 1)); } | ||
| 17 | -export GIT_AUTHOR_NAME=test GIT_AUTHOR_EMAIL=test@example.com GIT_COMMITTER_NAME=test GIT_COMMITTER_EMAIL=test@example.com | ||
| 18 | - | ||
| 19 | -# expect <name> <0|1> <command…>: the script's success or failure. | ||
| 20 | -expect() { | ||
| 21 | - local name="$1" want="$2" | ||
| 22 | - shift 2 | ||
| 23 | - if (cd "$work/repo" && "$@") >"$work/out" 2>&1; then got=0; else got=1; fi | ||
| 24 | - if [ "$got" = "$want" ]; then ok "$name"; else fail "$name"; sed 's/^/ /' "$work/out"; fi | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -git init -q --bare -b main "$work/remote.git" | ||
| 28 | -git init -q -b main "$work/repo" | ||
| 29 | -mkdir -p "$work/repo/scripts" "$work/repo/build" | ||
| 30 | -cp "$here/package.sh" "$here/tag-release.sh" "$work/repo/scripts/" | ||
| 31 | -printf 'info:\n version: "1.2.3"\n' > "$work/repo/build/config.yml" | ||
| 32 | -printf 'dist/\n' > "$work/repo/.gitignore" | ||
| 33 | -git -C "$work/repo" add -A | ||
| 34 | -git -C "$work/repo" commit -q -m source | ||
| 35 | -git -C "$work/repo" remote add origin "$work/remote.git" | ||
| 36 | -git -C "$work/repo" push -q origin main | ||
| 37 | - | ||
| 38 | -printf 'changed\n' >> "$work/repo/build/config.yml" | ||
| 39 | -expect "refuses uncommitted changes" 1 scripts/tag-release.sh | ||
| 40 | -git -C "$work/repo" checkout -q -- build/config.yml | ||
| 41 | - | ||
| 42 | -git -C "$work/repo" checkout -q -b feature | ||
| 43 | -expect "refuses another branch than main" 1 scripts/tag-release.sh | ||
| 44 | -git -C "$work/repo" checkout -q main | ||
| 45 | - | ||
| 46 | -git -C "$work/repo" commit -q --allow-empty -m "not pushed" | ||
| 47 | -expect "refuses a main that differs from the remote" 1 scripts/tag-release.sh | ||
| 48 | -git -C "$work/repo" push -q origin main | ||
| 49 | - | ||
| 50 | -expect "tags and pushes, warning about missing packages" 0 scripts/tag-release.sh | ||
| 51 | -grep -q "warning: dist/ has no" "$work/out" && ok "says which packages are missing" || fail "says which packages are missing" | ||
| 52 | -[ "$(git -C "$work/remote.git" tag)" = v1.2.3 ] && ok "the tag v1.2.3 is on the remote" || fail "the tag v1.2.3 is on the remote" | ||
| 53 | -[ "$(git -C "$work/remote.git" cat-file -t v1.2.3)" = tag ] && ok "the tag is annotated" || fail "the tag is annotated" | ||
| 54 | - | ||
| 55 | -expect "refuses an existing tag" 1 scripts/tag-release.sh | ||
| 56 | - | ||
| 57 | -printf 'info:\n version: "1.2.4"\n' > "$work/repo/build/config.yml" | ||
| 58 | -git -C "$work/repo" commit -q -am "1.2.4" | ||
| 59 | -git -C "$work/repo" push -q origin main | ||
| 60 | -mkdir -p "$work/repo/dist" | ||
| 61 | -for name in $("$work/repo/scripts/package.sh" release-names); do : > "$work/repo/dist/$name"; done | ||
| 62 | -expect "--no-push tags locally only" 0 scripts/tag-release.sh --no-push | ||
| 63 | -grep -q warning "$work/out" && fail "no warning when dist/ is complete" || ok "no warning when dist/ is complete" | ||
| 64 | -git -C "$work/repo" rev-parse -q --verify refs/tags/v1.2.4 >/dev/null && [ -z "$(git -C "$work/remote.git" tag -l v1.2.4)" ] && ok "the local tag is not pushed" || fail "the local tag is not pushed" | ||
| 65 | - | ||
| 66 | -if [ "$failures" -gt 0 ]; then echo "$failures failed"; exit 1; fi | ||
| 67 | -echo "all tag-release tests passed" | ||