mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
@@ -2,13 +2,11 @@
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'dev'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build Docker image
|
||||
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
@@ -27,11 +25,15 @@ jobs:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
-
|
||||
name: Get short commit SHA
|
||||
id: commit_sha
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile.amd64
|
||||
push: true
|
||||
tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest,${{ secrets.REGISTRY_URL }}/west/telegram-bot:${{ github.sha }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.ref == 'refs/heads/dev' }}
|
||||
tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest,
|
||||
${{ secrets.REGISTRY_URL }}/west/telegram-bot:${{ steps.commit_sha.outputs.sha_short }}
|
||||
+7
-7
@@ -1,22 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot</AssemblyName>
|
||||
<RootNamespace>Kruzya.TelegramBot.Core</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Core' " />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AleXr64.BotFramework" Version="0.6.5-g35decc8b27" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.13">
|
||||
<PackageReference Include="AleXr64.BotFramework" Version="0.6.8-g0882b76d16" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.13" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.13" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="6.0.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Build a project
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.404-alpine3.14-amd64 AS build
|
||||
# Build a project
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0.101-alpine3.14 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# Copy project and perform restoring
|
||||
@@ -23,7 +23,7 @@ RUN dotnet publish -c release -o /app --no-restore Kruzya.TelegramBot.sln && \
|
||||
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
|
||||
|
||||
# Now reuse image with only runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0.13-alpine3.14-amd64
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0.1-alpine3.14
|
||||
WORKDIR /user
|
||||
COPY --from=build /app /app
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# Build a project
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.404-buster-slim-arm64v8 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# Copy project and perform restoring
|
||||
COPY Kruzya.TelegramBot.sln ./
|
||||
COPY ./Core/*.csproj ./Core/
|
||||
COPY ./tests/*.csproj ./tests/
|
||||
COPY ./modules/CombotAntiSpam/*.csproj ./modules/CombotAntiSpam/
|
||||
COPY ./modules/Destiny2.WhereIsXur/*.csproj ./modules/Destiny2.WhereIsXur/
|
||||
COPY ./modules/RichSiteSummary/*.csproj ./modules/RichSiteSummary/
|
||||
COPY ./modules/UrlLimitations/*.csproj ./modules/UrlLimitations/
|
||||
COPY ./modules/ChatManagement/*.csproj ./modules/ChatManagement/
|
||||
COPY ./modules/Entertainment/*.csproj ./modules/Entertainment/
|
||||
COPY ./modules/UserGroupTag/*.csproj ./modules/UserGroupTag/
|
||||
RUN dotnet restore Kruzya.TelegramBot.sln
|
||||
|
||||
# Copy all project files
|
||||
COPY . .
|
||||
RUN dotnet publish -c release -o /app --no-restore Kruzya.TelegramBot.sln && \
|
||||
mkdir /app/modules && \
|
||||
cp /app/TelegramBot.*.dll /app/modules/ && \
|
||||
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
|
||||
|
||||
# Now reuse image with only runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0.13-alpine3.14-arm64v8
|
||||
WORKDIR /user
|
||||
COPY --from=build /app /app
|
||||
|
||||
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||
|
||||
RUN apk add --no-cache cmake make musl-dev gcc gettext-dev libintl icu-libs \
|
||||
&& wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
|
||||
&& unzip musl-locales-master.zip \
|
||||
&& cd musl-locales-master \
|
||||
&& cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
|
||||
&& cd .. && rm -r musl-locales-master
|
||||
|
||||
ENV LANG ru_RU.UTF-8
|
||||
ENV LANGUAGE ru_RU.UTF-8
|
||||
ENV LC_ALL ru_RU.UTF-8
|
||||
|
||||
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.ChatManagement</AssemblyName>
|
||||
<RootNamespace>West.TelegramBot.ChatManagement</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.CombotAntiSpam</AssemblyName>
|
||||
<RootNamespace>Kruzya.TelegramBot.CombotAntiSpam</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.D2_WhereIsXur</AssemblyName>
|
||||
<RootNamespace>Kruzya.TelegramBot.Destiny2.WhereIsXur</RootNamespace>
|
||||
</PropertyGroup>
|
||||
@@ -11,8 +11,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fizzler.Systems.HtmlAgilityPack" Version="1.2.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.21" />
|
||||
<PackageReference Include="Fizzler.Systems.HtmlAgilityPack" Version="1.2.1" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.39" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.Entertainment</AssemblyName>
|
||||
<RootNamespace>West.Entertainment</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.RichSiteSummary</AssemblyName>
|
||||
<RootNamespace>Kruzya.TelegramBot.RichSiteSummary</RootNamespace>
|
||||
</PropertyGroup>
|
||||
@@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.1" />
|
||||
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.UrlLimitations</AssemblyName>
|
||||
<RootNamespace>Kruzya.TelegramBot.UrlLimitations</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>TelegramBot.UserGroupTag</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="nunit" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
<PackageReference Include="nunit" Version="3.13.2" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0-preview-20211130-02" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user