koava 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- koava-0.1.0/.github/workflows/ci.yml +50 -0
- koava-0.1.0/.github/workflows/koava-release.yml +548 -0
- koava-0.1.0/.gitignore +89 -0
- koava-0.1.0/Cargo.lock +4229 -0
- koava-0.1.0/Cargo.toml +103 -0
- koava-0.1.0/FEATURES.md +50 -0
- koava-0.1.0/LICENSE +202 -0
- koava-0.1.0/MANIFEST.in +21 -0
- koava-0.1.0/PKG-INFO +165 -0
- koava-0.1.0/README.md +138 -0
- koava-0.1.0/custom_config.json +6 -0
- koava-0.1.0/proptest-regressions/config.txt +8 -0
- koava-0.1.0/proptest-regressions/store.txt +7 -0
- koava-0.1.0/protocol/Cargo.toml +15 -0
- koava-0.1.0/protocol/src/api/auth.rs +50 -0
- koava-0.1.0/protocol/src/api/mod.rs +11 -0
- koava-0.1.0/protocol/src/api/model.rs +102 -0
- koava-0.1.0/protocol/src/common/auth.rs +26 -0
- koava-0.1.0/protocol/src/common/key.rs +20 -0
- koava-0.1.0/protocol/src/common/mod.rs +7 -0
- koava-0.1.0/protocol/src/common/model.rs +67 -0
- koava-0.1.0/protocol/src/lib.rs +2 -0
- koava-0.1.0/pyproject.toml +59 -0
- koava-0.1.0/src/auth.rs +324 -0
- koava-0.1.0/src/cli.rs +186 -0
- koava-0.1.0/src/client.rs +488 -0
- koava-0.1.0/src/config.rs +648 -0
- koava-0.1.0/src/encrypt.rs +1792 -0
- koava-0.1.0/src/error.rs +971 -0
- koava-0.1.0/src/file.rs +407 -0
- koava-0.1.0/src/huggingface.rs +161 -0
- koava-0.1.0/src/key.rs +342 -0
- koava-0.1.0/src/main.rs +312 -0
- koava-0.1.0/src/model.rs +782 -0
- koava-0.1.0/src/policy.rs +27 -0
- koava-0.1.0/src/push.rs +733 -0
- koava-0.1.0/src/security.rs +242 -0
- koava-0.1.0/src/store.rs +488 -0
- koava-0.1.0/src/templates.rs +10 -0
- koava-0.1.0/src/tests/mocks.rs +142 -0
- koava-0.1.0/src/tests/mod.rs +7 -0
- koava-0.1.0/src/tests/utils.rs +59 -0
- koava-0.1.0/src/ui.rs +303 -0
- koava-0.1.0/src/upload.rs +507 -0
- koava-0.1.0/src/utils.rs +357 -0
- koava-0.1.0/templates/KOALAVAULT_PROPRIETARY_LICENSE.txt +81 -0
- koava-0.1.0/templates/README_ENCRYPTED_MODEL.md +14 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Test & Coverage
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install Rust toolchain
|
|
20
|
+
uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
with:
|
|
22
|
+
components: clippy, rustfmt
|
|
23
|
+
|
|
24
|
+
- name: Cache cargo
|
|
25
|
+
uses: actions/cache@v4
|
|
26
|
+
with:
|
|
27
|
+
path: |
|
|
28
|
+
~/.cargo/registry
|
|
29
|
+
~/.cargo/git
|
|
30
|
+
target
|
|
31
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
32
|
+
|
|
33
|
+
- name: Check Formatting
|
|
34
|
+
run: cargo fmt --all -- --check
|
|
35
|
+
|
|
36
|
+
- name: Build
|
|
37
|
+
run: cargo build --all-features
|
|
38
|
+
|
|
39
|
+
- name: Run Tests
|
|
40
|
+
run: cargo test --all-features
|
|
41
|
+
|
|
42
|
+
- name: Clippy
|
|
43
|
+
run: cargo clippy --all-features -- -D warnings
|
|
44
|
+
|
|
45
|
+
- name: Install Tarpaulin
|
|
46
|
+
run: cargo install cargo-tarpaulin
|
|
47
|
+
|
|
48
|
+
- name: Coverage Check
|
|
49
|
+
run: |
|
|
50
|
+
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
|
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
name: Build and Publish koava to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Manual trigger - auto-calculates next RC version
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
inputs:
|
|
7
|
+
dryrun:
|
|
8
|
+
description: 'Dry run (build only, no publish)'
|
|
9
|
+
required: false
|
|
10
|
+
type: boolean
|
|
11
|
+
default: false
|
|
12
|
+
build_type:
|
|
13
|
+
description: 'Build type (release or debug)'
|
|
14
|
+
required: false
|
|
15
|
+
type: choice
|
|
16
|
+
options:
|
|
17
|
+
- release
|
|
18
|
+
- debug
|
|
19
|
+
default: release
|
|
20
|
+
|
|
21
|
+
# Build and test on push (branches and tags) and pull requests
|
|
22
|
+
push:
|
|
23
|
+
branches:
|
|
24
|
+
- '**'
|
|
25
|
+
tags:
|
|
26
|
+
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
27
|
+
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
|
|
28
|
+
pull_request:
|
|
29
|
+
branches:
|
|
30
|
+
- main
|
|
31
|
+
- master
|
|
32
|
+
- develop
|
|
33
|
+
|
|
34
|
+
env:
|
|
35
|
+
PACKAGE_NAME: koava
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
prepare:
|
|
39
|
+
runs-on: ubuntu-22.04
|
|
40
|
+
# Skip push events on PR branches to avoid duplicate builds
|
|
41
|
+
if: github.event_name != 'push' || github.event.pull_request == null
|
|
42
|
+
outputs:
|
|
43
|
+
version: ${{ steps.config.outputs.version }}
|
|
44
|
+
dryrun: ${{ steps.config.outputs.dryrun }}
|
|
45
|
+
testpypi: ${{ steps.config.outputs.testpypi }}
|
|
46
|
+
build_type: ${{ steps.config.outputs.build_type }}
|
|
47
|
+
is_release: ${{ steps.config.outputs.is_release }}
|
|
48
|
+
steps:
|
|
49
|
+
- name: Checkout code
|
|
50
|
+
uses: actions/checkout@v4
|
|
51
|
+
with:
|
|
52
|
+
fetch-depth: 0 # Fetch full history to ensure latest code
|
|
53
|
+
|
|
54
|
+
- name: Determine version and mode
|
|
55
|
+
id: config
|
|
56
|
+
run: |
|
|
57
|
+
EVENT_NAME="${{ github.event_name }}"
|
|
58
|
+
REF_TYPE="${{ github.ref_type }}"
|
|
59
|
+
|
|
60
|
+
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
|
|
61
|
+
# Manual trigger: build only, no publishing (only tag pushes can publish)
|
|
62
|
+
DRYRUN="${{ github.event.inputs.dryrun }}"
|
|
63
|
+
BUILD_TYPE="${{ github.event.inputs.build_type }}"
|
|
64
|
+
IS_RELEASE="false" # Manual trigger cannot publish, only tag pushes can
|
|
65
|
+
|
|
66
|
+
# Get latest tag
|
|
67
|
+
git fetch --tags
|
|
68
|
+
LATEST_TAG=$(git tag -l 'v*' | sort -V | tail -1)
|
|
69
|
+
|
|
70
|
+
if [ -z "$LATEST_TAG" ]; then
|
|
71
|
+
# No tags exist, start with v0.0.1-rc.1
|
|
72
|
+
BASE_VERSION="0.0.1"
|
|
73
|
+
RC_NUM=1
|
|
74
|
+
else
|
|
75
|
+
# Remove 'v' prefix
|
|
76
|
+
LATEST_VERSION="${LATEST_TAG#v}"
|
|
77
|
+
|
|
78
|
+
if [[ "$LATEST_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-rc\.([0-9]+)$ ]]; then
|
|
79
|
+
# Latest is an RC version, increment RC number
|
|
80
|
+
BASE_VERSION="${BASH_REMATCH[1]}"
|
|
81
|
+
RC_NUM=$((${BASH_REMATCH[2]} + 1))
|
|
82
|
+
else
|
|
83
|
+
# Latest is a release version, increment patch and start rc.1
|
|
84
|
+
if [[ "$LATEST_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
|
85
|
+
MAJOR="${BASH_REMATCH[1]}"
|
|
86
|
+
MINOR="${BASH_REMATCH[2]}"
|
|
87
|
+
PATCH="${BASH_REMATCH[3]}"
|
|
88
|
+
BASE_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"
|
|
89
|
+
RC_NUM=1
|
|
90
|
+
else
|
|
91
|
+
echo "::error::Failed to parse version: $LATEST_VERSION"
|
|
92
|
+
exit 1
|
|
93
|
+
fi
|
|
94
|
+
fi
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
VERSION="${BASE_VERSION}-rc.${RC_NUM}"
|
|
98
|
+
TESTPYPI="false" # Manual trigger does not publish
|
|
99
|
+
|
|
100
|
+
# Enforce: debug builds must be RC
|
|
101
|
+
if [ "$BUILD_TYPE" = "debug" ]; then
|
|
102
|
+
if ! echo "$VERSION" | grep -q "-rc\."; then
|
|
103
|
+
echo "::error::Debug builds are only allowed for RC versions"
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
echo "Manual trigger: Build only mode (no publishing)"
|
|
109
|
+
echo "Auto-calculated RC version: $VERSION"
|
|
110
|
+
elif [ "$EVENT_NAME" = "push" ] && [ "$REF_TYPE" = "tag" ]; then
|
|
111
|
+
# Tag push: extract version from tag name (for publishing)
|
|
112
|
+
TAG_NAME="${{ github.ref_name }}"
|
|
113
|
+
VERSION="${TAG_NAME#v}"
|
|
114
|
+
DRYRUN="false"
|
|
115
|
+
BUILD_TYPE="release"
|
|
116
|
+
IS_RELEASE="true"
|
|
117
|
+
|
|
118
|
+
# Determine publish target based on tag type
|
|
119
|
+
# RC tags (containing -rc.N) -> TestPyPI only
|
|
120
|
+
# Release tags (no -rc suffix) -> PyPI only
|
|
121
|
+
echo "Analyzing tag: $TAG_NAME"
|
|
122
|
+
echo "Extracted version: $VERSION"
|
|
123
|
+
|
|
124
|
+
if echo "$VERSION" | grep -qE "-rc\.[0-9]+$"; then
|
|
125
|
+
TESTPYPI="true"
|
|
126
|
+
echo "β RC tag detected (contains -rc.N suffix)"
|
|
127
|
+
echo "β Publishing to TestPyPI only"
|
|
128
|
+
else
|
|
129
|
+
TESTPYPI="false"
|
|
130
|
+
echo "β Release tag detected (no -rc suffix)"
|
|
131
|
+
echo "β Publishing to PyPI only"
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
echo "Building from tag: $TAG_NAME"
|
|
135
|
+
echo "Version: $VERSION"
|
|
136
|
+
else
|
|
137
|
+
# Regular push or pull_request: build only, no publish
|
|
138
|
+
echo "Build and test mode (no publishing)"
|
|
139
|
+
DRYRUN="true"
|
|
140
|
+
BUILD_TYPE="release"
|
|
141
|
+
IS_RELEASE="false"
|
|
142
|
+
TESTPYPI="false"
|
|
143
|
+
|
|
144
|
+
# Use a test version for build testing
|
|
145
|
+
git fetch --tags
|
|
146
|
+
LATEST_TAG=$(git tag -l 'v*' | sort -V | tail -1)
|
|
147
|
+
|
|
148
|
+
if [ -z "$LATEST_TAG" ]; then
|
|
149
|
+
VERSION="0.0.1-dev"
|
|
150
|
+
else
|
|
151
|
+
LATEST_VERSION="${LATEST_TAG#v}"
|
|
152
|
+
if [[ "$LATEST_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)(-rc\.[0-9]+)?$ ]]; then
|
|
153
|
+
BASE_VERSION="${BASH_REMATCH[1]}"
|
|
154
|
+
VERSION="${BASE_VERSION}-dev"
|
|
155
|
+
else
|
|
156
|
+
VERSION="0.0.1-dev"
|
|
157
|
+
fi
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
echo "Test build version: $VERSION"
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Output to GITHUB_OUTPUT (must be lowercase keys)
|
|
164
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
165
|
+
echo "dryrun=$DRYRUN" >> $GITHUB_OUTPUT
|
|
166
|
+
echo "testpypi=$TESTPYPI" >> $GITHUB_OUTPUT
|
|
167
|
+
echo "build_type=$BUILD_TYPE" >> $GITHUB_OUTPUT
|
|
168
|
+
echo "is_release=$IS_RELEASE" >> $GITHUB_OUTPUT
|
|
169
|
+
|
|
170
|
+
# Debug output
|
|
171
|
+
echo ""
|
|
172
|
+
echo "=== Configuration Summary ==="
|
|
173
|
+
echo "Version: $VERSION"
|
|
174
|
+
echo "Dry run: $DRYRUN"
|
|
175
|
+
echo "TestPyPI: $TESTPYPI"
|
|
176
|
+
echo "Build Type: $BUILD_TYPE"
|
|
177
|
+
echo "Is Release: $IS_RELEASE"
|
|
178
|
+
echo "=============================="
|
|
179
|
+
|
|
180
|
+
- name: Update versions in files
|
|
181
|
+
run: |
|
|
182
|
+
VERSION="${{ steps.config.outputs.version }}"
|
|
183
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
184
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
185
|
+
echo "Updated pyproject.toml and Cargo.toml version to $VERSION"
|
|
186
|
+
|
|
187
|
+
build-linux-x86_64:
|
|
188
|
+
needs: prepare
|
|
189
|
+
runs-on: ubuntu-22.04
|
|
190
|
+
steps:
|
|
191
|
+
- name: Checkout code
|
|
192
|
+
uses: actions/checkout@v4
|
|
193
|
+
with:
|
|
194
|
+
fetch-depth: 0
|
|
195
|
+
|
|
196
|
+
- name: Set up Python
|
|
197
|
+
uses: actions/setup-python@v4
|
|
198
|
+
with:
|
|
199
|
+
python-version: '3.11'
|
|
200
|
+
|
|
201
|
+
- name: Install Rust
|
|
202
|
+
uses: dtolnay/rust-toolchain@stable
|
|
203
|
+
with:
|
|
204
|
+
targets: x86_64-unknown-linux-gnu
|
|
205
|
+
|
|
206
|
+
- name: Install system dependencies
|
|
207
|
+
run: |
|
|
208
|
+
sudo apt-get update
|
|
209
|
+
sudo apt-get install -y libssl-dev pkg-config
|
|
210
|
+
|
|
211
|
+
- name: Install maturin
|
|
212
|
+
run: pip install maturin
|
|
213
|
+
|
|
214
|
+
- name: Update versions
|
|
215
|
+
run: |
|
|
216
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
217
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
218
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
219
|
+
|
|
220
|
+
- name: Build for Linux x86_64
|
|
221
|
+
run: maturin build --release --target x86_64-unknown-linux-gnu --features cert-pinning
|
|
222
|
+
|
|
223
|
+
- name: Upload Linux x86_64 wheels
|
|
224
|
+
uses: actions/upload-artifact@v4
|
|
225
|
+
with:
|
|
226
|
+
name: wheels-linux-x86_64
|
|
227
|
+
path: target/wheels/*.whl
|
|
228
|
+
|
|
229
|
+
build-linux-arm64:
|
|
230
|
+
needs: prepare
|
|
231
|
+
runs-on: ubuntu-22.04
|
|
232
|
+
steps:
|
|
233
|
+
- name: Checkout code
|
|
234
|
+
uses: actions/checkout@v4
|
|
235
|
+
with:
|
|
236
|
+
fetch-depth: 0
|
|
237
|
+
|
|
238
|
+
- name: Set up Python
|
|
239
|
+
uses: actions/setup-python@v4
|
|
240
|
+
with:
|
|
241
|
+
python-version: '3.11'
|
|
242
|
+
|
|
243
|
+
- name: Install Rust
|
|
244
|
+
uses: dtolnay/rust-toolchain@stable
|
|
245
|
+
with:
|
|
246
|
+
targets: aarch64-unknown-linux-gnu
|
|
247
|
+
|
|
248
|
+
- name: Verify Rust target installation
|
|
249
|
+
run: |
|
|
250
|
+
rustup target list --installed | grep aarch64-unknown-linux-gnu || rustup target add aarch64-unknown-linux-gnu
|
|
251
|
+
rustc --version --verbose
|
|
252
|
+
rustc --print target-list | grep aarch64-unknown-linux-gnu
|
|
253
|
+
|
|
254
|
+
- name: Install system dependencies
|
|
255
|
+
run: |
|
|
256
|
+
sudo apt-get update
|
|
257
|
+
sudo apt-get install -y libssl-dev pkg-config
|
|
258
|
+
# Install cross-compilation toolchain for ARM64
|
|
259
|
+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross
|
|
260
|
+
|
|
261
|
+
- name: Configure Cargo for cross-compilation
|
|
262
|
+
run: |
|
|
263
|
+
# Set environment variables for cross-compilation (target-specific)
|
|
264
|
+
# These only affect aarch64-unknown-linux-gnu target, not other platforms
|
|
265
|
+
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
266
|
+
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
|
|
267
|
+
echo "AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar" >> $GITHUB_ENV
|
|
268
|
+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
269
|
+
|
|
270
|
+
- name: Install maturin
|
|
271
|
+
run: pip install maturin
|
|
272
|
+
|
|
273
|
+
- name: Update versions
|
|
274
|
+
run: |
|
|
275
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
276
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
277
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
278
|
+
|
|
279
|
+
- name: Build for Linux ARM64
|
|
280
|
+
run: maturin build --release --target aarch64-unknown-linux-gnu --features cert-pinning
|
|
281
|
+
|
|
282
|
+
- name: Upload Linux ARM64 wheels
|
|
283
|
+
uses: actions/upload-artifact@v4
|
|
284
|
+
with:
|
|
285
|
+
name: wheels-linux-arm64
|
|
286
|
+
path: target/wheels/*.whl
|
|
287
|
+
|
|
288
|
+
build-macos-x86_64:
|
|
289
|
+
needs: prepare
|
|
290
|
+
runs-on: macos-15-intel
|
|
291
|
+
steps:
|
|
292
|
+
- name: Checkout code
|
|
293
|
+
uses: actions/checkout@v4
|
|
294
|
+
with:
|
|
295
|
+
fetch-depth: 0
|
|
296
|
+
|
|
297
|
+
- name: Set up Python
|
|
298
|
+
uses: actions/setup-python@v4
|
|
299
|
+
with:
|
|
300
|
+
python-version: '3.11'
|
|
301
|
+
|
|
302
|
+
- name: Install Rust
|
|
303
|
+
uses: dtolnay/rust-toolchain@stable
|
|
304
|
+
with:
|
|
305
|
+
targets: x86_64-apple-darwin
|
|
306
|
+
|
|
307
|
+
- name: Install maturin
|
|
308
|
+
run: pip install maturin
|
|
309
|
+
|
|
310
|
+
- name: Update versions
|
|
311
|
+
run: |
|
|
312
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
313
|
+
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
314
|
+
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
315
|
+
|
|
316
|
+
- name: Build for macOS x86_64
|
|
317
|
+
run: maturin build --release --target x86_64-apple-darwin --features cert-pinning
|
|
318
|
+
|
|
319
|
+
- name: Upload macOS x86_64 wheels
|
|
320
|
+
uses: actions/upload-artifact@v4
|
|
321
|
+
with:
|
|
322
|
+
name: wheels-macos-x86_64
|
|
323
|
+
path: target/wheels/*.whl
|
|
324
|
+
|
|
325
|
+
build-macos-arm64:
|
|
326
|
+
needs: prepare
|
|
327
|
+
runs-on: macos-15
|
|
328
|
+
steps:
|
|
329
|
+
- name: Checkout code
|
|
330
|
+
uses: actions/checkout@v4
|
|
331
|
+
with:
|
|
332
|
+
fetch-depth: 0
|
|
333
|
+
|
|
334
|
+
- name: Set up Python
|
|
335
|
+
uses: actions/setup-python@v4
|
|
336
|
+
with:
|
|
337
|
+
python-version: '3.11'
|
|
338
|
+
|
|
339
|
+
- name: Install Rust
|
|
340
|
+
uses: dtolnay/rust-toolchain@stable
|
|
341
|
+
with:
|
|
342
|
+
targets: aarch64-apple-darwin
|
|
343
|
+
|
|
344
|
+
- name: Install maturin
|
|
345
|
+
run: pip install maturin
|
|
346
|
+
|
|
347
|
+
- name: Update versions
|
|
348
|
+
run: |
|
|
349
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
350
|
+
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
351
|
+
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
352
|
+
|
|
353
|
+
- name: Build for macOS ARM64
|
|
354
|
+
run: maturin build --release --target aarch64-apple-darwin --features cert-pinning
|
|
355
|
+
|
|
356
|
+
- name: Upload macOS ARM64 wheels
|
|
357
|
+
uses: actions/upload-artifact@v4
|
|
358
|
+
with:
|
|
359
|
+
name: wheels-macos-arm64
|
|
360
|
+
path: target/wheels/*.whl
|
|
361
|
+
|
|
362
|
+
build-windows-x64:
|
|
363
|
+
needs: prepare
|
|
364
|
+
runs-on: windows-latest
|
|
365
|
+
steps:
|
|
366
|
+
- name: Checkout code
|
|
367
|
+
uses: actions/checkout@v4
|
|
368
|
+
with:
|
|
369
|
+
fetch-depth: 0
|
|
370
|
+
|
|
371
|
+
- name: Set up Python
|
|
372
|
+
uses: actions/setup-python@v4
|
|
373
|
+
with:
|
|
374
|
+
python-version: '3.11'
|
|
375
|
+
|
|
376
|
+
- name: Install Rust
|
|
377
|
+
uses: dtolnay/rust-toolchain@stable
|
|
378
|
+
with:
|
|
379
|
+
targets: x86_64-pc-windows-msvc
|
|
380
|
+
|
|
381
|
+
- name: Install maturin
|
|
382
|
+
run: pip install maturin
|
|
383
|
+
|
|
384
|
+
- name: Update versions
|
|
385
|
+
shell: pwsh
|
|
386
|
+
run: |
|
|
387
|
+
$version = "${{ needs.prepare.outputs.version }}"
|
|
388
|
+
(Get-Content pyproject.toml) -replace '^version = ".*"', "version = `"$version`"" | Set-Content pyproject.toml
|
|
389
|
+
(Get-Content Cargo.toml) -replace '^version = ".*"', "version = `"$version`"" | Set-Content Cargo.toml
|
|
390
|
+
|
|
391
|
+
- name: Build for Windows x64
|
|
392
|
+
run: maturin build --release --target x86_64-pc-windows-msvc --features cert-pinning
|
|
393
|
+
|
|
394
|
+
- name: Upload Windows x64 wheels
|
|
395
|
+
uses: actions/upload-artifact@v4
|
|
396
|
+
with:
|
|
397
|
+
name: wheels-windows-x64
|
|
398
|
+
path: target/wheels/*.whl
|
|
399
|
+
|
|
400
|
+
build-windows-arm64:
|
|
401
|
+
needs: prepare
|
|
402
|
+
runs-on: windows-latest
|
|
403
|
+
steps:
|
|
404
|
+
- name: Checkout code
|
|
405
|
+
uses: actions/checkout@v4
|
|
406
|
+
with:
|
|
407
|
+
fetch-depth: 0
|
|
408
|
+
|
|
409
|
+
- name: Set up Python
|
|
410
|
+
uses: actions/setup-python@v4
|
|
411
|
+
with:
|
|
412
|
+
python-version: '3.11'
|
|
413
|
+
|
|
414
|
+
- name: Install Rust
|
|
415
|
+
uses: dtolnay/rust-toolchain@stable
|
|
416
|
+
with:
|
|
417
|
+
targets: aarch64-pc-windows-msvc
|
|
418
|
+
|
|
419
|
+
- name: Install maturin
|
|
420
|
+
run: pip install maturin
|
|
421
|
+
|
|
422
|
+
- name: Update versions
|
|
423
|
+
shell: pwsh
|
|
424
|
+
run: |
|
|
425
|
+
$version = "${{ needs.prepare.outputs.version }}"
|
|
426
|
+
(Get-Content pyproject.toml) -replace '^version = ".*"', "version = `"$version`"" | Set-Content pyproject.toml
|
|
427
|
+
(Get-Content Cargo.toml) -replace '^version = ".*"', "version = `"$version`"" | Set-Content Cargo.toml
|
|
428
|
+
|
|
429
|
+
- name: Build for Windows ARM64
|
|
430
|
+
run: maturin build --release --target aarch64-pc-windows-msvc --features cert-pinning
|
|
431
|
+
|
|
432
|
+
- name: Upload Windows ARM64 wheels
|
|
433
|
+
uses: actions/upload-artifact@v4
|
|
434
|
+
with:
|
|
435
|
+
name: wheels-windows-arm64
|
|
436
|
+
path: target/wheels/*.whl
|
|
437
|
+
|
|
438
|
+
publish:
|
|
439
|
+
needs: [prepare, build-linux-x86_64, build-linux-arm64, build-macos-x86_64, build-macos-arm64, build-windows-x64, build-windows-arm64]
|
|
440
|
+
runs-on: ubuntu-22.04
|
|
441
|
+
# Only publish when pushing a tag (not on manual workflow_dispatch or regular pushes)
|
|
442
|
+
if: needs.prepare.outputs.is_release == 'true' && github.event_name == 'push' && github.ref_type == 'tag'
|
|
443
|
+
permissions:
|
|
444
|
+
id-token: write # Required for OIDC
|
|
445
|
+
contents: read # Required for checkout
|
|
446
|
+
|
|
447
|
+
steps:
|
|
448
|
+
- name: Checkout code
|
|
449
|
+
uses: actions/checkout@v4
|
|
450
|
+
with:
|
|
451
|
+
fetch-depth: 0
|
|
452
|
+
|
|
453
|
+
- name: Set up Python
|
|
454
|
+
uses: actions/setup-python@v4
|
|
455
|
+
with:
|
|
456
|
+
python-version: '3.11'
|
|
457
|
+
|
|
458
|
+
- name: Install maturin
|
|
459
|
+
run: pip install maturin
|
|
460
|
+
|
|
461
|
+
- name: Update versions
|
|
462
|
+
run: |
|
|
463
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
464
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
465
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
466
|
+
|
|
467
|
+
- name: Build source distribution (sdist)
|
|
468
|
+
run: maturin sdist
|
|
469
|
+
|
|
470
|
+
- name: Download all wheels
|
|
471
|
+
uses: actions/download-artifact@v4
|
|
472
|
+
with:
|
|
473
|
+
path: wheels/
|
|
474
|
+
|
|
475
|
+
- name: Combine all wheels and sdist
|
|
476
|
+
run: |
|
|
477
|
+
mkdir -p dist
|
|
478
|
+
# Copy all wheels from artifacts
|
|
479
|
+
find wheels/ -name "*.whl" -exec cp {} dist/ \;
|
|
480
|
+
# Copy sdist (maturin sdist outputs to target/wheels/)
|
|
481
|
+
find target/wheels/ -name "*.tar.gz" -exec cp {} dist/ 2>/dev/null \; || true
|
|
482
|
+
# Also check dist/ directory (some maturin versions output directly there)
|
|
483
|
+
find . -maxdepth 2 -name "koava-*.tar.gz" -exec cp {} dist/ 2>/dev/null \; || true
|
|
484
|
+
echo "π¦ All packages combined:"
|
|
485
|
+
ls -lah dist/
|
|
486
|
+
echo ""
|
|
487
|
+
echo "Package summary:"
|
|
488
|
+
echo "- Wheels: $(find dist/ -name '*.whl' | wc -l)"
|
|
489
|
+
echo "- Source dist: $(find dist/ -name '*.tar.gz' | wc -l)"
|
|
490
|
+
|
|
491
|
+
- name: Verify publish target
|
|
492
|
+
run: |
|
|
493
|
+
echo "=== Publish Target Verification ==="
|
|
494
|
+
echo "dryrun: '${{ needs.prepare.outputs.dryrun }}'"
|
|
495
|
+
echo "testpypi: '${{ needs.prepare.outputs.testpypi }}'"
|
|
496
|
+
echo "version: '${{ needs.prepare.outputs.version }}'"
|
|
497
|
+
echo ""
|
|
498
|
+
|
|
499
|
+
DRYRUN="${{ needs.prepare.outputs.dryrun }}"
|
|
500
|
+
TESTPYPI="${{ needs.prepare.outputs.testpypi }}"
|
|
501
|
+
VERSION="${{ needs.prepare.outputs.version }}"
|
|
502
|
+
|
|
503
|
+
if [ "$DRYRUN" = "true" ]; then
|
|
504
|
+
echo "βΈοΈ Dry run mode: Skipping publication"
|
|
505
|
+
exit 0
|
|
506
|
+
fi
|
|
507
|
+
|
|
508
|
+
if [ "$TESTPYPI" = "true" ]; then
|
|
509
|
+
echo "β Publishing to TestPyPI (RC tag: $VERSION)"
|
|
510
|
+
elif [ "$TESTPYPI" = "false" ]; then
|
|
511
|
+
echo "β Publishing to PyPI (Release tag: $VERSION)"
|
|
512
|
+
else
|
|
513
|
+
echo "::error::Invalid testpypi value: $TESTPYPI"
|
|
514
|
+
exit 1
|
|
515
|
+
fi
|
|
516
|
+
echo "===================================="
|
|
517
|
+
|
|
518
|
+
- name: Publish to PyPI
|
|
519
|
+
if: needs.prepare.outputs.dryrun == 'false' && needs.prepare.outputs.testpypi == 'false'
|
|
520
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
521
|
+
with:
|
|
522
|
+
skip-existing: true
|
|
523
|
+
print-hash: true
|
|
524
|
+
verbose: true
|
|
525
|
+
packages-dir: dist/
|
|
526
|
+
|
|
527
|
+
- name: Publish to TestPyPI
|
|
528
|
+
if: needs.prepare.outputs.dryrun == 'false' && needs.prepare.outputs.testpypi == 'true'
|
|
529
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
530
|
+
with:
|
|
531
|
+
repository-url: https://test.pypi.org/legacy/
|
|
532
|
+
skip-existing: true
|
|
533
|
+
print-hash: true
|
|
534
|
+
verbose: true
|
|
535
|
+
packages-dir: dist/
|
|
536
|
+
|
|
537
|
+
- name: Dry run - Skip publishing
|
|
538
|
+
if: needs.prepare.outputs.dryrun == 'true'
|
|
539
|
+
run: |
|
|
540
|
+
if [ "${{ needs.prepare.outputs.testpypi }}" = "true" ]; then
|
|
541
|
+
echo "π« Dry run mode: Would publish to TestPyPI"
|
|
542
|
+
else
|
|
543
|
+
echo "π« Dry run mode: Would publish to PyPI"
|
|
544
|
+
fi
|
|
545
|
+
echo "π¦ Built packages:"
|
|
546
|
+
ls -la dist/
|
|
547
|
+
echo "β
Build completed successfully (dry run mode)"
|
|
548
|
+
|
koava-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Rust
|
|
2
|
+
/target/
|
|
3
|
+
**/*.rs.bk
|
|
4
|
+
*.pdb
|
|
5
|
+
.cargo/config.toml
|
|
6
|
+
|
|
7
|
+
# Python
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*$py.class
|
|
11
|
+
*.so
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# Maturin
|
|
32
|
+
*.whl
|
|
33
|
+
|
|
34
|
+
# Virtual environments
|
|
35
|
+
venv/
|
|
36
|
+
env/
|
|
37
|
+
ENV/
|
|
38
|
+
.venv/
|
|
39
|
+
|
|
40
|
+
# IDE
|
|
41
|
+
.vscode/
|
|
42
|
+
.idea/
|
|
43
|
+
*.swp
|
|
44
|
+
*.swo
|
|
45
|
+
*~
|
|
46
|
+
.project
|
|
47
|
+
.classpath
|
|
48
|
+
.settings/
|
|
49
|
+
*.sublime-project
|
|
50
|
+
*.sublime-workspace
|
|
51
|
+
|
|
52
|
+
# OS
|
|
53
|
+
.DS_Store
|
|
54
|
+
.DS_Store?
|
|
55
|
+
._*
|
|
56
|
+
.Spotlight-V100
|
|
57
|
+
.Trashes
|
|
58
|
+
ehthumbs.db
|
|
59
|
+
Thumbs.db
|
|
60
|
+
*.tmp
|
|
61
|
+
|
|
62
|
+
# Environment variables
|
|
63
|
+
.env
|
|
64
|
+
.env.local
|
|
65
|
+
.env.*.local
|
|
66
|
+
|
|
67
|
+
# Logs
|
|
68
|
+
*.log
|
|
69
|
+
logs/
|
|
70
|
+
|
|
71
|
+
# Testing
|
|
72
|
+
.pytest_cache/
|
|
73
|
+
.coverage
|
|
74
|
+
htmlcov/
|
|
75
|
+
.tox/
|
|
76
|
+
.hypothesis/
|
|
77
|
+
|
|
78
|
+
# Debugging
|
|
79
|
+
*.dSYM/
|
|
80
|
+
*.su
|
|
81
|
+
*.idb
|
|
82
|
+
*.pdb
|
|
83
|
+
|
|
84
|
+
# Temporary files
|
|
85
|
+
*.tmp
|
|
86
|
+
*.temp
|
|
87
|
+
*.bak
|
|
88
|
+
*.backup
|
|
89
|
+
|