Skip to content
canonicalPublic

About

A tool to create SDKs for Workshop.

Resources

Stars

11 stars

Watchers

2 watching

Forks

Repository files navigation

SDKcraft

QA Status

Build and publish the SDKs that power Workshop's Ubuntu-native development environments.

SDKcraft is Canonical's tool for packaging languages, libraries, tools, and services as reusable SDKs for Workshop. Define what an SDK contains, how it is set up, and which interfaces it uses. Workshop then composes SDKs into development environments for individual projects.

Use SDKcraft to share a toolchain with your team or publish components that other Workshop users can add to their projects.

  • Declarative: describe an SDK's metadata, target platforms, parts, and interfaces in sdkcraft.yaml, with hooks for runtime setup and lifecycle operations.
  • Composable: package functionality that connects to other SDKs and host resources through Workshop interfaces.
  • Testable: try an SDK locally and run its tests before publishing.
  • Distributable: publish SDK revisions to the SDK Store and release them through channels.

Installation

SDKcraft is available on Ubuntu and other snap-enabled Linux distributions. For the build-and-try workflow with Workshop below, use LXD 6.8 or later, configured and running.

Install LXD if needed, then install SDKcraft:

sudo snap install --channel=6/stable lxd  # skip if LXD is already installed
sudo snap install --classic sdkcraft

To get new features as soon as they land, add --channel=latest/edge to the SDKcraft install command.

If an existing LXD installation needs updating:

sudo snap refresh --channel=6/stable lxd

Follow the Workshop setup guide to configure LXD and install Workshop for trying SDKs locally.

Quick start

Create a directory for your SDK and initialize the project:

mkdir my-sdk
cd my-sdk
sdkcraft init

This creates sdkcraft.yaml together with hooks and tests. Edit the definition to describe your SDK's software, platforms, and interfaces, and add the hooks needed to set it up inside a workshop.

Build and package the SDK:

sdkcraft pack

The output is a .sdk artifact for each platform built. For a complete worked example, follow the SDK crafting tutorial.

Try and test locally

Pack the SDK and copy it to Workshop's local try area:

sdkcraft try

The artifact is now available for local use with Workshop. Follow Build an SDK to launch a workshop with it and inspect how it behaves.

Run the SDK's Spread test suite, scaffolded by sdkcraft init:

sdkcraft test

This packs the SDK and exercises it in a separate test environment with Workshop installed. Extend the scaffolded tests to cover the tools and integrations your SDK provides.

To remove build artifacts before rebuilding:

sdkcraft clean

Publish and release

Publishing makes an SDK available from the SDK Store. With an Ubuntu One account, sign in and reserve your SDK's name:

sdkcraft login
sdkcraft register my-sdk

Upload a tested artifact and release it to an initial channel. Replace the example filename with the artifact produced by your build:

sdkcraft upload [email protected] --release latest/edge

List the uploaded revisions:

sdkcraft revisions my-sdk

When a revision is ready for stable use, release it to latest/stable. Replace <REVISION> with the revision number from the listing:

sdkcraft release my-sdk <REVISION> latest/stable

Workshop users can then select your SDK and its channel in their project definitions. See Publish an SDK for the full publishing workflow.

Documentation

Community and support

Contributions and license

To join the development effort, see How to contribute.

When working on SDKcraft itself, generate the project schema from the repository root:

uv run python sdkcraft/models/project.py

This uses the craft-application version locked in uv.lock to keep the generated schema aligned with the project's dependencies.

SDKcraft is released under the GPL-3.0 license.

About

A tool to create SDKs for Workshop.

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages