diff --git a/.github/workflows/dotnetcore-build-publish.yml b/.github/workflows/dotnetcore-build-publish.yml index c45e677..d1b20da 100644 --- a/.github/workflows/dotnetcore-build-publish.yml +++ b/.github/workflows/dotnetcore-build-publish.yml @@ -10,24 +10,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Get tag version id: get_version - run: echo ::set-env name=TAG_NAME::$(echo ${GITHUB_REF/refs\/tags\//}) - - name: Setup .NET Core SDK + run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.0.100 + dotnet-version: 5.0.400 - name: Build .NET Core App run: dotnet publish dotnet-app/APIL/WordCounterBot.APIL.WebApi.csproj -c Release -o ./app - name: Build & Publish Docker image if: success() - uses: opspresso/action-docker@v0.2.1 + uses: opspresso/action-docker@v0.2.17 env: USERNAME: ${{ secrets.DOCKER_USERNAME }} PASSWORD: ${{ secrets.DOCKER_PASSWORD }} IMAGE_NAME: "admiralwoop/multi-purpose-tg-bot" LATEST: "true" - - name: Notify MicroBadger - if: success() - run: curl -X POST https://hooks.microbadger.com/images/admiralwoop/multi-purpose-tg-bot/LPihsqNbWfnJYRdtST6fL5NyRmc= diff --git a/.github/workflows/dotnetcore-test-build.yml b/.github/workflows/dotnetcore-test-build.yml index e840087..f8ce1b6 100644 --- a/.github/workflows/dotnetcore-test-build.yml +++ b/.github/workflows/dotnetcore-test-build.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Setup .NET Core SDK + - uses: actions/checkout@v2 + - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.0.100 + dotnet-version: 5.0.400 - name: Build API layer run: dotnet build dotnet-app/APIL/WordCounterBot.APIL.WebApi.csproj -c Release -o ./app diff --git a/Dockerfile b/Dockerfile index 0de5ea2..7979e5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim +FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim WORKDIR /app COPY /app . -ENTRYPOINT ["dotnet", "WordCounterBot.APIL.WebApi.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "WordCounterBot.APIL.WebApi.dll"] diff --git a/Dockerfile.with-build b/Dockerfile.with-build index e4dc760..0a37017 100644 --- a/Dockerfile.with-build +++ b/Dockerfile.with-build @@ -1,7 +1,7 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ["dotnet-app/APIL/WordCounterBot.APIL.WebApi.csproj", "APIL/"] COPY ["dotnet-app/BLL/WordCounterBot.BLL.Core/WordCounterBot.BLL.Core.csproj", "BLL/WordCounterBot.BLL.Core/"] @@ -20,4 +20,4 @@ RUN dotnet publish "WordCounterBot.APIL.WebApi.csproj" -c Release -o /app/publis FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "WordCounterBot.APIL.WebApi.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "WordCounterBot.APIL.WebApi.dll"] diff --git a/README.md b/README.md index 19f9736..1c7f551 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ Multi-purpose Telegram Bot ====== ![](https://img.shields.io/github/v/release/admiralwoop/multi-purpose-tg-bot?include_prereleases&sort=semver) +[![](https://img.shields.io/badge/docker%20hub-099cec)](https://hub.docker.com/r/admiralwoop/multi-purpose-tg-bot) + ![](https://img.shields.io/github/last-commit/admiralWoop/multi-purpose-tg-bot/master) [![](https://www.codefactor.io/repository/github/admiralwoop/multi-purpose-tg-bot/badge)](https://www.codefactor.io/repository/github/admiralwoop/multi-purpose-tg-bot) -[![](https://images.microbadger.com/badges/version/admiralwoop/multi-purpose-tg-bot.svg)](https://microbadger.com/images/admiralwoop/multi-purpose-tg-bot) -[![](https://img.shields.io/badge/docker%20hub-099cec)](https://hub.docker.com/r/admiralwoop/multi-purpose-tg-bot) +**Multi-purpose Telegram Bot** is a telegram bot based on ASP.NET Core & [Telegram.Bot](https://github.com/TelegramBots/Telegram.Bot). -**Multi-purpose Telegram Bot** is a telegram bot inside a ASP.NET Core app. +The main idea of this bot is use of filter-handler architecture similar to ASP.NET routes and controllers. -The main idea of this bot is use of a architecture where bot uses filters and corresponding handlers to handle updates received from Telegram. +That way you don't need to put all your logic in a single controller. -That way you don't need to have single handler that handles all kinds of messages. -What you have is **the** router and many filters that decide what handler will handle new received message. Thus handlers have only one responsibility - get some information from a message and do something with it. +What you have is a single router and many filters that decide what handler will with a received message. Thus handlers have only one responsibility - get some information from the message and do something based on that info. ### Third party libraries * [Telegram.Bot library](https://github.com/TelegramBots/Telegram.Bot)