Bump to .NET 6. Add arm64 image build. Use short commit hash on image tag.

This commit is contained in:
West14
2022-01-10 00:50:05 +02:00
parent 60f6a639b6
commit 9c291892cd
12 changed files with 38 additions and 30 deletions
+13 -5
View File
@@ -2,13 +2,15 @@
on: on:
push: push:
branches:
- 'dev'
jobs: jobs:
docker: docker:
name: Build Docker image name: Build Docker image
strategy:
matrix:
arch: ['amd64', 'arm64']
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- -
@@ -27,11 +29,17 @@ jobs:
registry: ${{ secrets.REGISTRY_URL }} registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }} 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 name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: docker/Dockerfile.amd64 file: docker/Dockerfile.${{ matrix.arch }}
push: true platforms: linux/${{ matrix.arch }}
tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest,${{ secrets.REGISTRY_URL }}/west/telegram-bot:${{ github.sha }} 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
View File
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot</AssemblyName> <AssemblyName>TelegramBot</AssemblyName>
<RootNamespace>Kruzya.TelegramBot.Core</RootNamespace> <RootNamespace>Kruzya.TelegramBot.Core</RootNamespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Core' " /> <PropertyGroup Condition=" '$(RunConfiguration)' == 'Core' " />
<ItemGroup> <ItemGroup>
<PackageReference Include="AleXr64.BotFramework" Version="0.6.5-g35decc8b27" /> <PackageReference Include="AleXr64.BotFramework" Version="0.6.8-g0882b76d16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.13"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.13" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.13" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="6.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.3" /> <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+2 -2
View File
@@ -1,5 +1,5 @@
# Build a project # Build a project
FROM mcr.microsoft.com/dotnet/sdk:5.0.404-alpine3.14-amd64 AS build FROM mcr.microsoft.com/dotnet/sdk:6.0.1-alpine3.14-amd64 AS build
WORKDIR /source WORKDIR /source
# Copy project and perform restoring # 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 rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
# Now reuse image with only runtime # 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-amd64
WORKDIR /user WORKDIR /user
COPY --from=build /app /app COPY --from=build /app /app
@@ -1,5 +1,5 @@
# Build a project # Build a project
FROM mcr.microsoft.com/dotnet/sdk:5.0.404-buster-slim-arm64v8 AS build FROM mcr.microsoft.com/dotnet/sdk:6.0.1-alpine3.14-arm64v8 AS build
WORKDIR /source WORKDIR /source
# Copy project and perform restoring # 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 rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
# Now reuse image with only runtime # Now reuse image with only runtime
FROM mcr.microsoft.com/dotnet/aspnet:5.0.13-alpine3.14-arm64v8 FROM mcr.microsoft.com/dotnet/aspnet:6.0.1-alpine3.14-arm64v8
WORKDIR /user WORKDIR /user
COPY --from=build /app /app COPY --from=build /app /app
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.ChatManagement</AssemblyName> <AssemblyName>TelegramBot.ChatManagement</AssemblyName>
<RootNamespace>West.TelegramBot.ChatManagement</RootNamespace> <RootNamespace>West.TelegramBot.ChatManagement</RootNamespace>
</PropertyGroup> </PropertyGroup>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.CombotAntiSpam</AssemblyName> <AssemblyName>TelegramBot.CombotAntiSpam</AssemblyName>
<RootNamespace>Kruzya.TelegramBot.CombotAntiSpam</RootNamespace> <RootNamespace>Kruzya.TelegramBot.CombotAntiSpam</RootNamespace>
</PropertyGroup> </PropertyGroup>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.D2_WhereIsXur</AssemblyName> <AssemblyName>TelegramBot.D2_WhereIsXur</AssemblyName>
<RootNamespace>Kruzya.TelegramBot.Destiny2.WhereIsXur</RootNamespace> <RootNamespace>Kruzya.TelegramBot.Destiny2.WhereIsXur</RootNamespace>
</PropertyGroup> </PropertyGroup>
@@ -11,8 +11,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fizzler.Systems.HtmlAgilityPack" Version="1.2.0" /> <PackageReference Include="Fizzler.Systems.HtmlAgilityPack" Version="1.2.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.21" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.39" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.Entertainment</AssemblyName> <AssemblyName>TelegramBot.Entertainment</AssemblyName>
<RootNamespace>West.Entertainment</RootNamespace> <RootNamespace>West.Entertainment</RootNamespace>
</PropertyGroup> </PropertyGroup>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.RichSiteSummary</AssemblyName> <AssemblyName>TelegramBot.RichSiteSummary</AssemblyName>
<RootNamespace>Kruzya.TelegramBot.RichSiteSummary</RootNamespace> <RootNamespace>Kruzya.TelegramBot.RichSiteSummary</RootNamespace>
</PropertyGroup> </PropertyGroup>
@@ -11,7 +11,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.1" /> <PackageReference Include="CodeHollow.FeedReader" Version="1.2.2" />
</ItemGroup> </ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.UrlLimitations</AssemblyName> <AssemblyName>TelegramBot.UrlLimitations</AssemblyName>
<RootNamespace>Kruzya.TelegramBot.UrlLimitations</RootNamespace> <RootNamespace>Kruzya.TelegramBot.UrlLimitations</RootNamespace>
</PropertyGroup> </PropertyGroup>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>TelegramBot.UserGroupTag</AssemblyName> <AssemblyName>TelegramBot.UserGroupTag</AssemblyName>
</PropertyGroup> </PropertyGroup>
+4 -4
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
@@ -11,9 +11,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="nunit" Version="3.12.0" /> <PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" /> <PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0-preview-20211130-02" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>