Skip to content

Commit

Permalink
- feature: added cicd to release libraries in dev versions
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol committed Jul 1, 2024
1 parent 3dc3833 commit 45cd8e6
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 25 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release development

on:
push:
branches: [main,agallardol/publish-cargo-package]

defaults:
run:
working-directory: ./

jobs:
prebuild:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package-version.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: get npm version
id: package-version
uses: Saionaro/[email protected]

publish-libraries:
needs: prebuild
runs-on: ubuntu-latest
environment: development
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node version
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: false
registry-url: https://registry.npmjs.org
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Cache cargo assets
id: cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install dependencies
run: |
npm cache verify
npm ci --no-audit --prefer-offline
- name: Setup cargo version from npm
run: |
cargo install cargo-edit
cargo set-version ${{ needs.prebuild.outputs.version }}-dev.${{github.run_number}}
- name: Run NX publish
run: npx nx run-many -t publish --skip-nx-cache --verbose
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[workspace]
members = [
"libs/shinkai-tools-runner",
]
members = ["libs/shinkai-tools-runner"]
resolver = "2"

[workspace.package]
version = "0.0.0"
repository = "https://github.com/dcSpark/shinkai-tools"
keywords = ["shinkai", "tools", "safe", "ai"]
license-file = "LICENSE"
homepage = "https://shinkai.com"
readme = "README.md"
edition = "2021"
16 changes: 13 additions & 3 deletions libs/shinkai-tools-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
[package]
name = "shinkai_tools_runner"
version = "0.7.0"
edition = "2021"
description = "Rust library to execute shinkai-tools in a safe and performant environment"
version = { workspace = true }
edition = { workspace = true }
keywords = ["shinkai", "tools", "runner", "safe", "ai"]
exclude = ["project.json"]
license-file = { workspace = true }
homepage = { workspace = true }
readme = { workspace = true }

[dependencies]
futures = "0.3.30"
nanoid = "0.4.0"
patch = "0.7.0"
reqwest = { version = "0.11.26", features = ["blocking"] }
rquickjs = { version = "0.6.2", features = ["full-async", "futures", "dump-promise"] }
rquickjs = { version = "0.6.2", features = [
"full-async",
"futures",
"dump-promise",
] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.117"
tokio = { version = "1.36.0", features = ["full"] }
Expand Down
35 changes: 20 additions & 15 deletions libs/shinkai-tools-runner/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
"command": "cargo build"
},
"configurations": {
"development": {
},
"development": {},
"production": {
"args": [
"--release"
]
"args": ["--release"]
}
}
},
Expand All @@ -41,12 +38,9 @@
"command": "cargo test --features=built-in-tools"
},
"configurations": {
"development": {
},
"development": {},
"production": {
"args": [
"--release"
]
"args": ["--release"]
}
}
},
Expand All @@ -59,11 +53,22 @@
"command": "cargo clippy"
},
"configurations": {
"development": {
},
"production": {
}
"development": {},
"production": {}
}
},
"publish": {
"dependsOn": ["build-tools"],
"executor": "nx:run-commands",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"command": "cargo publish -p shinkai_tools_runner --allow-dirty"
},
"configurations": {
"development": {},
"production": {}
}
}
}
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shinkai_protocol/source",
"version": "0.7.0",
"version": "0.7.1",
"description": "This repository serves as the ecosystem to execute Shinkai tools, provided by the Shinkai team or third-party developers, in a secure environment. It provides a sandboxed space for executing these tools, ensuring that they run safely and efficiently, while also allowing for seamless integration with Rust code.",
"main": "index.js",
"author": "",
Expand Down

0 comments on commit 45cd8e6

Please sign in to comment.