diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..042b309 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +# Test gate for a repository that currently ships documentation only. +# +# Tests live in their own workflow: they run on pull requests, while the release +# workflow runs on pushes to the default branch. Mixing the two means a broken +# release blocks a pull request, or the reverse. +# +# Replace the test step with the project's real toolchain and test command as soon +# as source code lands; see the repository standards in AGENTS.md. +# +# AGENTS.md is deliberately not linted: it is canonical content synced from +# repo-template and must not be edited here. +name: CI + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true # a superseded pull request run is pointless + +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Lint Markdown + run: npx --yes markdownlint-cli2@0.23.3 "README.md" + + - name: Validate repository standards + run: | + set -euo pipefail + test -s README.md + test -s AGENTS.md + test -s LICENSE + python3 -c "import json; json.load(open('.releaserc.json'))" + python3 -c "import json; json.load(open('.markdownlint.json'))" + echo "repository standards OK" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4264251 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +# Copy this file into a downstream repository as `.github/workflows/release.yml`. +# `scripts/sync.sh` does that automatically when the file does not exist yet. +# +# This is the source-only shape: compute the version, create the tag, create the +# GitHub release. GitHub attaches the source tarball and zip to every release by +# itself, so nothing else is required. +# +# Add the `publish` job from examples/publish.yml when the repository publishes to +# a registry, and the `package` job from examples/package.yml when it ships build +# artifacts. Both are independent siblings of `release`: add or delete them freely. +name: Release + +on: + push: + branches: + - main + - master + +permissions: + contents: write # create the tag and the GitHub release + issues: write # comment on released issues + pull-requests: write # comment on released pull requests + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false # never cancel a release mid-flight + +jobs: + # Versioning only: commit prefixes -> tag -> GitHub release. Language-agnostic. + release: + # Pin to a moving major tag (`@v1`), or to a commit SHA for maximum safety. + uses: nexform-tech/repo-template/.github/workflows/release.yml@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..babae95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,70 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ + +# CMake generated files +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +Makefile +install_manifest.txt +compile_commands.json + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/ + diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..9b14487 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": { "line_length": 130, "tables": false, "code_blocks": false }, + "MD060": { "style": "padded" } +} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..a754d87 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,8 @@ +{ + "branches": ["main", "master"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github" + ] +} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..81db696 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,103 @@ +# AGENTS.md + +Operating rules for agents working in this repository. They are mandatory, not advisory. + +## 1. Git Workflow + +These rules assume the repository is hosted on GitHub. Where it has no GitHub remote, the GitHub-specific steps (PRs, issues, releases) do not apply; branching, commit, and testing rules apply to every Git repository. + +**Never modify code directly on the default branch.** Always create a new branch first. + +- The default branch may be `main` or `master`; `` below means whichever it is. +- Sync before branching: `git switch && git pull --ff-only`. +- Create a branch: `git switch -c /`. + - Examples: `feat/oauth-login`, `fix/null-pointer-on-logout`, `chore/bump-deps`. + - `` is one of the commit types listed below. +- Keep branches small and single-purpose. One branch solves one problem. +- Keep the branch current by rebasing on ``; do not merge `` into it. +- Never rewrite history that has already been pushed to a shared branch. + +### Commits + +Every commit message follows Conventional Commits: + +``` +: + + + +