Skip to content

Commit e990535

Browse files
committed
dynamic versioning
1 parent 5449a6a commit e990535

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ jobs:
1919
run: dotnet restore
2020
- name: Build
2121
run: dotnet build --configuration Release --no-restore
22+
- name: Generate Version
23+
id: version
24+
shell: pwsh
25+
run: |
26+
$date = Get-Date
27+
$major = $date.Year - 2000 + 200
28+
$minor = $date.Month
29+
$build = $date.DayOfYear
30+
$revision = $date.Hour * 60 + $date.Minute
31+
$version = "$major.$minor.$build.$revision"
32+
echo "version_number=$version" >> $env:GITHUB_OUTPUT
2233
- name: Pack
23-
run: dotnet pack --configuration Release --no-build --output .
34+
run: dotnet pack --configuration Release --no-build --output . -p:Version=${{ steps.version.outputs.version_number }}
2435
- name: Push to NuGet
2536
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Version>1.0.0</Version>
4+
</PropertyGroup>
5+
</Project>

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
# ZiziBot.TelegramBot
22

3-
**ZiziBot.TelegramBot** is a bot framework for helping command-based bot development. Some samples can check in **Sample** project.
3+
[![CI](https://github.com/ZiziBot/ZiziBot.TelegramBot/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/ZiziBot/ZiziBot.TelegramBot/actions/workflows/publish.yml)
4+
[![ZiziBot.TelegramBot.Framework](https://img.shields.io/nuget/v/ZiziBot.TelegramBot.Framework.svg)](https://www.nuget.org/packages/ZiziBot.TelegramBot.Framework/)
45

5-
This framework support Polling and Webhook mode in AutoMode and enabled by default, it's mean in Local development running as Polling and after Deployment running as Webhook automatically. Fill some configuration in `appsettings.json` to started.
66

7-
This is a very early stage project, so nothing guarantee for breaking changes in the future.
7+
**ZiziBot.TelegramBot** is a bot framework designed to help with command-based bot development. Some samples can be found in the **Sample** project.
88

9-
This project is inspired by [VodemSharp/Allowed.Telegram.Bot](https://github.com/VodemSharp/Allowed.Telegram.Bot)
9+
This framework supports both Polling and Webhook modes in AutoMode, which is enabled by default. This means that during local development, it runs using Polling, and after deployment, it automatically switches to Webhook mode. Simply fill in the required configuration in `appsettings.json` to get started.
1010

11-
# Demo project
11+
Please note that this is a very early-stage project, so there are no guarantees against breaking changes in the future.
12+
13+
This project is inspired by [VodemSharp/Allowed.Telegram.Bot](https://github.com/VodemSharp/Allowed.Telegram.Bot).
14+
15+
## Demo project
1216

1317
1. [ZiziBot-Engine](https://github.com/azhe403/ZiziBot-Engine)
1418

15-
# Thanks
19+
## Thanks
1620

17-
Thanks to JetBrains have given us for
18-
<a href="https://www.jetbrains.com/?from=zizibot" target="_blank">dotUltimate</a> licenses.
21+
Thanks to JetBrains for providing us with <a href="https://www.jetbrains.com/?from=zizibot" target="_blank">dotUltimate</a> licenses.
1922

2023
<a href="https://www.jetbrains.com/?from=zizibot" target="_blank">
21-
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="Rider logo.">
22-
</a>
24+
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains logo." width="200">
25+
</a>

0 commit comments

Comments
 (0)