TsukiNi22/ai-utils / skills/git/ci-cd
ci-cd
UnverifiedCI and CD of a GitHub repository in Tsukini's way - the CI (build check, unit tests, style check with xstyle, coverage) and the CD (GitHub releases from the CHANGELOG, RPM/DEB packages and their gh-pages repository, container images on ghcr.io, PyPI, docs on gh-pages, dispatch to other repositories), always asking first what to run, runs the jobs in the user's Docker images (ghcr.io/tsukini22 ci / unit-tests / package / git from the docker-image repository) or else the smallest official image that has what is needed, follows his conventions (names, vars.RUNNER, ccache, set -euo pipefail, annotations, dispatch keywords), and when one of his images misses a tool, adds it to the docker-image repository (Dockerfile, version, CHANGELOG, README) with a local commit only. Used by the project setup skills (cpp-project, python-project) when the project is a GitHub repository. Use whenever the user wants a CI, a CD, a release / deployment / publication pipeline, a GitHub workflow / action, or to change one.
CI / CD
SKILL_DIR = the directory of this file. Templates: CI templates/style.yml (xstyle), templates/python.yml (pytest);
CD templates/release.yml (GitHub release from the CHANGELOG section of the tag), templates/pypi.yml (trusted
publishing), templates/container.yml (image on ghcr.io, docker-image way), templates/dispatch-repository.yml
(repository_dispatch to another repository); the C/C++ build / tests / packages / dispatch / release / docs workflows are
those of cpp_project_template (.github/workflows/ of a project made by cpp-project, already there; for another
C++ project: copied from the local clone ~/personal_delivery/cpp/cpp_project_template or its GitHub repository, then
template / TEMPLATE_ / Core renamed and the # Don't run on template repository condition removed, like its
setup.sh; section 5 of cpp-project says what each one does).
Called by the project setup skills (cpp-project, python-project) when the project is a GitHub repository
(git remote -v shows github.com, or the user creates it with gh repo create): they hand over the CI/CD step here.
Check: python3 SKILL_DIR/scripts/check_workflows.py [files] (YAML, actionlint when installed, the conventions below).
1. Ask first, always (AskUserQuestion, French)
Even when the request looks clear, confirm what the CI/CD must do (multiSelect), with the project's obvious choices
pre-selected in the description. The popup takes 4 options per question and 4 questions per call (interactive-questions):
the CI is one question, the CD two (publication: Release · Packages · Image · PyPI; then Docs · Dispatch · none):
- CI: Build (compile check, executables present) · Tests unitaires · Style (xstyle) · Coverage
- CD: Release GitHub sur tag (notes = section du CHANGELOG) · Packages RPM/DEB (+ gh-pages repository) ·
Image de conteneur (ghcr.io) · PyPI (Python) · Docs (html-doc on gh-pages) · Dispatch vers d'autres
repos (which repository, which event:
repository_dispatchtype) Then, in the fourth question (or a second call) when not obvious: déclencheurs (push main, pull requests, tagsv*, manualworkflow_dispatch, commit keywords[build]/[release]/[ignore]ofgit-conventions) and runner (${{ vars.RUNNER }}, the self-hosted runner of the user: default;ubuntu-latestonly if asked).
2. Images: the user's first, else the smallest that fits
Read the current list and versions in the docker-image repository (~/personal_delivery/other/docker-image, else
gh repo clone TsukiNi22/docker-image): README.md (tools table), *.Dockerfile, CHANGELOG.md.
| Need | Image |
|---|---|
| C / C++ build (clang, cmake, ccache, libutils + debug/asan, openssl, python3, xstyle) | ghcr.io/tsukini22/ci:latest |
| C / C++ unit tests (ci + GTest / GMock) | ghcr.io/tsukini22/unit-tests:latest |
| RPM / DEB packages, signatures, repositories | ghcr.io/tsukini22/package:latest |
| git / curl only (dispatch, tags, API calls) | ghcr.io/tsukini22/git:latest |
| style check (xstyle) | ghcr.io/tsukini22/ci:latest (xstyle from ci v2.1.0) |
| Python | python:<version>-slim (pip included); -alpine only without compiled wheels |
| Rust | rust:<version>-slim |
| Node / web | node:lts-alpine |
| anything else | the official -slim / -alpine image of the tool, or no container at all for pure gh / curl steps |
Pinned version (ci:v2.1.0) instead of latest only if the user asks for reproducible builds. |
A tool is missing in one of the user's images
Propose (AskUserQuestion) to add it to the image instead of installing it in every run. If yes, in the docker-image repository:
- the
*.Dockerfile: the package in the matching commented group ofdnf install(or a build block like xstyle's inci.Dockerfile),dnf clean allkept last; - the version:
VERSIONof.github/workflows/build-image-<image>.yml(minor for an added tool, patch for a fix, major for a base change); CHANGELOG.md:## [<image>:vX.Y.Z] - <date>with### Added/### Fixed/### Changedunder[<image>:Unreleased], and the link line[<image>:vX.Y.Z]: .../commits/<image>/vX.Y.Z/<image>.Dockerfile;README.md: the tools table;- a local commit only, like the other commits of that repository (
feat(ci-image): add <tool> ...,fix(package): ...), without co-author / AI attribution and never pushed: tell the user to push (the push builds and publishes the image). Optionally build it locally first:podman build -f <image>.Dockerfile -t test ..
3. Conventions (from the user's workflows)
name:<Name> - <Kind>/<Name> (CI)/(CD)/(CI/CD)(CI - Executables,Unit Tests - Libraries (CI),Dispatch (CI/CD),Build Image - CI); file nameskebab-case.yml.- Every job:
runs-on: ${{ vars.RUNNER }},defaults: run: shell: bash,container: image: .... actions/checkout@v5withfetch-depth: 1(0 when the history / a base branch is needed),actions/cache@v5for ccache (/github/home/.cache/ccache, key on the hashes of the sources +CMakeLists.txt) thenccache -s.- Every multi-line
run:starts withset -euo pipefail(set -eat least), named steps,timeout-minuteson builds and tests, errors as annotationsecho "::error title=<Title>,file=<file>::<message>",✓ <thing> okon success. - Dispatch chain:
dispatch.ymldecides ([build]-> pre-release packages, tagvX.Y.Z-> stable,[ignore]-> nothing) and triggers the other workflows withworkflow_dispatchthrough the API (curl+secrets.GITHUB_TOKEN); another repository:repository_dispatchwithsecrets.GIT_TOKEN(templates/dispatch-repository.yml, the receiving workflow listens withon: repository_dispatch: types: [<event>], likebuild-image-ci.ymlwithlibutils-released). - Secrets / variables are never created by the skill: list them for the user (
gh variable set RUNNER --body ...,gh secret set GIT_TOKEN, GPG secrets of the packages: seecpp-project).
4. Style check (xstyle)
templates/style.yml: on a pull request only the lines it changes (--diff-ref origin/<base>), on a push the whole
project; --fail-on {{FAIL_ON}} (major by default: ask), the Markdown report appended to the job summary. A project
that is not clean yet: start with --fail-on unforgivable or the PR-only trigger, and say so.
5. CD (deployment)
- Versions: one tag per release (
vX.Y.Z,vX.Y.Z-prefor a pre-release;<image>/vX.Y.Zfor an image of a multi-image repository), the version in the sources bumped with the CHANGELOG in the same commit (git-conventions). - GitHub release (
release.yml): on av*tag, the notes are the section of the tag inCHANGELOG.md(thegit-conventionsformat:## vX.Y.Z - date,## [vX.Y.Z-pre] - date; the job fails without it), a tag with a suffix (vX.Y.Z-pre,-rc1...) is a pre-release,{{ASSETS}}= files to attach (binaries,dist/*, packages) or empty. A C++ project of the template already has its ownrelease.yml(run bydispatch.ymlafter the packages). - Packages RPM/DEB (C/C++): the
dispatch/build-packagesworkflows of cpp_project_template (Linux and Windowsmingw64-*, stable on avX.Y.Ztag, pre-release on[build]or avX.Y.Z-<suffix>tag), signed and published in the gh-pages repository when the project has one (GPG secrets, Pages: seecpp-project), else artifacts of the run. - Container image (
container.yml): the docker-image pattern (version in the workflow,<image>/vX.Y.Ztag pushed by the job,latest+ version tags, GHA cache). - PyPI (
pypi.yml): trusted publishing (the project configured on pypi.org with this repository / workflow / environmentpypi, no token), the version ofdist/checked against the tag. - Docs:
html-docpages on thegh-pagesbranch (anactions/deploy-pagesjob, or the existing gh-pages workflow). - Never publish from a pull request; secrets / environments / pypi.org settings are listed for the user, never created.
6. Check and hand over
python3 SKILL_DIR/scripts/check_workflows.py .github/workflows/*.yml (+ xstyle --rtk .github for the generic rules), then
list for the user: the workflows written, the images used, the secrets / variables to create, what triggers what.
Commits follow git-conventions (feat(ci): ...); nothing is pushed without a request.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |