From 45dab968221976d915fabf5ea279e6078cfe9591 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Wed, 20 Oct 2021 17:17:08 +0200 Subject: prepare for release on crates.io --- .gitlab-ci.yml | 6 ++++-- Cargo.toml | 11 +++++++++++ LICENSE | 6 ++++++ README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ README.org | 35 ----------------------------------- src/main.rs | 4 ++-- 6 files changed, 65 insertions(+), 39 deletions(-) create mode 100644 LICENSE create mode 100644 README.md delete mode 100644 README.org diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f862e2..409afdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,11 +2,13 @@ include: - project: "cocainefarm/templates/ci" file: "/rust.yaml" - rules: - - if: $CI_COMMIT_TAG == null - project: "cocainefarm/templates/ci" file: "/tanka.base.yaml" +variables: + RUST_RELEASE: "true" + RUST_RELEASE_CRATESIO: "true" + workflow: rules: - if: $CI_MERGE_REQUEST_IID diff --git a/Cargo.toml b/Cargo.toml index da941b2..674efa1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,17 @@ version = "1.6.1" authors = ["Max Audron "] edition = "2018" +license = "ISC" +license-file = "LICENSE" +description = "High Level IRC Bot library and instance" +homepage = "https://gitlab.com/cocainefarm/gnulag/catinator" +repository = "https://gitlab.com/cocainefarm/gnulag/catinator" +documentation = "https://docs.rs/catinator" +readme = "README.md" +keywords = ["irc", "bot", "async"] + +exclude = ["deploy", ".cache"] + [dependencies] macros = { package = "catinator_macros", version = "0", path = "./macros" } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ac351ff --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ +Copyright 2021 Max Audron +Copyright 2021 Lorenz Leitner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9f0632b --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# catinator + +catinator is an irc bot made by and for the `#gnulag` channel on snoonet. It +also tries to be usable as a general purpose higher level IRC bot making +library, based on the [irc crate](https://docs.rs/irc). + +## Configuration + +The main configuration file is [config.toml](file:config.toml) and gets loaded +from the current `$PWD`. The configuration file is using profiles, the `default` +profile is loaded as a base. If the binary is compiled in release mode the +`release` profile is merged. You can override any variables from `default` +profile in the `release` or `debug` profile. If the binary is compiled in debug +mode the `debug` profile is loaded from +[config.debug.toml](file:config.debug.toml). + +All of the settings can also be set using environment variables. The options are +prefixed with `CATINATOR_`, nested variables are sepperated by `_`. + +Common environment variables: + +- `CATINATOR_USER_PASSWORD` +- `CATINATOR_WA_API_KEY` + +## Developing & Running + +```shell +# Compile binary +$ cargo build + +# Run catinator +$ cargo run + +# Run tests +$ cargo test +``` + +## Logging + +you can change the log level by setting the `RUST_LOG` environment variable. +Available levels are in decreasing verbosity: `trace`, `debug`, `info`, `warn`, +`error` diff --git a/README.org b/README.org deleted file mode 100644 index a3aed5c..0000000 --- a/README.org +++ /dev/null @@ -1,35 +0,0 @@ -#+TITLE: catinator - -catinator is an irc bot made by and for the ~#gnulag~ channel on snoonet. It also tries to be usable as a general purpose higher level IRC bot making library, based on the [[https://docs.rs/irc][irc crate]]. - -* Configuration -The main configuration file is [[file:config.toml][config.toml]] and gets loaded from the current -~$PWD~. The configuration file is using profiles, the ~default~ profile is -loaded as a base. If the binary is compiled in release mode the ~release~ -profile is merged. You can override any variables from ~default~ profile in the -~release~ or ~debug~ profile. If the binary is compiled in debug mode the -~debug~ profile is loaded from [[file:config.debug.toml][config.debug.toml]]. - -All of the settings can also be set using environment variables. The options are -prefixed with ~CATINATOR_~, nested variables are sepperated by ~_~. - -Common environment variables: -- ~CATINATOR_USER_PASSWORD~ -- ~CATINATOR_WA_API_KEY~ - -* Developing & Running -#+begin_src shell -# Compile binary -$ cargo build - -# Run catinator -$ cargo run - -# Run tests -$ cargo test -#+end_src - -** Logging -you can change the log level by setting the ~RUST_LOG~ environment variable. -Available levels are in decreasing verbosity: ~trace~, ~debug~, ~info~, ~warn~, -~error~ diff --git a/src/main.rs b/src/main.rs index f5f0e84..747948e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ #[tokio::main] async fn main() { - use catinator::catinator; + use catinator::{catinator}; tracing_subscriber::fmt::init(); - let mut bot = Bot::new().await.unwrap(); + let mut bot = catinator::Bot::new().await.unwrap(); let mut sed = catinator::hooks::sed::Sed::new(); let wolfram_alpha = catinator::hooks::wolfram_alpha::WolframAlpha::new(&bot) -- cgit v1.2.3