-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (66 loc) · 2.21 KB
/
Copy pathpublish.yml
File metadata and controls
82 lines (66 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --workspace
- name: Test
run: cargo test --workspace
- name: Clippy
run: cargo clippy --workspace -- -D warnings
publish:
needs: test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Check tag matches workspace version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
MANIFEST_VERSION="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)"
if [ -z "$MANIFEST_VERSION" ]; then
echo "::error::no version found in [workspace.package] of Cargo.toml"
exit 1
fi
if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match workspace version $MANIFEST_VERSION"
exit 1
fi
echo "Publishing kqs $MANIFEST_VERSION"
# Publish in dependency order; each `cargo publish` verifies the package
# against the registry, so dependents can only be published once their
# deps are live.
- name: Publish kq-config
run: cargo publish -p kq-config
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish kq-llm
run: cargo publish -p kq-llm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish kq-embeddings
run: cargo publish -p kq-embeddings
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish kq-core
run: cargo publish -p kq-core
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish kqs
run: cargo publish -p kqs
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}