rust-node-ci

>

onsager-ai/dev-skills56 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: rust-node-ci
description: >
license: MIT
---

# Rust+Node.js CI/CD

GitHub Actions workflows and composite actions for Rust+Node.js hybrid projects.

## When to Use This Skill

Activate when any of the following are true:
- Working with `.github/workflows/` in a repo with both `Cargo.toml` and `package.json`
- Setting up, fixing, or extending CI/CD pipelines
- Installing composite actions into a project
- User mentions "CI", "workflow", "GitHub Actions", "cross-build", or "artifact"

## Decision Tree

```
What does the user need?

Set up CI from scratch?
  → Copy templates/workflows/ into .github/workflows/
  → Install composite actions from templates/actions/ into .github/actions/
  → Customize platform matrix for your targets

Fix a failing CI job?
  → Node job → CI Jobs section
  → Rust build/cross-compile → Composite Actions section + references/troubleshooting.md
  → Publish workflow → see rust-npm-publish skill

Add a new platform to the build matrix?
  → Publish Workflow Matrix section
  → Full platform reference → see rust-npm-publish skill

Understand dev vs release versioning in CI?
  → Dev Versioning section
```

## Workflow Architecture

```
┌─────────────┐     ┌──────────────────┐
│  Node Build  │     │   Rust Build     │
│  (test/lint) │     │  (per platform)  │
└──────┬──────┘     └────────┬─────────┘
       │                     │
       │   ┌─────────────┐   │
       └──►│  Artifacts   │◄──┘
           └──────┬──────┘
                  │
           ┌──────▼──────┐
           │   Publish    │
           └─────────────┘
```

## Workflows

| Workflow | Trigger | What It Does |
|----------|---------|-------------|
| `ci.yml` | PR, push to main | Node build+test+lint, Rust fmt+clippy+test |
| `publish.yml` | Release, dispatch | Cross-build → publish to npm |
| `copilot-setup-steps.yml` | repository_dispatch | Copilot agent onboarding |

Templates: [templates/workflows/](./templates/workflows/)

## CI Jobs

### Node Job

```yaml
steps:
  - uses: ./.github/actions/setup-workspace
  - run: pnpm build
  - run: pnpm test
  - run: pnpm typecheck
```

### Rust Job

```yaml
steps:
  - uses: actions/checkout@v4
  - uses: dtolnay/rust-toolchain@stable
    with:
      components: clippy, rustfmt
  - run: cargo fmt --all -- --check
  - run: cargo clippy --workspace -- -D warnings
  - run: cargo test --workspace
```

## Composite Actions

Install into `.github/actions/<name>/action.yml` in your project, then reference as `uses: ./.github/actions/<name>`.

Templates: [templates/actions/](./templates/actions/)

| Action | Install path | Purpose |
|--------|-------------|---------|
| `setup-workspace` | `.github/actions/setup-workspace/` | Checkout + pnpm + Node.js + cache + install |
| `rust-cross-build` | `.github/actions/rust-cross-build/` | Build Rust binaries for a target platform |
| `compute-version` | `.github/actions/compute-version/` | Compute dev/release version + npm tag |
| `wait-npm-propagation` | `.github/actions/wait-npm-propagation/` | Poll npm until platform packages are visible |

## Publish Workflow Matrix

```yaml
strategy:
  matrix:
    include:
      - { os: macos-latest,   target: x86_64-apple-darwin,      platform: darwin-x64 }
      - { os: macos-latest,   target: aarch64-apple-darwin,     platform: darwin-arm64 }
      - { os: ubuntu-22.04,   target: x86_64-unknown-linux-gnu, platform: linux-x64 }
      - { os: windows-latest, target: x86_64-pc-windows-msvc,   platform: windows-x64 }
```

Each matrix entry runs `rust-cross-build` and uploads the binary as an artifact.

## Artifact Flow

```yaml
# Upload from build job (one per platform)
- uses: actions/upload-artifact@v4
  with:
    name: binary-${{ matrix.platform }}
    path: target/${{ matrix.target }}/release/my-cli${{ matrix.platform == 'windows-x64' && '.exe' || '' }}
    retention-days: 1

# Download in publish job (all platforms)
- uses: actions/download-artifact@v4
  with:
    pattern: binary-*
    path: artifacts/
    merge-multiple: false
```

## Caching

| Tool | How |
|------|-----|
| pnpm | `actions/setup-node@v4` with `cache: 'pnpm'` |
| Rust | `Swatinem/rust-cache@v2` with `shared-key: ${{ matrix.platform }}` |
| Turbo | `actions/cache@v4` on `.turbo` path |

## Dev Versioning in CI

Non-release builds compute a unique pre-release version:

```
base version: 0.2.15
compute-version (is-release: false) → 0.2.16-dev.{github_run_id}
npm-tag: dev
```

Use the `compute-version` action:

```yaml
- uses: ./.github/actions/compute-version
  id: version
  with:
    base-version: ${{ steps.pkg.outputs.version }}
    is-release: ${{ github.event_name == 'release' }}
# outputs: version, npm-tag, is-dev
```

## Troubleshooting

| Problem | Fix |
|---------|-----|
| Rust build fails on macOS ARM | Use `macos-latest`; `rustup target add aarch64-apple-darwin` |
| pnpm lockfile mismatch | `--frozen-lockfile` in CI; regenerate locally |
| Cargo cache too large | Add `shared-key` to rust-cache; use `save-if` on main only |
| Artifact not found downstream | Check `needs:` chain; verify artifact name matches |

See [references/troubleshooting.md](./references/troubleshooting.md) for detailed diagnostics.

## Templates

| Directory | Contents |
|-----------|----------|
| [templates/workflows/](./templates/workflows/) | `ci.yml`, `publish.yml`, `copilot-setup-steps.yml` |
| [templates/actions/](./templates/actions/) | 4 composite actions with `action.yml` + README |

## Setup & Activation

```bash
npx skills add -g onsager-ai/dev-skills --skill rust-node-ci -a claude-code -y
```

Auto-activates when: `.github/workflows/` directory exists in a Rust+Node.js repo, or user mentions "CI", "workflow", "GitHub Actions", "cross-build".

More Deployment & CI/CD skills

azure-enterprise-infra-planner

microsoft/azure-skills

Architect and provision enterprise Azure infrastructure from workload descriptions. For cloud architects and platform engineers planning networking, identity, security, compliance, and multi-resource topologies with WAF alignment. Generates Bicep or Terraform directly (no azd). WHEN: 'plan Azure infrastructure', 'architect Azure landing zone', 'design hub-spoke network', 'plan multi-region DR topology', 'set up VNets firewalls and private endpoints', 'subscription-scope Bicep deployment', 'Azure Backup for VM workloads'. PREFER azure-prepare FOR app-centric workflows.

387.5k

azure-kubernetes-app-deploy

microsoft/azure-skills

Use when deploying an existing web application or API to an already-running Azure Kubernetes Service cluster. Detects the framework, generates a Dockerfile and Kubernetes manifests, validates against AKS Deployment Safeguards, and deploys with verification. WHEN: deploy app to AKS, deploy to existing AKS cluster, containerize app for Kubernetes, generate K8s manifests for Azure, set up CI/CD for AKS, my AKS deployment is failing safeguard checks, I have a Django/Express/Spring Boot app to run on AKS. DO NOT USE FOR: creating or provisioning an AKS cluster (use azure-kubernetes), assessing migration to AKS Automatic (use azure-kubernetes-automatic-readiness), or deploying to non-AKS targets like Web Apps, Container Apps, or Functions.

380.4k

finetuning

microsoft/azure-skills

Fine-tune models on Microsoft Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

323.2k

← All Deployment & CI/CD skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY