mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-07-08 13:04:06 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
0bba91486e | |||
207717491c | |||
f185c31a17 | |||
aeacc15439 | |||
ccf54bc279 | |||
e07f173b7c | |||
bcd869273d | |||
1ee12fa0c0 | |||
76dab182cf | |||
bacdf559c4 | |||
82a81fffb6 | |||
392669703d |
75
.github/workflows/build-push.yml
vendored
75
.github/workflows/build-push.yml
vendored
@ -11,26 +11,15 @@ jobs:
|
|||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --verbose --release
|
run: cargo build --verbose --release
|
||||||
- name: Upload Linux binary
|
- name: Upload Linux binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: desubot
|
name: desubot
|
||||||
path: ./target/release/desubot
|
path: ./target/release/desubot
|
||||||
|
|
||||||
build-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Build
|
|
||||||
run: cargo build --verbose --release
|
|
||||||
- name: Upload Windows binary
|
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
|
||||||
name: desubot.exe
|
|
||||||
path: ./target/release/desubot.exe
|
|
||||||
build-push-docker:
|
build-push-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -42,42 +31,45 @@ jobs:
|
|||||||
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
-
|
||||||
name: Login to DockerHub
|
name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
id: docker_build_latest
|
id: docker_build_latest
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ultradesu/desubot:latest
|
tags: ultradesu/desubot:latest
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
id: docker_build_tag
|
id: docker_build_tag
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ultradesu/desubot:${{ steps.branch_name.outputs.SOURCE_TAG }}
|
tags: ultradesu/desubot:${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
needs: [build-windows, build-linux]
|
needs: [build-linux]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
# - name: Checkout
|
||||||
|
# uses: actions/checkout@v4
|
||||||
- name: Get the version (git tag)
|
- name: Get the version (git tag)
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
echo ${GITHUB_REF/refs\/tags\/v/}
|
echo ${GITHUB_REF/refs\/tags\/v/}
|
||||||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
||||||
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
||||||
|
|
||||||
- name: Get the repo data (git tag)
|
- name: Get the repo data (git tag)
|
||||||
id: get_repo_data
|
id: get_repo_data
|
||||||
run: |
|
run: |
|
||||||
@ -85,40 +77,25 @@ jobs:
|
|||||||
echo ::set-output name=AUTHOR::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')
|
echo ::set-output name=AUTHOR::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')
|
||||||
echo ::set-output name=REPO_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
|
echo ::set-output name=REPO_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
- name: Prepare release downloading
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: Release ${{ github.ref }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
- name: Upload binary assets
|
|
||||||
run: |
|
run: |
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
|
|
||||||
- name: Download Linux binary
|
- name: Download Linux binary
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: desubot
|
name: desubot
|
||||||
path: ./artifacts/
|
path: ./artifacts/
|
||||||
- name: Download Windows binary
|
|
||||||
uses: actions/download-artifact@v1
|
|
||||||
with:
|
|
||||||
name: desubot.exe
|
|
||||||
path: ./artifacts/
|
|
||||||
- name: Upload binary assets
|
|
||||||
run: |
|
|
||||||
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
|
|
||||||
tar xjf linux-amd64-github-release.tar.bz2
|
|
||||||
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
|
||||||
for artifact in ./artifacts/*; do
|
|
||||||
./bin/linux/amd64/github-release upload \
|
|
||||||
-u ${{ steps.get_repo_data.outputs.AUTHOR }} \
|
|
||||||
-r ${{ steps.get_repo_data.outputs.REPO_NAME }} \
|
|
||||||
--tag ${{ steps.get_version.outputs.FULL_TAG }} \
|
|
||||||
--name ${artifact} \
|
|
||||||
--file ${artifact}
|
|
||||||
done
|
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: echo ${{ github.sha }} > Release.txt
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: cat Release.txt
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
files: './artifacts/*'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "desubot"
|
name = "desubot"
|
||||||
version = "0.5.9"
|
version = "0.5.11"
|
||||||
authors = ["AB <ab@hexor.ru>"]
|
authors = ["AB <ab@hexor.ru>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM rust:latest AS builder
|
FROM rust:bookworm AS builder
|
||||||
WORKDIR /desubot
|
WORKDIR /desubot
|
||||||
ADD ./ /desubot/
|
ADD ./ /desubot/
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM ubuntu:latest
|
FROM debian:bookworm
|
||||||
WORKDIR /storage
|
WORKDIR /storage
|
||||||
COPY --from=builder /desubot/target/release/desubot /usr/bin/
|
COPY --from=builder /desubot/target/release/desubot /usr/bin/
|
||||||
COPY mystem /usr/bin/
|
COPY mystem /usr/bin/
|
||||||
|
@ -13,7 +13,10 @@ Telegram bot with light group statistic and heavy spy features.
|
|||||||
|
|
||||||
== Important ==
|
== Important ==
|
||||||
* Desubot uses MyStem by Yandex for word stemming and assume that mystem binary is available in PATH.
|
* Desubot uses MyStem by Yandex for word stemming and assume that mystem binary is available in PATH.
|
||||||
* ubuntu deps: libssl-dev libsqlite3-dev cmake libfreetype-dev
|
* ubuntu deps: libssl-dev libsqlite3-dev cmake libfreetype-dev pkg-config
|
||||||
|
|
||||||
|
[Docker Hub](https://hub.docker.com/repository/docker/ultradesu/desubot/general)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -140,13 +140,23 @@ pub async fn handler(
|
|||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
"/markov" => {
|
"/markov" => {
|
||||||
|
if title != "PRIVATE" {
|
||||||
Markov {
|
Markov {
|
||||||
data: "".to_string(),
|
data: "".to_string(),
|
||||||
}
|
}
|
||||||
.exec(&api, &message)
|
.exec(&api, &message)
|
||||||
.await?
|
.await?
|
||||||
|
} else {
|
||||||
|
let _ = api
|
||||||
|
.send(
|
||||||
|
message
|
||||||
|
.text_reply("Allowed in groups only")
|
||||||
|
.parse_mode(ParseMode::Html),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
s if s == "/scheme" || s == "/schema" => {
|
}
|
||||||
|
"/scheme" | "/schema" => {
|
||||||
Scheme {
|
Scheme {
|
||||||
data: "".to_string(),
|
data: "".to_string(),
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user