Skip to content

Commit aa4a1a1

Browse files
authored
feat: auto-deploy a static index browser + simplify README (#5)
Adds a `deploy-site` workflow that runs the upstream `xpkgindex` tool (same as d2learn/xim-pkgindex) on every push to main and publishes the rendered HTML to GitHub Pages. `.xpkgindex.json` carries the mcpp-specific branding (title, links, install command template `mcpp add {name}@{version}`, install snippet pointing at the mcpp release-asset install.sh). The README is trimmed to the parts a contributor actually needs: - One-line description + browse link. - One-line quickstart (`mcpp add ...` + `mcpp build`). - Three-line "adding a package" pointer to existing files as templates and the mcpp ext doc. - License footer. The comparison table with xim-pkgindex / mcpplibs-index moved out; that's a meta-question that belongs in mcpp's docs, not in the index repo's front door. Once GitHub Pages is enabled in the repo settings, the workflow will keep https://mcpp-community.github.io/mcpp-index/ in sync with main automatically.
1 parent 25f1425 commit aa4a1a1

3 files changed

Lines changed: 109 additions & 33 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: deploy-site
2+
3+
# Render `pkgs/**/*.lua` into a static HTML browser via xpkgindex and
4+
# publish to GitHub Pages. Re-runs on any pkgs/ change merged into main,
5+
# and can be kicked off manually for theme/config tweaks.
6+
7+
on:
8+
push:
9+
branches: [main]
10+
paths:
11+
- 'pkgs/**'
12+
- '.xpkgindex.json'
13+
- '.github/workflows/deploy-site.yml'
14+
workflow_dispatch:
15+
16+
# GITHUB_TOKEN scopes for the deploy step.
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
# One concurrent run per ref; in-flight runs get cancelled when a new
23+
# push arrives (the latest deploy is always the one we want live).
24+
concurrency:
25+
group: pages
26+
cancel-in-progress: true
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.12'
36+
- name: Install xpkgindex
37+
run: pip install git+https://github.com/openxlings/xpkgindex.git
38+
- name: Generate static site
39+
env:
40+
# xpkgindex >= Apr 2026 surfaces these on the About page.
41+
XPKGINDEX_BUILD_TIME: ${{ github.event.head_commit.timestamp }}
42+
XPKGINDEX_BUILD_COMMIT: ${{ github.sha }}
43+
XPKGINDEX_BUILD_COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
44+
run: |
45+
# workflow_dispatch leaves head_commit.timestamp empty.
46+
if [ -z "$XPKGINDEX_BUILD_TIME" ]; then
47+
XPKGINDEX_BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
48+
export XPKGINDEX_BUILD_TIME
49+
fi
50+
xpkgindex generate . --output site
51+
- uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./site
54+
55+
deploy:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
steps:
62+
- id: deployment
63+
uses: actions/deploy-pages@v4

.xpkgindex.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"site": {
3+
"title": "mcpp Package Index",
4+
"description": "Modular C++23 packages for the mcpp build tool",
5+
"logo": "mcpp Package Index"
6+
},
7+
"links": {
8+
"github": "https://github.com/mcpp-community/mcpp-index",
9+
"custom": [
10+
{"label": "mcpp", "url": "https://github.com/mcpp-community/mcpp"},
11+
{"label": "xpkg V1 spec", "url": "https://github.com/d2learn/xim-pkgindex/blob/main/docs/V1/xpackage-spec.md"},
12+
{"label": "mcpp ext", "url": "https://github.com/mcpp-community/mcpp/blob/main/docs/04-schema-xpkg-extension.md"}
13+
]
14+
},
15+
"about": {
16+
"project_name": "mcpp",
17+
"project_url": "https://github.com/mcpp-community/mcpp",
18+
"description": "Modern C++23 build & package management tool — modules-first, xlings-driven, single-binary install",
19+
"maintainers": ["mcpp-community"],
20+
"license": "Apache-2.0"
21+
},
22+
"theme": {
23+
"primary_color": "#00d4ff",
24+
"style": "dark"
25+
},
26+
"install_command_template": "mcpp add {name}@{version}",
27+
"pkgs_dir": "pkgs",
28+
"install_commands": {
29+
"unix": "curl -fsSL https://github.com/mcpp-community/mcpp/releases/latest/download/install.sh | bash",
30+
"windows": "iwr https://github.com/mcpp-community/mcpp/releases/latest/download/install.sh -useb | bash"
31+
}
32+
}

README.md

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,25 @@
11
# mcpp-index
22

3-
> Package index registry for the [`mcpp`](https://github.com/mcpp-community/mcpp) build tool.
4-
5-
This repository indexes modular C++23 packages that follow the
6-
[xpkg v1 spec](https://github.com/d2learn/xim-pkgindex/blob/main/docs/V1/xpackage-spec.md)
7-
plus the [mcpp extension segment](https://github.com/mcpp-community/mcpp/blob/dev/docs/04-schema-xpkg-extension.md).
8-
9-
## How is this different from xim-pkgindex / mcpplibs-index?
10-
11-
| Repo | Format | Build tool | Status |
12-
|------|--------|------------|--------|
13-
| [`d2learn/xim-pkgindex`](https://github.com/d2learn/xim-pkgindex) | xpkg v1 (Lua) | xlings + various | Official xlings index |
14-
| [`mcpplibs/mcpplibs-index`](https://github.com/mcpplibs/mcpplibs-index) | xmake `package(...)` | xmake | mcpplibs xmake-style index |
15-
| **`mcpp-community/mcpp-index`** (this) | xpkg v1 + mcpp ext | mcpp | Modular-only, mcpp-driven |
16-
17-
## Layout
18-
19-
```
20-
pkgs/<letter>/<package>.lua Each indexed package
21-
docs/ Contributor docs
22-
.github/workflows/ CI: lint, validate, deploy
23-
```
24-
25-
## Using this index
26-
27-
mcpp registers `mcpp-index` automatically as the default registry. With a
28-
fresh `mcpp` install:
3+
> Default package registry for [`mcpp`](https://github.com/mcpp-community/mcpp).
4+
> Browse: **https://mcpp-community.github.io/mcpp-index/**
295
306
```bash
31-
mcpp env # initializes ~/.mcpp/registry/
32-
mcpp search hello # searches mcpp-index
33-
mcpp add mcpplibs.templates@0.0.1 # adds to your project's mcpp.toml
34-
mcpp build # mcpp pulls source via xlings, builds
7+
mcpp add mcpplibs.cmdline@0.0.2 # → updates mcpp.toml
8+
mcpp build # → fetches sources, builds
359
```
3610

3711
## Adding a package
3812

39-
See [docs/19-creating-mcpp-index.md](https://github.com/mcpp-community/mcpp/blob/dev/docs/19-creating-mcpp-index.md) in the mcpp repo.
13+
Drop one [xpkg V1](https://github.com/d2learn/xim-pkgindex/blob/main/docs/V1/xpackage-spec.md)
14+
descriptor at `pkgs/<first-letter>/<name>.lua`. Existing files (e.g.
15+
[`pkgs/m/mbedtls.lua`](pkgs/m/mbedtls.lua),
16+
[`pkgs/l/lua.lua`](pkgs/l/lua.lua)) are the canonical templates;
17+
the [mcpp extension](https://github.com/mcpp-community/mcpp/blob/main/docs/04-schema-xpkg-extension.md)
18+
covers the optional `mcpp = { ... }` segment for upstreams that
19+
don't ship their own `mcpp.toml`. Open a PR — the `validate`
20+
workflow lint-checks descriptors, the `deploy-site` workflow
21+
republishes the browse site after merge.
4022

4123
## License
4224

43-
Package descriptions: CC0 (metadata is uncopyrightable). Each indexed package
44-
has its own license.
25+
Descriptors: CC0. Each indexed upstream keeps its own license.

0 commit comments

Comments
 (0)