Switch from calver auto-release to cargo-release
cargo-release handles version bumps, commits, tags, and pushes locally.
The GitHub Actions workflow now triggers on v* tags and only publishes
to crates.io and creates a GitHub release.

Assisted-by: Claude Opus 4.6 via pi
change klytkwlukvosqspwmznppozkmskrrrov
commit adc7f4eb4252926cae442a9230917b3956802b18
author Alpha Chen <alpha@kejadlen.dev>
date
parent ykzrmyro
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ddd3676..40dfcac 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,45 +1,24 @@
 name: Release
 
 on:
-  workflow_dispatch:
-  workflow_run:
-    workflows: [CI]
-    types: [completed]
-    branches: [main]
+  push:
+    tags: ["v*"]
 
 permissions:
   contents: write
 
 jobs:
-  release:
-    if: >-
-      github.event_name == 'workflow_dispatch'
-      || github.event.workflow_run.conclusion == 'success'
+  publish:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
-        with:
-          fetch-depth: 0
 
-      - name: Calculate version
-        id: version
-        run: |
-          CALVER=$(date -u +"%Y-%m-%d")
-          SHORT_SHA=$(git rev-parse --short HEAD)
-          echo "version=${CALVER}+${SHORT_SHA}" >> $GITHUB_OUTPUT
-
-      # - name: Publish to crates.io
-      #   run: cargo publish
-      #   env:
-      #     CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+      - name: Publish to crates.io
+        run: cargo publish
+        env:
+          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
 
-      - name: Tag release
-        run: |
-          VERSION="${{ steps.version.outputs.version }}"
-          git tag "v${VERSION}"
-          git push origin "v${VERSION}"
-          gh release create "v${VERSION}" \
-            --title "v${VERSION}" \
-            --generate-notes
+      - name: Create GitHub release
+        run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --generate-notes
         env:
           GH_TOKEN: ${{ github.token }}
diff --git a/AGENTS.md b/AGENTS.md
index 784b895..070ac7a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -48,8 +48,8 @@ GitHub Actions runs on push to main and on PRs:
 2. `just clippy coverage`
 3. `just mutants`
 
-Release workflow tags calver versions on successful CI runs against main.
-Crates.io publishing is configured but currently commented out.
+Release uses `cargo release` (manual, semver). Pushing a `v*` tag triggers
+the release workflow, which publishes to crates.io and creates a GitHub release.
 
 ## Mapping Rules
 
diff --git a/Cargo.toml b/Cargo.toml
index 2d02624..7ccdd1c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2024"
 description = "Serde integration for KDL (KDL Document Language)"
 license = "MIT"
-repository = "https://github.com/kdl-org/kdl-rs"
+repository = "https://git.kejadlen.dev/alpha/serde-kdl2"
 keywords = ["kdl", "serde", "serialization", "config"]
 categories = ["config", "encoding"]
 
diff --git a/README.md b/README.md
index bf4b0f9..c851c8c 100644
--- a/README.md
+++ b/README.md
@@ -161,6 +161,20 @@ let s: String = serde_kdl2::to_string_pretty(&config)?;
 let doc: kdl::KdlDocument = serde_kdl2::to_doc(&config)?;
 ```
 
+## Releasing
+
+Releases use [cargo-release](https://github.com/crates-io/cargo-release).
+Run one of the following locally:
+
+```sh
+cargo release patch  # 0.1.0 → 0.1.1
+cargo release minor  # 0.1.0 → 0.2.0
+cargo release major  # 0.1.0 → 1.0.0
+```
+
+This bumps the version in `Cargo.toml`, commits, tags, and pushes. GitHub
+Actions then publishes the crate to crates.io and creates a GitHub release.
+
 ## AI Usage
 
 I built this crate with substantial help from Claude (Anthropic). The AI
diff --git a/release.toml b/release.toml
new file mode 100644
index 0000000..7f575eb
--- /dev/null
+++ b/release.toml
@@ -0,0 +1,4 @@
+allow-branch = ["main"]
+sign-commit = false
+sign-tag = false
+push-remote = "origin"