Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/package-publishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Package Publishing

on:
push:
tags:
- 'node-v*.*.*'
- 'python-v*.*.*'
- 'dotnet-v*.*.*'

jobs:
determine-sdk:
runs-on: ubuntu-latest
outputs:
sdk_type: ${{ steps.extract.outputs.sdk_type }}
version: ${{ steps.extract.outputs.version }}
steps:
- id: extract
run: |
TAG=${GITHUB_REF#refs/tags/}
SDK_TYPE=${TAG%-v*}
VERSION=${TAG#*-v}
echo "sdk_type=$SDK_TYPE" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT

publish-package:
needs: determine-sdk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Node.js publishing
- name: Setup Node.js
if: ${{ needs.determine-sdk.outputs.sdk_type == 'node' }}
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Publish Node package
if: ${{ needs.determine-sdk.outputs.sdk_type == 'node' }}
run: |
cd sdk/node
npm ci
npm version ${{ needs.determine-sdk.outputs.version }} --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Python publishing
- name: Setup Python
if: ${{ needs.determine-sdk.outputs.sdk_type == 'python' }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Publish Python package
if: ${{ needs.determine-sdk.outputs.sdk_type == 'python' }}
run: |
cd sdk/python
# Update version in setup.py or pyproject.toml
sed -i "s/version=\".*\"/version=\"${{ needs.determine-sdk.outputs.version }}\"/g" setup.py
pip install build twine
python -m build
python -m twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

# .NET publishing
- name: Setup .NET
if: ${{ needs.determine-sdk.outputs.sdk_type == 'dotnet' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Publish .NET package
if: ${{ needs.determine-sdk.outputs.sdk_type == 'dotnet' }}
run: |
cd sdk/dotnet
# Update version in .csproj
sed -i "s/<Version>.*<\/Version>/<Version>${{ needs.determine-sdk.outputs.version }}<\/Version>/g" **/*.csproj
dotnet restore
dotnet build -c Release
dotnet pack -c Release
dotnet nuget push **/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
79 changes: 79 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: PR Validation

on:
pull_request:
branches: [develop, main]
paths:
- 'sdk/**'

permissions:
contents: read
pull-requests: read

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
node: ${{ steps.filter.outputs.node }}
python: ${{ steps.filter.outputs.python }}
dotnet: ${{ steps.filter.outputs.dotnet }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
node:
- 'sdk/node/**'
python:
- 'sdk/python/**'
dotnet:
- 'sdk/dotnet/**'

build-node:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.node == 'true' }}
runs-on: ubuntu-latest
env:
HPKV_API_BASE_URL: ${{ secrets.HPKV_API_BASE_URL }}
HPKV_NEXUS_URL: ${{ secrets.HPKV_NEXUS_URL }}
HPKV_API_KEY: ${{ secrets.HPKV_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: |
cd sdk/node
npm ci
npm run lint
npm test

build-python:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.python == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: |
cd sdk/python
pip install -e ".[dev]"
pytest

build-dotnet:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.dotnet == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- run: |
cd sdk/dotnet
dotnet restore
dotnet build
dotnet test
69 changes: 69 additions & 0 deletions .github/workflows/release-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Validation

on:
push:
branches:
- 'release/node-v*'
- 'release/python-v*'
- 'release/dotnet-v*'

permissions:
contents: read
pull-requests: read

jobs:
determine-sdk:
runs-on: ubuntu-latest
outputs:
sdk_type: ${{ steps.extract.outputs.sdk_type }}
version: ${{ steps.extract.outputs.version }}
steps:
- id: extract
run: |
BRANCH=${GITHUB_REF#refs/heads/release/}
SDK_TYPE=${BRANCH%-v*}
VERSION=${BRANCH#*-v}
echo "sdk_type=$SDK_TYPE" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT

validate-sdk:
needs: determine-sdk
runs-on: ubuntu-latest
env:
HPKV_API_BASE_URL: ${{ secrets.HPKV_API_BASE_URL }}
HPKV_NEXUS_URL: ${{ secrets.HPKV_NEXUS_URL }}
HPKV_API_KEY: ${{ secrets.HPKV_API_KEY }}
steps:
- uses: actions/checkout@v3

# Node.js validation
- name: Validate Node.js SDK
if: ${{ needs.determine-sdk.outputs.sdk_type == 'node' }}
run: |
cd sdk/node
npm ci
npm run lint
npm test
npm pack
echo "Ready to release Node.js SDK version ${{ needs.determine-sdk.outputs.version }}"

# Python validation
- name: Validate Python SDK
if: ${{ needs.determine-sdk.outputs.sdk_type == 'python' }}
run: |
cd sdk/python
pip install -e ".[dev]"
pytest
python -m build
echo "Ready to release Python SDK version ${{ needs.determine-sdk.outputs.version }}"

# .NET validation
- name: Validate .NET SDK
if: ${{ needs.determine-sdk.outputs.sdk_type == 'dotnet' }}
run: |
cd sdk/dotnet
dotnet restore
dotnet build
dotnet test
dotnet pack -c Release
echo "Ready to release .NET SDK version ${{ needs.determine-sdk.outputs.version }}"
4 changes: 4 additions & 0 deletions sdk/node/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
coverage/
*.d.ts
23 changes: 23 additions & 0 deletions sdk/node/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"node": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
}
}
47 changes: 47 additions & 0 deletions sdk/node/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Dependencies
node_modules/
yarn.lock

# Build output
dist/
build/

# Test coverage
coverage/

# IDE and editor files
.idea/
.vscode/
*.swp
*.swo
.DS_Store

# Environment variables
.env
.env.local
.env.*.local

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# TypeScript
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
6 changes: 6 additions & 0 deletions sdk/node/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
coverage/
*.d.ts
package-lock.json
yarn.lock
21 changes: 21 additions & 0 deletions sdk/node/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 High Performance KV Store

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading