Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6faeaa5
update Build.props if exist
azhe403 Nov 11, 2022
593d348
update nightly build workflow
azhe403 Nov 11, 2022
dce2af6
update Build.props file
azhe403 Nov 11, 2022
1c86225
update nightly build workflow
azhe403 Nov 11, 2022
ad91359
update tool cli
azhe403 Nov 11, 2022
8a039ee
check null
azhe403 Nov 11, 2022
f68596a
update nightly build workflow
azhe403 Nov 11, 2022
86325d7
update to .net7.0
azhe403 Nov 14, 2022
b62ee75
update nuget packages
azhe403 Nov 14, 2022
32ce192
update workflow sdk version
azhe403 Nov 14, 2022
e10360f
fix build
azhe403 Nov 14, 2022
e66ba1e
fix build (2)
azhe403 Nov 14, 2022
748e584
fix release assets?
azhe403 Nov 14, 2022
53954a3
auto delete jobs if fails
azhe403 Nov 14, 2022
4dc3be3
use new style root Program.cs
azhe403 Nov 16, 2022
dea4343
set serilog context with config
azhe403 Nov 20, 2022
7b7d2ca
comment
azhe403 Nov 20, 2022
6ef0ac2
update StartupTaskHostExtensions.cs
azhe403 Nov 20, 2022
d845280
update workflow dev build
azhe403 Nov 20, 2022
f2561bd
add version update mode
azhe403 Nov 20, 2022
6ff6630
adjust cache key
azhe403 Nov 21, 2022
55221f8
reply to message
azhe403 Nov 24, 2022
e1e6938
fix schedule delete
azhe403 Nov 24, 2022
e3b12f8
set topic id by name
azhe403 Nov 26, 2022
6c6e6f0
fix check topic in Chat
azhe403 Nov 27, 2022
2020562
global config for disable cache
azhe403 Nov 27, 2022
3621634
move hangfire server & config
azhe403 Nov 27, 2022
662635e
update CacheConfig.cs
azhe403 Nov 27, 2022
835243b
update nuget packages
azhe403 Nov 27, 2022
33f44bb
remove unused file
azhe403 Nov 27, 2022
6680b0b
update ChatService.cs
azhe403 Nov 27, 2022
72cd23a
update GlobalUsings.cs
azhe403 Nov 27, 2022
0286e55
fix other error
azhe403 Nov 27, 2022
d7d64dd
send welcome to topic
azhe403 Nov 27, 2022
cba5925
caching new settings
azhe403 Nov 27, 2022
4dbf972
adjust cache key
azhe403 Nov 27, 2022
c8e58a3
adjust cache key
azhe403 Dec 2, 2022
25f93e1
add gitpod config
azhe403 Dec 15, 2022
e1e04ee
Bump LiteDB from 5.0.12 to 5.0.13 in /src/WinTenDev.ZiziBot.AppHost
dependabot[bot] Feb 24, 2023
5bdac58
Bump LiteDB from 5.0.12 to 5.0.13 in /src/WinTenDev.ZiziMirror.AppHost
dependabot[bot] Feb 24, 2023
c07a00a
Merge pull request #40 from WinTenDev/dependabot/nuget/src/WinTenDev.…
azhe403 Jul 12, 2023
14b51f2
Merge pull request #41 from WinTenDev/dependabot/nuget/src/WinTenDev.…
azhe403 Jul 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 62 additions & 130 deletions .github/workflows/zizibot-dev-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Zizi Bot Nightly
name: Zizi Bot Nightly Build

on:
push:
Expand All @@ -7,73 +7,9 @@ on:
branches: [ main ]

jobs:
# zizibot-fd-build:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: /home/runner/work/ZiziBot.NET/ZiziBot.NET

# steps:
# - uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
#
# - name: Preparing Environment
# run:
# dotnet tool install --global dotnet-zip &&
# dotnet zip install
#
# - name: Install dependencies
# run: dotnet restore WinTenDev.ZiziBot.sln
#
# - name: Update Project version
# run: dotnet run --project src/WinTenDev.ZiziTools.Cli
#
# - uses: kzrnm/get-net-sdk-project-versions-action@v1
# id: get-version
# with:
# proj-path: src/WinTenDev.ZiziTools.Cli/WinTenDev.ZiziTools.Cli.csproj
#
# - name: Print version
# run: echo "${{steps.get-version.outputs.version}}"
#
# - name: Creating Linux-x64 package
# run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r linux-x64 -c Release --self-contained=false /t:CreateZip
#
# - name: Creating Win-x64 package
# run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r win-x64 -c Release --self-contained=false /t:CreateZip
#
# - name: Creating Osx-x64 package
# run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r osx-x64 -c Release --self-contained=false /t:CreateZip
#
# - name: Create Release Asset
# uses: softprops/action-gh-release@v1
# with:
# name: "Zizi Bot {{steps.get-version.outputs.version}}"
# tag_name: "v${{steps.get-version.outputs.version}}"
# files: |
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/linux-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/osx-x64/*.zip
# draft: true
# prerelease: true
# env:
# GITHUB_TOKEN: ${{ secrets.GH_PAT }}

# - name: Uploading Artifacs
# uses: actions/upload-artifact@v2
# with:
# name: ZiziBot FD Build
# path: |
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/linux-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/osx-x64/*.zip


zizibot-sf-build:
name: Zizi Bot SF Nightly Build
name: Zizi Bot Nightly Build
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -82,9 +18,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Preparing Environment
run:
Expand All @@ -96,87 +32,83 @@ jobs:
run: dotnet restore WinTenDev.ZiziBot.sln

- name: Update Project version
run: dotnet run --project src/WinTenDev.ZiziTools.Cli
run: dotnet run --project src/WinTenDev.ZiziTools.Cli --toolName UpdateVersion --mode RootAndAllProjects

- name: Getting Project Version
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: src/WinTenDev.ZiziTools.Cli/WinTenDev.ZiziTools.Cli.csproj
proj-path: Directory.Build.props

- name: Creating Linux-x64 package
- name: Creating ZiziBot Linux-x64 package
run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r linux-x64 -c Release --self-contained=false /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /t:CreateZip

- name: Creating Win-x64 package
- name: Creating ZiziBot Win-x64 package
run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r win-x64 -c Release --self-contained=false /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /t:CreateZip

- name: Creating Osx-x64 package
- name: Creating ZiziBot Osx-x64 package
run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r osx-x64 -c Release --self-contained=false /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /t:CreateZip

- name: Publishing ZiziBot for Linux Server
run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r linux-x64 -c Release --self-contained=false /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o build/zizi-beta

- name: Send notify to Telegram before deployment
uses: appleboy/telegram-action@v0.1.1
with:
# telegram user
to: ${{ secrets.TG_LOG_CHAT_ID }}
# telegram token
token: ${{ secrets.TG_DEV_BOT_TOKEN }}
# telegram message
message: |
Zizi Beta entering Maintenance Mode
# disables link previews for links in this message
disable_web_page_preview: true

- name: ssh-scp-ssh-pipelines
# You may pin to the exact commit or the version.
# uses: cross-the-world/ssh-scp-ssh-pipelines@78e864b4890087a58248ff39320406971ca88b89
uses: cross-the-world/ssh-scp-ssh-pipelines@v1.1.4
with:
# ssh remote host
host: ${{ secrets.VPS_HOST }}
# ssh remote user
user: ${{ secrets.VPS_USER }}
# ssh remote password
pass: ${{ secrets.VPS_PASS }}
# execute pre-commands before scp
first_ssh: ${{ secrets.CMD_STOP_ZIZIBETA }}
# scp from local to remote
scp: |
build/zizi-beta/* => ${{ secrets.VPS_REMOTE_DIR }}
# execute post-commands after scp
last_ssh: ${{ secrets.CMD_START_ZIZIBETA }}

- name: Send notify to Telegram after deployment
uses: appleboy/telegram-action@v0.1.1
with:
# telegram user
to: ${{ secrets.TG_LOG_CHAT_ID }}
# telegram token
token: ${{ secrets.TG_DEV_BOT_TOKEN }}
# telegram message
message: |
Zizi Beta Deployment success
Repo: ${{ github.repository }}
Changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
# disables link previews for links in this message
disable_web_page_preview: true

- name: Create Release Assets
uses: softprops/action-gh-release@v1
with:
name: "Zizi Bot ${{steps.get-version.outputs.version}}"
tag_name: "v${{steps.get-version.outputs.version}}"
files: |
src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/linux-x64/*.zip
src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/*.zip
src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/osx-x64/*.zip
src/WinTenDev.ZiziBot.AppHost/bin/Release/net*/linux-x64/*.zip
src/WinTenDev.ZiziBot.AppHost/bin/Release/net*/win-x64/*.zip
src/WinTenDev.ZiziBot.AppHost/bin/Release/net*/osx-x64/*.zip
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

# - name: Uploading Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ZiziBot SF Build
# path: |
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/linux-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/*.zip
# src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/osx-x64/*.zip

# zizibot-win64-fd-build:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: /home/runner/work/ZiziBot.NET/ZiziBot.NET
#
# steps:
# - uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
# - name: Install dependencies
# run: dotnet restore WinTenDev.ZiziBot.sln
# - name: Win64 FD Build
# run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r win-x64 -c Release --self-contained=false
# - name: Upload Win64 FD Artifacs
# uses: actions/upload-artifact@v2
# with:
# name: zizibot-win64-fd-build
# path: src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/publish

# zizibot-win64-sf-build:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: /home/runner/work/ZiziBot.NET/ZiziBot.NET
#
# steps:
# - uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
# - name: Install dependencies
# run: dotnet restore WinTenDev.ZiziBot.sln
#
# - name: Win64 FD Single-File Build
# run: dotnet publish src/WinTenDev.ZiziBot.AppHost -r win-x64 -c Release --self-contained=false /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
# - name: Upload Win64 SF Artifacs
# uses: actions/upload-artifact@v2
# with:
# name: zizibot-win64-sf-build
# path: src/WinTenDev.ZiziBot.AppHost/bin/Release/net6.0/win-x64/publish
1 change: 1 addition & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM gitpod/workspace-dotnet:latest
15 changes: 15 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
image:
file: .gitpod.Dockerfile

tasks:
- name: Restore & Build
init: |
dotnet dev-certs https
dotnet restore
dotnet build
- name: Run
command: dotnet run

vscode:
extensions:
- muhammad-sammy.csharp
6 changes: 2 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<ItemGroup Condition=" '$(Configuration)' == 'Release'">
<AssemblyAttribute Include="WinTenDev.Zizi.Models.Attributes.BuildDateAttribute">
<_Parameter1>$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss"))</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
</Project>
7 changes: 7 additions & 0 deletions WinTenDev.ZiziBot.sln
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7 - Dashboard", "7 - Dashbo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinTenDev.ZiziBot.Alpha4", "src\WinTenDev.ZiziBot.Alpha4\WinTenDev.ZiziBot.Alpha4.csproj", "{628F8C38-ACEF-4E37-8609-97AEF8134FB3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinTenDev.Zizi.Hangfire", "src\WinTenDev.Zizi.Hangfire\WinTenDev.Zizi.Hangfire.csproj", "{57AF737C-AB8E-414C-8D3C-753F638FF49A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -108,6 +110,10 @@ Global
{628F8C38-ACEF-4E37-8609-97AEF8134FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{628F8C38-ACEF-4E37-8609-97AEF8134FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{628F8C38-ACEF-4E37-8609-97AEF8134FB3}.Release|Any CPU.Build.0 = Release|Any CPU
{57AF737C-AB8E-414C-8D3C-753F638FF49A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57AF737C-AB8E-414C-8D3C-753F638FF49A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57AF737C-AB8E-414C-8D3C-753F638FF49A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57AF737C-AB8E-414C-8D3C-753F638FF49A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -126,6 +132,7 @@ Global
{9A7D4E70-3CEF-4C20-80EF-AAF8E6FD3E79} = {4D3C448F-B4CB-4622-93CC-23140D616ED2}
{CDD94700-0207-42EB-8C91-A50A2650EB63} = {470FE321-069C-4E10-987E-2D6BAB9D5875}
{628F8C38-ACEF-4E37-8609-97AEF8134FB3} = {4D3C448F-B4CB-4622-93CC-23140D616ED2}
{57AF737C-AB8E-414C-8D3C-753F638FF49A} = {F51169C8-34B3-474D-9400-BAF8BEB9D206}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AFE8345E-016B-4B6D-A95A-3D62AEF8BA8A}
Expand Down
14 changes: 7 additions & 7 deletions src/WinTenDev.Zizi.DbMigrations/Extensions/ContextsExtension.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using WinTenDev.Zizi.DbMigrations.EfMigrations;
using WinTenDev.Zizi.Utils;
Expand All @@ -8,13 +7,14 @@ namespace WinTenDev.Zizi.DbMigrations.Extensions;

public static class ContextsExtension
{
public static IServiceCollection AddDbContexts(this IServiceCollection services, string connStr)
public static IServiceCollection AddDbContexts(this IServiceCollection services,
string connStr)
{
services.AddDbContextPool<BlockListContext>(options =>
options.UseMySql(connStr, ServerVersion.AutoDetect(connStr))
.EnableDetailedErrors()
.EnableSensitiveDataLogging()
);
// services.AddDbContextPool<BlockListContext>(options =>
// options.UseMySql(connStr, ServerVersion.AutoDetect(connStr))
// .EnableDetailedErrors()
// .EnableSensitiveDataLogging()
// );


return services;
Expand Down
35 changes: 17 additions & 18 deletions src/WinTenDev.Zizi.DbMigrations/WinTenDev.Zizi.DbMigrations.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentMigrator.Runner" Version="3.3.2" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.48.0.56517">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WinTenDev.Zizi.Models\WinTenDev.Zizi.Models.csproj" />
<ProjectReference Include="..\WinTenDev.Zizi.Utils\WinTenDev.Zizi.Utils.csproj" />
</ItemGroup>
<PackageReference Include="FluentMigrator.Runner" Version="3.3.2"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0"/>
<PackageReference Include="SerilogAnalyzer" Version="0.15.0"/>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.49.0.57237">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WinTenDev.Zizi.Models\WinTenDev.Zizi.Models.csproj"/>
<ProjectReference Include="..\WinTenDev.Zizi.Utils\WinTenDev.Zizi.Utils.csproj"/>
</ItemGroup>
</Project>
Loading