Merge pull request 'v0.2.0' (#2) from develop into main
Build / build (ccsm-darwin-amd64.tar.gz, ccsm, x86_64-apple-darwin) (release) Successful in 5m46s
Build / build (ccsm-linux-amd64.tar.gz, ccsm, x86_64-unknown-linux-gnu) (release) Successful in 2m25s
Build / build (ccsm-windows-amd64.zip, ccsm.exe, x86_64-pc-windows-gnu) (release) Successful in 6m47s

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-06-22 11:49:05 +08:00
3 changed files with 26 additions and 8 deletions
+7 -5
View File
@@ -61,8 +61,10 @@ jobs:
tar czf "${{ matrix.archive }}" "${{ matrix.binary }}"
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.archive }}
path: target/${{ matrix.target }}/release/${{ matrix.archive }}
- name: Upload to release
run: |
curl --fail -X POST \
-H "Authorization: Bearer ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"target/${{ matrix.target }}/release/${{ matrix.archive }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${{ matrix.archive }}"
+2
View File
@@ -19,6 +19,8 @@ pub struct SkillEntry {
pub repository: String,
#[serde(default)]
pub branch: Option<String>,
#[serde(default)]
pub path: Option<String>,
}
pub fn add(url: &str, name: Option<&str>) -> Result<MarketplaceEntry, String> {
+17 -3
View File
@@ -38,10 +38,20 @@ pub fn install(
let branch = entry.branch.as_deref().unwrap_or("main");
download::download_skill(&entry.repository, branch, &target)?;
// Deploy to Claude skills directory (copy or link)
let deploy_source = match &entry.path {
Some(subdir) => {
let p = target.join(subdir);
if !p.exists() {
return Err(format!("Path '{}' not found in skill repository", subdir));
}
p
}
None => target.clone(),
};
let config = Config::load().map_err(|e| format!("Cannot read config: {e}"))?;
let deploy_mode = mode.unwrap_or_else(|| config.default_mode.clone());
deploy_skill(name, &target, &deploy_mode)?;
deploy_skill(name, &deploy_source, &deploy_mode)?;
Ok(Skill {
name: name.to_string(),
@@ -233,12 +243,16 @@ pub fn update(name: Option<&str>) -> Result<Vec<(String, String)>, String> {
match download::download_skill(&skill_entry.repository, branch, &old_path) {
Ok(()) => {
let deploy_source = match &skill_entry.path {
Some(subdir) => old_path.join(subdir),
None => old_path.clone(),
};
// Redeploy if previously deployed
if deploy_mode.is_some() || config.default_mode != InstallMode::Copy {
let mode = deploy_mode
.clone()
.unwrap_or_else(|| config.default_mode.clone());
match deploy_skill(skill_name, &old_path, &mode) {
match deploy_skill(skill_name, &deploy_source, &mode) {
Ok(()) => results.push((skill_name.clone(), "Updated".to_string())),
Err(e) => results.push((skill_name.clone(), format!("Downloaded but deploy failed: {e}"))),
}