Skip to content

Commit 5aa4081

Browse files
committed
Add publishing steps.
1 parent f2e0e2d commit 5aa4081

4 files changed

Lines changed: 72 additions & 27 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114

115115
build_wasm:
116116
needs: test
117-
name: Build and Publish WASM
117+
name: Build WASM
118118
runs-on: ubuntu-latest
119119
if: github.ref == 'refs/heads/main'
120120
steps:
@@ -128,10 +128,7 @@ jobs:
128128
cache-all-crates: "true"
129129
- run: cargo install cargo-make
130130
- run: cargo make build-oci
131-
- name: Login to GitHub Container Registry
132-
uses: docker/login-action@v3
131+
- uses: actions/upload-artifact@v4
133132
with:
134-
registry: ghcr.io
135-
username: ${{ github.actor }}
136-
password: ${{ secrets.GITHUB_TOKEN }}
137-
- run: cargo make publish-oci
133+
name: kord_wasm32-wasip2
134+
path: target/wasm32-wasip2/release/kord.wasm

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ cargo install cargo-leptos
177177
```
178178
- WASM/WASI tooling often needed for advanced flows:
179179
```bash
180-
cargo install wasm-pkg-tools # for wkg (OCI publishing)
181-
cargo install wasm-pack # for npm/wasm builds
180+
cargo install wkg # for OCI publishing
181+
cargo install wasm-pack # for npm/wasm builds
182182
brew install wasmtime || sudo apt-get install wasmtime
183183
```
184184

DEVELOPMENT.md

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,74 @@ cargo check --no-default-features \
108108

109109
## Release and Publishing
110110

111-
### Full Release with Version Bump
111+
### Prerequisites for Publishing
112+
113+
Before running the release process, ensure you have:
114+
115+
-**crates.io authentication**: `cargo login` with your API token
116+
-**npm authentication**: `npm login` or `npm adduser`
117+
-**GitHub Container Registry authentication**: `docker login ghcr.io -u USERNAME`
118+
-**wasm32-wasip2 target**: `rustup target add wasm32-wasip2`
119+
-**Required tools**:
120+
```bash
121+
cargo install cargo-release # For version bumping
122+
cargo install cargo-make # For task orchestration
123+
cargo install wkg # For OCI publishing
124+
cargo install wasm-pack # For npm WASM builds
125+
```
126+
127+
### Complete Release Process
128+
129+
Follow these steps to cut a new release:
130+
131+
#### 1. Prepare and Tag the Release
112132

113133
```bash
114-
# Step 1: Bump versions and create git tags (does not publish)
134+
# Bump versions and create git tags using cargo-release
115135
cargo make release
136+
```
137+
138+
This will:
139+
- Update version numbers in all `Cargo.toml` files
140+
- Create git commits for version bumps
141+
- Create git tags (e.g., `v0.8.0`)
142+
- **Does NOT publish** (controlled by `--no-publish` flag)
116143

117-
# Step 2: Build and publish to crates.io and npm
144+
#### 2. Build and Publish to All Registries
145+
146+
```bash
147+
# Publish to crates.io, npm, and GitHub Container Registry
118148
cargo make publish-all
119149
```
120150

151+
This orchestrates:
152+
1. ✅ Format check and tests (`check-all`)
153+
2. ✅ Build CLI binary (`build-cli`)
154+
3. ✅ Build WASM package for npm (`build-npm`)
155+
4. ✅ Build Leptos web app (`build-web`)
156+
5. ✅ Build WASM binary for OCI (`build-oci`)
157+
6. ✅ Publish `kord` crate to **crates.io** (`publish-crates`)
158+
7. ✅ Rename and publish to **npm** as `kordweb` (`publish-npm`)
159+
8. ✅ Publish to **GitHub Container Registry** at `ghcr.io/twitchax/kord:latest` (`publish-oci`)
160+
161+
#### 3. Push Tags to GitHub
162+
163+
```bash
164+
# Push the version tags created by cargo-release
165+
git push --follow-tags
166+
```
167+
168+
#### 4. Create GitHub Release
169+
170+
🎯 **Manual step**: Go to [GitHub Releases](https://github.com/twitchax/kord/releases) and:
171+
- Click "Draft a new release"
172+
- Select the tag you just pushed (e.g., `v0.8.0`)
173+
- Generate release notes or write your own
174+
- Attach platform binaries from CI artifacts if desired
175+
- Publish the release
176+
177+
> **Note**: CI automatically builds platform binaries (Linux, Windows, macOS) and the WASM binary on every push to main, but **does not automatically publish** them. All publishing is manual via the steps above.
178+
121179
### Publish Without Version Changes
122180

123181
If you've already bumped versions manually or want to republish:
@@ -126,14 +184,6 @@ If you've already bumped versions manually or want to republish:
126184
cargo make publish-all
127185
```
128186

129-
**This orchestrates:**
130-
1. Format check and tests (`check-all`)
131-
2. Build CLI binary (`build-cli`)
132-
3. Build WASM package (`build-npm`)
133-
4. Build Leptos web app (`build-web`)
134-
5. Publish `kord` crate to crates.io (`publish-crates`)
135-
6. Rename npm package to `kordweb` and publish (`publish-npm`)
136-
137187
### Individual Tasks
138188

139189
```bash
@@ -159,7 +209,7 @@ cargo make publish-oci
159209

160210
> **Prerequisites**:
161211
> - Install the `wasm32-wasip2` target: `rustup target add wasm32-wasip2`
162-
> - Install `wkg` tool: `cargo install wasm-pkg-tools`
212+
> - Install `wkg` tool: `cargo install wkg`
163213
> - Authenticate with GitHub Container Registry: `docker login ghcr.io`
164214
>
165215
> The package will be available at `ghcr.io/twitchax/kord:latest` and can be run with any WASI-compatible runtime like Wasmtime or wkg.

Makefile.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ install_crate = "cargo-llvm-cov"
1414
[tasks.install-wasm-pack]
1515
install_crate = "wasm-pack"
1616

17-
[tasks.install-wasm-pkg-tools]
18-
install_crate = "wasm-pkg-tools"
17+
[tasks.install-wkg]
18+
install_crate = "wkg"
1919

2020
[tasks.tools]
2121
dependencies = [
2222
"install-nextest",
2323
"install-llvm-cov",
2424
"install-wasm-pack",
25-
"install-wasm-pkg-tools",
25+
"install-wkg",
2626
]
2727

2828
# Build / test tasks.
@@ -176,7 +176,6 @@ args = ["leptos", "build", "--release"]
176176
[tasks.build-oci]
177177
cwd = "kord"
178178
workspace = false
179-
dependencies = ["install-wasm-pkg-tools"]
180179
command = "cargo"
181180
args = [
182181
"build",
@@ -191,10 +190,9 @@ args = [
191190
]
192191

193192
[tasks.publish-oci]
194-
dependencies = ["build-oci"]
193+
dependencies = ["build-oci", "install-wkg"]
195194
cwd = "."
196195
workspace = false
197-
install_crate = "wasm-pkg-tools"
198196
command = "wkg"
199197
args = [
200198
"oci",

0 commit comments

Comments
 (0)