Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
30 changes: 25 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<version>` for CI use.~~ **Shipped** (goreleaser `dockers` → GHCR; amd64, multi-arch to follow).

## CI / quality
Expand Down
15 changes: 15 additions & 0 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<version>` and `:latest`
- man pages (one per command), bundled in the archives (`man/`) and installed to `/usr/share/man/man1` by the `.deb`/`.rpm` packages

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dir>` (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:<version>` (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:<version>` (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

Expand Down
Loading