Skip to content

Commit ae07fc0

Browse files
ci: add trusted publishing workflows
Signed-off-by: Henry <mail@henrygressmann.de>
1 parent ed24914 commit ae07fc0

13 files changed

Lines changed: 155 additions & 41 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish client packages
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
rust_api:
7+
description: Publish the Rust API client
8+
type: boolean
9+
default: false
10+
npm_api:
11+
description: Publish the npm API client
12+
type: boolean
13+
default: false
14+
npm_tracker:
15+
description: Publish the npm tracker
16+
type: boolean
17+
default: false
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
check-selection:
24+
if: '!inputs.rust_api && !inputs.npm_api && !inputs.npm_tracker'
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- run: |
28+
echo 'Select at least one client package to publish.' >&2
29+
exit 1
30+
31+
publish-rust:
32+
if: github.ref == 'refs/heads/main' && inputs.rust_api
33+
runs-on: ubuntu-24.04
34+
environment: client-release
35+
permissions:
36+
contents: read
37+
id-token: write
38+
steps:
39+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40+
with:
41+
persist-credentials: false
42+
- uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
43+
- run: cargo test -p liwan-api --all-features --locked
44+
- uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
45+
id: auth
46+
- run: cargo publish -p liwan-api --locked
47+
env:
48+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
49+
50+
publish-npm:
51+
if: github.ref == 'refs/heads/main' && (inputs.npm_api || inputs.npm_tracker)
52+
runs-on: ubuntu-24.04
53+
environment: client-release
54+
permissions:
55+
contents: read
56+
id-token: write
57+
steps:
58+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
59+
with:
60+
persist-credentials: false
61+
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
62+
with:
63+
node-version: "24"
64+
registry-url: https://registry.npmjs.org
65+
package-manager-cache: false
66+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
67+
with:
68+
bun-version: latest
69+
no-cache: true
70+
- run: bun install --frozen-lockfile
71+
- name: Test and build API client
72+
if: inputs.npm_api
73+
run: |
74+
bun run --cwd packages/api test
75+
bun run --cwd packages/api typecheck
76+
bun run --cwd packages/api build
77+
- name: Build tracker
78+
if: inputs.npm_tracker
79+
run: |
80+
bun run --cwd packages/tracker typecheck
81+
bun run --cwd packages/tracker build
82+
- name: Publish API client
83+
if: inputs.npm_api
84+
working-directory: packages/api
85+
run: npm publish --access public
86+
- name: Publish tracker
87+
if: inputs.npm_tracker
88+
working-directory: packages/tracker
89+
run: npm publish --access public

‎CHANGELOG.md‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,28 @@ The format is roughly based on the output of `git-cliff` and this project adhere
1616
Since this is not a library, this changelog focuses on the changes that are relevant to the end-users. For a detailed list of changes, see the commit history, which adheres to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). New releases are created automatically when a new tag is pushed (Commit message: chore(release): vX.X.X).
1717
-->
1818

19-
> The `liwan-tracker` npm package is intended for current Liwan server releases. Its network protocol may change between Liwan versions. When it does, update the npm tracker alongside Liwan. If you use the tracker script served by Liwan itself, it already uses the matching internal tracker version.
20-
2119
## [Unreleased]
2220

21+
### ⚠️ Breaking Changes
22+
23+
- Direct per-user project assignments no longer grant access. Reassign users to teams to restore private-project access.
24+
- The tracker npm package is moving from `liwan-tracker` to `@liwan.dev/tracker`. Update package dependencies and imports. The old package remains available but will not receive new releases.
25+
2326
### Features
2427

25-
- Added drag-to-select custom date ranges on project graphs with automatic resolution and double-click undo
26-
- Added selectable hourly, daily, weekly, and monthly dashboard graph intervals
27-
- Added configurable dashboard footer links and custom HTML in the page head
28-
- Added support for hosting Liwan under a sub-path in `base_url`
2928
- Added support for custom events
3029
- Added support for custom properties
31-
- Added left and right arrow keyboard shortcuts for navigating dashboard date ranges
3230
- Added authenticated batch event ingestion endpoint
3331
- Added API key management UI
32+
- Added a configurable maximum session duration
33+
- Added drag-to-select custom date ranges on project graphs with automatic resolution and double-click undo
34+
- Added selectable hourly, daily, weekly, and monthly dashboard graph intervals
35+
- Added left and right arrow keyboard shortcuts for navigating dashboard date ranges
3436
- Added teams for assigning project read access to groups of users
3537
- Added internal project visibility for all signed-in users
36-
- Added a configurable maximum session duration
3738
- Added automatic team assignment for new SSO accounts
38-
39-
### ⚠️ Breaking Changes
40-
41-
- Direct per-user project assignments no longer grant access. Reassign users to teams to restore private-project access.
39+
- Added support for hosting Liwan under a sub-path in `base_url`
40+
- Added configurable dashboard footer links and custom HTML in the page head
4241

4342
## [v1.7.0] - 2026-09-13
4443

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
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
@@ -4,7 +4,7 @@ members = ["crates/*"]
44
default-members = ["crates/liwan"]
55

66
[workspace.package]
7-
version = "1.6.0"
7+
version = "1.8.0"
88
edition = "2024"
99
rust-version = "1.99"
1010
homepage = "https://liwan.dev"

‎bun.lock‎

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/api/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "liwan-api"
3-
version = "0.1.0"
3+
version = "0.8.0"
44
edition.workspace = true
55
rust-version.workspace = true
66
description = "Rust client for the Liwan API"

‎crates/api/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Rust client for the [Liwan](https://liwan.dev) API.
44

5+
While the API is pre-1.0, its minor version tracks the Liwan 1.x release needed for its latest features. Patch releases are independent, and older clients keep working with newer servers but need an update for new features.
6+
57
```sh
68
cargo add liwan-api --features reqwest,tokio
79
cargo add reqwest --no-default-features --features rustls

‎packages/api/README.md‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
# liwan-api
1+
# @liwan.dev/api
22

33
JavaScript and TypeScript client for the [Liwan](https://liwan.dev) API.
44

5+
While the API is pre-1.0, its minor version tracks the Liwan 1.x release needed for its latest features. Patch releases are independent, and older clients keep working with newer servers but need an update for new features.
6+
7+
## Install
8+
59
```sh
6-
npm install liwan-api
10+
# npm
11+
npm install @liwan.dev/api
12+
13+
# Bun
14+
bun add @liwan.dev/api
15+
16+
# pnpm
17+
pnpm add @liwan.dev/api
718
```
819

920
```ts
10-
import { createClient } from "liwan-api";
21+
import { createClient } from "@liwan.dev/api";
1122

1223
const client = createClient({
1324
endpoint: "https://liwan.example.com",
1425
apiKey: process.env.LIWAN_API_KEY!,
1526
});
1627
```
1728

18-
See [examples/](examples/) for usage examples. For client-side tracking, use [liwan-tracker](https://www.npmjs.com/package/liwan-tracker).
29+
See [examples/](examples/) for usage examples. For client-side tracking, use [@liwan.dev/tracker](https://www.npmjs.com/package/@liwan.dev/tracker).
1930

2031
## License
2132

‎packages/api/examples/express.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { createClient } from "@liwan.dev/api";
2+
import { expressMiddleware } from "@liwan.dev/api/express";
13
import express from "express";
2-
import { createClient } from "liwan-api";
3-
import { expressMiddleware } from "liwan-api/express";
44

55
const analytics = createClient({
66
endpoint: "https://analytics.example.com",

‎packages/api/examples/hono.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getConnInfo } from "@hono/bun";
2+
import { createClient } from "@liwan.dev/api";
3+
import { honoMiddleware } from "@liwan.dev/api/hono";
24
import { Hono } from "hono";
3-
import { createClient } from "liwan-api";
4-
import { honoMiddleware } from "liwan-api/hono";
55

66
const analytics = createClient({
77
endpoint: "https://analytics.example.com",

0 commit comments

Comments
 (0)