Skip to content

Commit

Permalink
feat: add macos target and publish binaries
Browse files Browse the repository at this point in the history
- create and test builds for linux + macos
- publish built csml_server binaries to release
  • Loading branch information
frsechet committed Oct 13, 2020
1 parent a69a494 commit ca9a958
Showing 10 changed files with 185 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ Fixes #

## Proposed Changes

-
-
-
-
-
-
55 changes: 55 additions & 0 deletions .github/workflows/bin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish binaries

on:
release:
types: [published]

jobs:
publish:

runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: 10.11
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
asset_name: csml-server-linux-amd64
- os: macos-latest
asset_name: csml-server-macos-amd64

steps:
- uses: actions/checkout@v2

# for some reason cache does not work properly with macos builds
- name: Cache Cargo
if: matrix.os != 'macos-latest'
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-csml-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Server
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --manifest-path=csml_server/Cargo.toml --features csml_engine/mongo,csml_engine/dynamo --release

- name: Upload binary to release
uses: svenstaro/upload-release-action@2.2.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/csml_server
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
47 changes: 47 additions & 0 deletions .github/workflows/cratesio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish crates.io

on:
release:
types: [published]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-csml-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Login
run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

- name: Publish interpreter
run: cargo publish --manifest-path csml_interpreter/Cargo.toml --all-features

# crates.io may say that the interpreter is not available
# if we don't wait before we build the engine
- name: Sleep
uses: jakejarvis/wait-action@master
with:
time: '60s'

- name: Publish engine
run: cargo publish --manifest-path csml_engine/Cargo.toml --all-features

38 changes: 34 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -9,11 +9,41 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: 10.11
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2

# for some reason cache does not work properly with macos builds
- name: Cache Cargo
if: matrix.os != 'macos-latest'
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-csml-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --manifest-path=csml_interpreter/Cargo.toml

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --manifest-path=csml_interpreter/Cargo.toml
8 changes: 4 additions & 4 deletions Cargo.lock

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

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -118,6 +118,14 @@ DISABLE_SSL_VERIFY=false
DEBUG=true
```
### Using a ready-to-use binary (Linux and MacOS only)
The easiest way to launch a CSML Engine on your own machine is to use one of our pre-built, optimized binaries (available for both MongoDB and Amazon DynamoDB). These binaries are available as executables on each of CSML's releases since v1.3.0.
To download the latest CSML Server binaries, [head over to the latest release](https://github.com/CSML-by-Clevy/csml-engine/releases/download/v1.2.1/csml-server-linux-amd64) and make sure to download the right version for your architecture.
**Mac users**: upon first execution of this binary, Mac will probably open a warning about the application not being signed ([more info from Apple](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution)). As this is not intended as a widely-distributed application, we decided to not go through the notarization process for now, but you can safely ignore that warning! However, if you prefer, you can always [build this package from source](#with-rust-from-source).
### With Docker
We provide a docker image for easy self-hosted usage.
@@ -130,7 +138,7 @@ To get started with CSML Engine on Docker: https://github.com/CSML-by-Clevy/csml
### With Rust, from source
CSML is built in [Rust](https://www.rust-lang.org/). You don't need to know any Rust to run it though! Make sure you are running Rust v1.46, then run:
CSML is built in [Rust](https://www.rust-lang.org/). You don't need to know any Rust to run it though! Make sure you are running Rust v1.46+ and that you have openssl installed on your machine (or an equivalent for your linux distribution, such as libssl), then run:
```
cd csml_server
2 changes: 1 addition & 1 deletion bindings/node/native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "csml_engine_node"
version = "1.2.1"
version = "1.3.0-beta1"
authors = ["Alexis Merelo <alexis.merelo@clevy.io>"]
license = "MIT"
build = "build.rs"
22 changes: 19 additions & 3 deletions csml_engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
[package]
name = "csml_engine"
version = "1.2.1"
authors = ["Alexis Merelo <alexis.merelo@clevy.io>"]
version = "1.3.0-beta1"
authors = [
"Alexis Merelo <alexis.merelo@clevy.io>",
"François Falala-Sechet <francois@clevy.io>",
"Bastien Botella <bastien@clevy.io>",
"Jefferson Le Quellec <jefferson.le-quellec@clevy.io>"
]
description = """
The CSML Engine is a conversational engine designed to make it extremely easy to create rich and powerful chatbots.
"""
homepage = "https://www.csml.dev"
repository = "https://github.com/CSML-by-Clevy/csml-engine"
keywords = ["chatbot", "programming-language", "csml"]
categories = ["text-processing"]
readme = "../README.md"
license = "Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
features = ["--no-deps"]

[features]
mongo = ["mongodb", "bson"]
dynamo = ["rusoto_core", "rusoto_dynamodb", "serde_dynamodb"]
@@ -37,7 +53,7 @@ features = ["rustls"]
optional = true

[dependencies]
csml_interpreter = { path = "../csml_interpreter" }
csml_interpreter = { version = "1.3.0-beta1", path = "../csml_interpreter" }
multimap = "0.8.1"
md-5 = "0.8.0"
chrono = "0.4"
22 changes: 12 additions & 10 deletions csml_interpreter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
[package]
name = "csml_interpreter"
version = "1.2.1"
version = "1.3.0-beta1"
authors = [
"Alexis Merelo <alexis.merelo@clevy.io>",
"Jefferson Le Quellec <jefferson.le-quellec@clevy.io>",
"François Falala-Sechet <francois@clevy.io>",
"Bastien Botella <bastien@clevy.io>"
"Bastien Botella <bastien@clevy.io>",
"Jefferson Le Quellec <jefferson.le-quellec@clevy.io>"
]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/CSML-by-Clevy/csml-interpreter"
homepage = "https://www.csml.dev/"
documentation = "https://docs.csml.dev/language/"
description = """
The CSML (Conversational Standard Meta Language) is a Domain-Specific Language developed for creating conversational experiences easily.
The CSML Interpreter is the official interpreter for the CSML programming language, a DSL designed to make it extremely easy to create rich and powerful chatbots.
"""
keywords = ["chatbot", "interpreter", "language", "csml"]
homepage = "https://www.csml.dev"
repository = "https://github.com/CSML-by-Clevy/csml-engine"
keywords = ["chatbot", "programming-language", "csml"]
categories = ["text-processing"]
readme = "README.md"
license = "Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
features = ["--no-deps"]

[lib]
name = "csml_interpreter"
crate-type = ["rlib"]
2 changes: 1 addition & 1 deletion csml_server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "csml_server"
version = "1.2.1"
version = "1.3.0-beta1"
authors = ["François Falala-Sechet <francois@clevy.io>"]
edition = "2018"

0 comments on commit ca9a958

Please sign in to comment.