From 0fd15e173c8b281e7ffd5030d778fb15e3797184 Mon Sep 17 00:00:00 2001 From: ademboukabes Date: Tue, 13 Oct 2026 01:59:45 +0100 Subject: [PATCH 1/2] dist(goreleaser): add Scoop bucket manifest for Windows distribution Configure GoReleaser to publish a Scoop manifest to MicroClub-USTHB/scoop-bucket targeting Windows amd64 and arm64. Add conditional skip_upload to safely bypass publishing when SCOOP_BUCKET_TOKEN is not configured, matching the Homebrew tap setup. Pass SCOOP_BUCKET_TOKEN in GitHub Actions release workflow. --- .github/workflows/release.yml | 3 +++ .goreleaser.yaml | 30 +++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bd4d4b..9a9791b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,3 +36,6 @@ jobs: # Optional: set this secret (write access to MicroClub-USTHB/homebrew-tap) # to publish the Homebrew cask. Without it the cask push is skipped. HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + # Optional: set this secret (write access to MicroClub-USTHB/scoop-bucket) + # to publish the Scoop manifest. Without it the manifest push is skipped. + SCOOP_BUCKET_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3df2c14..076fb71 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,7 +1,8 @@ # goreleaser configuration for the mctf CLI. -# Cuts cross-platform binaries, archives, checksums, Linux packages, and a -# Homebrew formula on every `vX.Y.Z` tag. Run `goreleaser check` to validate -# and `goreleaser release --snapshot --clean` for a dry run. +# Cuts cross-platform binaries, archives, checksums, Linux packages, a +# Homebrew cask, and a Scoop manifest on every `vX.Y.Z` tag. Run +# `goreleaser check` to validate and `goreleaser release --snapshot --clean` +# for a dry run. version: 2 project_name: mctf @@ -78,11 +79,11 @@ homebrew_casks: - name: mctf # Skip the tap push until HOMEBREW_TAP_TOKEN is configured, so a release # still succeeds (binaries/packages publish) before the tap is set up. - skip_upload: "{{ if .Env.HOMEBREW_TAP_TOKEN }}false{{ else }}true{{ end }}" + skip_upload: '{{ if index .Env "HOMEBREW_TAP_TOKEN" }}false{{ else }}true{{ end }}' repository: owner: MicroClub-USTHB name: homebrew-tap - token: "{{ .Env.HOMEBREW_TAP_TOKEN }}" + token: '{{ index .Env "HOMEBREW_TAP_TOKEN" }}' homepage: https://github.com/MicroClub-USTHB/mctf-cli description: MCTF — Modern CTF Framework CLI # Strip the quarantine attribute so the unsigned binary runs on macOS. @@ -93,6 +94,25 @@ homebrew_casks: system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/mctf"] end +# Scoop bucket manifest pushed to MicroClub-USTHB/scoop-bucket (Windows). +# Requires a SCOOP_BUCKET_TOKEN secret with write access to that repo. +scoops: + - name: mctf + # Skip the bucket push until SCOOP_BUCKET_TOKEN is configured, so a release + # still succeeds (binaries/packages publish) before the bucket is set up. + skip_upload: '{{ if index .Env "SCOOP_BUCKET_TOKEN" }}false{{ else }}true{{ end }}' + repository: + owner: MicroClub-USTHB + name: scoop-bucket + token: '{{ index .Env "SCOOP_BUCKET_TOKEN" }}' + commit_author: + name: microclub-bot + email: dev@microclub.info + commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" + homepage: https://github.com/MicroClub-USTHB/mctf-cli + description: MCTF — Modern CTF Framework CLI + license: MIT + changelog: use: git sort: asc From 48c0fac1e8a7d98a4949408266d7b13d9830d209 Mon Sep 17 00:00:00 2001 From: ademboukabes Date: Tue, 13 Oct 2026 01:59:50 +0100 Subject: [PATCH 2/2] docs: document Scoop installation and setup in README, RELEASING, and BACKLOG Document Scoop install commands in README.md under the Install section, add the one-time admin setup guide in docs/RELEASING.md, and mark the Scoop bucket task as shipped in docs/BACKLOG.md. --- README.md | 8 ++++++-- docs/BACKLOG.md | 2 +- docs/RELEASING.md | 15 +++++++++++++++ docs/spec/CHANGELOG.md | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a8fd7a..c5ffd6a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ generated, never hand-edited. # Homebrew (macOS / Linux) brew install MicroClub-USTHB/tap/mctf +# Scoop (Windows) +scoop bucket add microclub https://github.com/MicroClub-USTHB/scoop-bucket +scoop install mctf + # Go go install github.com/MicroClub-USTHB/mctf-cli@latest @@ -94,8 +98,8 @@ Run `mctf --help` for the full command set, or see - **Plugin system** — language-agnostic plugins (subprocess + JSON-RPC over stdio) receive lifecycle hooks (`before_deploy` / `after_deploy` today); best-effort and crash-isolated. See [`docs/spec/plugins.md`](docs/spec/plugins.md). -- Releases ship cross-platform binaries, `.deb`/`.rpm`, a Homebrew cask, and a - GHCR image via goreleaser. +- Releases ship cross-platform binaries, `.deb`/`.rpm`, a Homebrew cask, a + Scoop manifest, and a GHCR image via goreleaser. See the [backlog issues](https://github.com/MicroClub-USTHB/mctf-cli/issues) for what's planned (Terraform `mctf infra`, rCTF/webhook platforms, more plugin diff --git a/docs/BACKLOG.md b/docs/BACKLOG.md index b47effb..0d821da 100644 --- a/docs/BACKLOG.md +++ b/docs/BACKLOG.md @@ -35,7 +35,7 @@ Open work organized by size. Each line is intentionally GitHub-issue-shaped: tit - ~~**goreleaser** — cross-platform binaries (darwin-arm64 / amd64, linux-amd64 / arm64, windows-amd64).~~ **Shipped** (`.goreleaser.yaml` + release workflow; see `docs/RELEASING.md`). - ~~**Homebrew tap** — formula in `MicroClub-USTHB/homebrew-tap`.~~ **Shipped** (Homebrew cask; needs one-time tap repo + `HOMEBREW_TAP_TOKEN`). - ~~**`.deb` / `.rpm`** — via goreleaser.~~ **Shipped** (nfpms). -- **Scoop bucket** — for Windows (needs a bucket repo; config to follow). +- ~~**Scoop bucket** — for Windows (needs a bucket repo; config to follow).~~ **Shipped** (GoReleaser `scoops`; needs one-time bucket repo + `SCOOP_BUCKET_TOKEN`). - ~~**Docker image of `mctf` itself** — `ghcr.io/microclub-usthb/mctf:` for CI use.~~ **Shipped** (goreleaser `dockers` → GHCR; amd64, multi-arch to follow). ## CI / quality diff --git a/docs/RELEASING.md b/docs/RELEASING.md index d86bb7c..6cb6725 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -15,6 +15,7 @@ publishes, for linux/macOS/windows on amd64 + arm64: - archives (`.tar.gz`, `.zip` on Windows) + `checksums.txt` - Linux packages (`.deb`, `.rpm`) - a Homebrew cask pushed to `MicroClub-USTHB/homebrew-tap` +- a Scoop manifest pushed to `MicroClub-USTHB/scoop-bucket` - a Docker image at `ghcr.io/microclub-usthb/mctf:` and `:latest` - man pages (one per command), bundled in the archives (`man/`) and installed to `/usr/share/man/man1` by the `.deb`/`.rpm` packages @@ -49,6 +50,20 @@ packages still publish. Once set up: brew install MicroClub-USTHB/tap/mctf ``` +## One-time setup for Scoop (Windows) + +1. Create the bucket repo **`MicroClub-USTHB/scoop-bucket`**. +2. Add a repo secret **`SCOOP_BUCKET_TOKEN`** (a PAT with `contents:write` on + the bucket) to `mctf-cli`. + +Until that secret exists the manifest push is skipped automatically — binaries and +packages still publish. Once set up: + +```powershell +scoop bucket add microclub https://github.com/MicroClub-USTHB/scoop-bucket +scoop install mctf +``` + ## Dry run ```bash diff --git a/docs/spec/CHANGELOG.md b/docs/spec/CHANGELOG.md index 28e88b5..97e9563 100644 --- a/docs/spec/CHANGELOG.md +++ b/docs/spec/CHANGELOG.md @@ -42,7 +42,7 @@ All features below are merged into `develop` and pass CI. Not yet released to `m - **`feat`: man pages** — a hidden `mctf gen-man ` (cobra `GenManTree`) generates one man page per command. `make man` writes them to `manpages/`; releases generate them at build time and bundle them in the archives (under `man/`) and install them to `/usr/share/man/man1` in the `.deb`/`.rpm` packages. Not committed (they carry a build date), so no drift. -- **`feat`: goreleaser-based releases** — tagging `vX.Y.Z` builds cross-platform binaries (linux/macOS/windows × amd64/arm64), archives + checksums, Linux packages (`.deb`/`.rpm`), a Homebrew cask pushed to `MicroClub-USTHB/homebrew-tap`, and a Docker image at `ghcr.io/microclub-usthb/mctf:` (and `:latest`) for CI pipelines. Version/commit/date are injected into `cmd.*` via ldflags. See `docs/RELEASING.md`. The cask push is skipped automatically until `HOMEBREW_TAP_TOKEN` is configured, so releases work before the tap exists. +- **`feat`: goreleaser-based releases** — tagging `vX.Y.Z` builds cross-platform binaries (linux/macOS/windows × amd64/arm64), archives + checksums, Linux packages (`.deb`/`.rpm`), a Homebrew cask pushed to `MicroClub-USTHB/homebrew-tap`, a Scoop manifest pushed to `MicroClub-USTHB/scoop-bucket`, and a Docker image at `ghcr.io/microclub-usthb/mctf:` (and `:latest`) for CI pipelines. Version/commit/date are injected into `cmd.*` via ldflags. See `docs/RELEASING.md`. The cask and Scoop manifest pushes are skipped automatically until `HOMEBREW_TAP_TOKEN` and `SCOOP_BUCKET_TOKEN` are configured, so releases work before the tap/bucket exist. ### Fixes & Refactors