Skip to content

Commit 1891298

Browse files
authored
Add: Choco Config. Add: Publish Action (#23)
1 parent a4a766e commit 1891298

12 files changed

Lines changed: 153 additions & 4 deletions

.github/workflows/publish.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Publish
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: "Release version tag (e.g., v0.1.2)"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
publish-crate:
13+
runs-on: ubuntu-latest
14+
environment: release
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: dtolnay/rust-toolchain@stable
19+
20+
- name: Publish to crates.io
21+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
22+
23+
publish-choco:
24+
runs-on: windows-latest
25+
environment: release
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Set version variables
30+
shell: pwsh
31+
run: |
32+
$tag = "${{ inputs.version }}"
33+
$semver = $tag -replace '^v', ''
34+
$artifact = "rustifymyclaw-${tag}+x86_64-windows.zip"
35+
$url = "https://github.com/${{ github.repository }}/releases/download/${tag}/${artifact}"
36+
echo "CHOCO_VERSION=$semver" >> $env:GITHUB_ENV
37+
echo "ARTIFACT_NAME=$artifact" >> $env:GITHUB_ENV
38+
echo "DOWNLOAD_URL=$url" >> $env:GITHUB_ENV
39+
40+
- name: Download release artifact
41+
shell: pwsh
42+
run: |
43+
Invoke-WebRequest -Uri $env:DOWNLOAD_URL -OutFile $env:ARTIFACT_NAME -UseBasicParsing
44+
45+
- name: Compute SHA256 checksum
46+
shell: pwsh
47+
run: |
48+
$hash = (Get-FileHash -Path $env:ARTIFACT_NAME -Algorithm SHA256).Hash.ToLower()
49+
echo "CHECKSUM=$hash" >> $env:GITHUB_ENV
50+
51+
- name: Inject version and checksum into install script
52+
shell: pwsh
53+
run: |
54+
$script = 'choco/tools/chocolateyInstall.ps1'
55+
$content = Get-Content $script -Raw
56+
$content = $content -replace '\{\{VERSION\}\}', "${{ inputs.version }}"
57+
$content = $content -replace '\{\{CHECKSUM\}\}', $env:CHECKSUM
58+
Set-Content $script $content
59+
60+
- name: Pack Chocolatey package
61+
run: choco pack choco/rustifymyclaw.nuspec --version ${{ env.CHOCO_VERSION }}
62+
working-directory: .
63+
64+
- name: Push to Chocolatey
65+
run: choco push rustifymyclaw.${{ env.CHOCO_VERSION }}.nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.CHOCO_API_KEY }}

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,11 @@ jobs:
169169
generate_release_notes: true
170170
draft: false
171171
files: artifacts/*
172+
173+
publish:
174+
needs: [determine_version, release]
175+
if: ${{ !inputs.dry_run }}
176+
uses: ./.github/workflows/publish.yml
177+
with:
178+
version: ${{ needs.determine_version.outputs.new_version }}
179+
secrets: inherit

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ target
1616
*.local.json
1717
.env
1818
.obsidian
19-
_*.md
19+
_*.md
20+
*.nupkg

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ All four must pass before any commit.
4444
| `src/channel/whatsapp.rs` | `WhatsAppProvider` — axum webhook + reqwest Graph API. |
4545
| `src/channel/slack.rs` | `SlackProvider` — Socket Mode WebSocket via tokio-tungstenite. |
4646
| `src/tests/` | All test files, referenced from source via `#[path = "tests/..."]`. |
47+
| `choco/` | Chocolatey package: `rustifymyclaw.nuspec`, `tools/chocolateyInstall.ps1`, `tools/chocolateyUninstall.ps1`. |
48+
| `.github/workflows/ci.yml` | CI: fmt, clippy, test on push/PR. |
49+
| `.github/workflows/release.yml` | Release: version bump, cross-platform build, GH Release, then calls `publish.yml`. |
50+
| `.github/workflows/publish.yml` | Reusable workflow (`workflow_call`): parallel crates.io + Chocolatey publish. |
4751

4852
## Key patterns
4953

@@ -87,3 +91,5 @@ All four must pass before any commit.
8791
| `examples/config.yaml` | Minimal working config for quickstart. |
8892
| `desired_architecture.md` | Internal planning history. Do not reference in public docs or PRs. |
8993
| `CONTRIBUTING.md` | How to contribute — branch conventions, PR process, testing expectations. |
94+
| `.github/workflows/` | CI, release, and publish pipelines. |
95+
| `choco/` | Chocolatey packaging (nuspec + install/uninstall scripts). |

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ Changes that affect module boundaries, add a new backend or channel, or touch th
9898

9999
See `docs/architecture.md` for the system design and extension points.
100100

101+
## Release process
102+
103+
Releases are maintainer-only via `workflow_dispatch` on `main`:
104+
105+
1. Update `Cargo.toml` version to match the intended release.
106+
2. Trigger the **Release** workflow from GitHub Actions, selecting the bump type (patch/minor/major).
107+
3. The workflow validates the version, builds cross-platform artifacts, creates a GitHub Release with checksums, then automatically publishes to **crates.io** and **Chocolatey** in parallel.
108+
109+
Secrets (`CARGO_REGISTRY_TOKEN`, `CHOCO_API_KEY`) are scoped to the `release` environment. Contributors don't need access to these — the pipeline handles everything after merge.
110+
101111
## Code of Conduct
102112

103113
This project follows the [Contributor Covenant v2.1](CODE_OF_CONDUCT.md).

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustifymyclaw"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "Run Coding CLI Agents from Messaging Apps - single Rust binary, no server required."
66
license = "Apache-2.0"

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![CI](https://github.com/Escoto/RustifyMyClaw/actions/workflows/ci.yml/badge.svg)](https://github.com/Escoto/RustifyMyClaw/actions/workflows/ci.yml)
44
[![GitHub release](https://img.shields.io/github/v/release/Escoto/RustifyMyClaw)](https://github.com/Escoto/RustifyMyClaw/releases/latest)
55
[![Downloads](https://img.shields.io/github/downloads/Escoto/RustifyMyClaw/total)](https://github.com/Escoto/RustifyMyClaw/releases)
6+
[![Chocolatey](https://img.shields.io/chocolatey/v/rustifymyclaw)](https://community.chocolatey.org/packages/rustifymyclaw)
67
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
78
[![Made with Rust](https://img.shields.io/badge/Made%20with-Rust-orange?logo=rust)](https://www.rust-lang.org)
89

@@ -83,7 +84,13 @@ The daemon never modifies your prompt, never overrides your model, and never per
8384
curl -fsSL https://raw.githubusercontent.com/Escoto/RustifyMyClaw/main/scripts/install.sh | bash
8485
```
8586

86-
**Windows (PowerShell):**
87+
**Windows (Chocolatey):**
88+
89+
```powershell
90+
choco install rustifymyclaw
91+
```
92+
93+
**Windows (PowerShell script):**
8794

8895
```powershell
8996
irm https://raw.githubusercontent.com/Escoto/RustifyMyClaw/main/scripts/install.ps1 | iex

choco/rustifymyclaw.nuspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
3+
<metadata>
4+
<id>rustifymyclaw</id>
5+
<version>$version$</version>
6+
<title>RustifyMyClaw</title>
7+
<authors>Escoto</authors>
8+
<owners>Escoto</owners>
9+
<licenseUrl>https://github.com/Escoto/RustifyMyClaw/blob/main/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/Escoto/RustifyMyClaw</projectUrl>
11+
<projectSourceUrl>https://github.com/Escoto/RustifyMyClaw</projectSourceUrl>
12+
<bugTrackerUrl>https://github.com/Escoto/RustifyMyClaw/issues</bugTrackerUrl>
13+
<tags>rust cli-agent ai-tool claw claude-code codex</tags>
14+
<summary>Run Coding CLI Agents from Messaging Apps</summary>
15+
<description>Run Coding CLI Agents from Messaging Apps - single Rust binary, no server required.</description>
16+
<releaseNotes>https://github.com/Escoto/RustifyMyClaw/releases</releaseNotes>
17+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
18+
</metadata>
19+
<files>
20+
<file src="tools\**" target="tools" />
21+
</files>
22+
</package>

choco/tools/chocolateyInstall.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
$packageName = 'rustifymyclaw'
4+
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
5+
$version = '{{VERSION}}'
6+
$url64 = "https://github.com/Escoto/RustifyMyClaw/releases/download/${version}/rustifymyclaw-${version}+x86_64-windows.zip"
7+
$checksum64 = '{{CHECKSUM}}'
8+
9+
$packageArgs = @{
10+
PackageName = $packageName
11+
Url64bit = $url64
12+
UnzipLocation = $toolsDir
13+
Checksum64 = $checksum64
14+
ChecksumType64 = 'sha256'
15+
}
16+
17+
Install-ChocolateyZipPackage @packageArgs

0 commit comments

Comments
 (0)