build(fix): update version numbers and fix release setup
2 files deleted
4 files modified
1 files renamed
| File was renamed from .release-it.prepare.ts |
| | |
| | | encoding: "utf8", |
| | | stdio: ["ignore", "pipe", "pipe"], |
| | | }).trim(); |
| | | } catch (error) { |
| | | } catch (error: unknown) { |
| | | console.error("Failed to determine the current Git branch."); |
| | | console.error(error); |
| | | process.exit(1); |
| | | } |
| | | } |
| | | |
| | | function hasPreReleaseFlag(argv: string[]): boolean { |
| | | function isPreReleaseRun(argv: string[]): boolean { |
| | | return argv.some((argument) => { |
| | | return ( |
| | | argument === "--preRelease" || |
| | |
| | | }); |
| | | } |
| | | |
| | | const branch = getCurrentBranch(); |
| | | const isPreRelease = hasPreReleaseFlag(process.argv); |
| | | const currentBranch = getCurrentBranch(); |
| | | const preReleaseRun = isPreReleaseRun(process.argv); |
| | | |
| | | if (isPreRelease && branch !== "staging") { |
| | | if (preReleaseRun && currentBranch !== "development") { |
| | | console.error( |
| | | `Pre-releases are only allowed from "staging". Current branch: "${branch}".`, |
| | | `Pre-releases are only allowed on "development". Current branch: "${currentBranch}".`, |
| | | ); |
| | | process.exit(1); |
| | | } |
| | | |
| | | if (!isPreRelease && branch !== "maintenance" && branch !== "staging") { |
| | | if (!preReleaseRun && currentBranch !== "main") { |
| | | console.error( |
| | | `Stable releases are only allowed from "maintenance" and "staging". Current branch: "${branch}".`, |
| | | `Stable releases are only allowed on "main". Current branch: "${currentBranch}".`, |
| | | ); |
| | | process.exit(1); |
| | | } |
| | | |
| | | const config: Config = { |
| | | const config = { |
| | | npm: { |
| | | publish: false, |
| | | }, |
| | | git: { |
| | | requireCleanWorkingDir: true, |
| | | requireUpstream: true, |
| | | requireCommits: true, |
| | | requireBranch: branch, |
| | | requireBranch: currentBranch, |
| | | commit: true, |
| | | commitMessage: "chore(release): v${version}", |
| | | commitArgs: ["--no-verify"], |
| | | tag: false, |
| | | tag: true, |
| | | tagName: "v${version}", |
| | | push: true, |
| | | pushArgs: ["--follow-tags"], |
| | | }, |
| | | github: { |
| | | release: false, |
| | | }, |
| | | npm: { |
| | | publish: false, |
| | | }, |
| | | plugins: { |
| | | "@release-it/conventional-changelog": { |
| | | infile: "CHANGELOG.md", |
| | |
| | | }, |
| | | } satisfies Config; |
| | | |
| | | export default config; |
| | | export default config; |
| | |
| | | }, |
| | | "explorer.fileNesting.enabled": true, |
| | | "explorer.fileNesting.patterns": { |
| | | "package.json": "package-lock.json, netlify.toml, .lintstagedrc.js, .release-it.*.ts, .markdownlint*, .nvmrc, lychee.toml, tsconfig.json, .coderabbit.yaml", |
| | | "package.json": "package-lock.json, netlify.toml, .lintstagedrc.js, .release-it.ts, .markdownlint*, .nvmrc, lychee.toml, tsconfig.json, .coderabbit.yaml", |
| | | "theme.toml": "go.mod, go.sum", |
| | | "README.md": "CHANGELOG.md, LICENSE.md, CONTRIBUTING.md, RELEASES.md, DESIGN.md", |
| | | "*.ts": "$(capture).md, $(capture).test.ts, $(capture).spec.ts, $(capture).d.ts, $(capture).map, $(capture).js, $(capture).jsx, $(capture).tsx" |
| | |
| | | |
| | | The project follows a structured release workflow based on conventional commits, staging branches, and automated versioning. |
| | | |
| | | For details, see [RELEASES.md](./RELEASES.md). |
| | | For details, see [Branch Strategy](#branch-strategy). |
| | | |
| | | ## Before You Start |
| | | |
| | |
| | | ```mermaid |
| | | flowchart LR |
| | | feature["feature/*, fix/*, docs/*, refactor/*"] --> development |
| | | development --> staging |
| | | maintenance --> staging |
| | | staging --> main |
| | | main --> staging |
| | | staging --> development |
| | | development --> main |
| | | maintenance --> main |
| | | main --> development |
| | | ``` |
| | | |
| | | This repository uses a linear, rebase-based branch model. Long-lived branches MUST stay connected to `main`, and merge commits MUST NOT be introduced. |
| | |
| | | | Branch | Purpose | Release role | Write policy | Merge | |
| | | | --- | --- | --- | --- | --- | |
| | | | `main` | Stable source of truth | releases | Protected. Only receives reviewed PRs from `staging` or `maintenance`. | Rebase | |
| | | | `staging` | Pre-release integration | pre-releases | Protected. Only receives reviewed PRs from `development`. | Rebase | |
| | | | `development` | Active development | none | Feature, fix, chore, and documentation PRs target this branch. | Squash | |
| | | | `development` | Active development | pre-releases | Feature, fix, chore, and documentation PRs target this branch. | Squash | |
| | | | `maintenance` | Dependency maintenance | none | Maintainer-only branch for dependency version updates. | Rebase | |
| | | |
| | | ### Branch naming |
| | |
| | | { |
| | | "name": "@gohugo-ananke/ananke", |
| | | "version": "2.14.0", |
| | | "version": "2.15.0", |
| | | "lockfileVersion": 3, |
| | | "requires": true, |
| | | "packages": { |
| | | "": { |
| | | "name": "@gohugo-ananke/ananke", |
| | | "version": "2.14.0", |
| | | "version": "2.15.0", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "cssnano": "8.0.1", |
| | |
| | | { |
| | | "name": "@gohugo-ananke/ananke", |
| | | "description": "Ananke: A theme for Hugo Sites", |
| | | "version": "2.14.0", |
| | | "version": "2.15.0", |
| | | "license": "MIT", |
| | | "repository": "gohugo-ananke/ananke", |
| | | "author": "Bud Parr (https://github.com/budparr)", |
| | |
| | | "lint:markdown": "markdownlint-cli2", |
| | | "lint:markdown:fix": "markdownlint-cli2 --fix", |
| | | "prepare": "simple-git-hooks install", |
| | | "release": "release-it --config .release-it.publish.ts --ci", |
| | | "release:pre": "release-it --preRelease=prerelease --config .release-it.prepare.ts", |
| | | "release:prepare": "release-it --config .release-it.prepare.ts", |
| | | "release": "release-it --config .release-it.ts", |
| | | "release:pre": "release-it --preRelease=prerelease --config .release-it.ts", |
| | | "server": "hugo server --environment documentation", |
| | | "test": "node scripts/test-hugo-quickstart.ts", |
| | | "test:quickstart": "node scripts/test-hugo-quickstart.ts", |
| | |
| | | "pre-push": "npm run hook:push" |
| | | }, |
| | | "type": "module" |
| | | } |
| | | } |