ci
All checks were successful
CI / build-test (push) Successful in 44s
Release / pack-and-publish (release) Successful in 36s

This commit is contained in:
2025-12-02 16:03:27 +03:00
parent 7f69eab545
commit f74d4034cd
5 changed files with 129 additions and 0 deletions

39
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,39 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Restore BotPages
run: dotnet restore BotPages
- name: Build BotPages
run: dotnet build BotPages --no-restore -c Release
- name: Test BotPages
run: dotnet test BotPages --no-build -c Release --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
**/TestResults/*.trx
**/TestResults/*/coverage.cobertura.xml

View File

@@ -0,0 +1,54 @@
name: Release
on:
release:
types: [published]
jobs:
pack-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set version from tag
id: version
run: |
TAG="${GITHUB_REF_NAME#v}"
echo "PACKAGE_VERSION=$TAG" >> $GITHUB_OUTPUT
- name: Build and Pack projects
run: |
mkdir -p artifacts
for proj in $PROJECTS; do
echo "Restoring $proj..."
dotnet restore $proj
echo "Building $proj..."
dotnet build $proj -c Release -p:Version=${{ steps.version.outputs.PACKAGE_VERSION }}
echo "Packing $proj..."
dotnet pack $proj -c Release --no-build -p:PackageVersion=${{ steps.version.outputs.PACKAGE_VERSION }} -o ./artifacts
done
env:
PROJECTS: |
BotPages.Core
BotPages.Telegram
BotPages
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: artifacts/*.nupkg
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./artifacts/*.nupkg --source https://git.frigat.duckdns.org/api/packages/FrigaT/nuget/index.json --api-key $NUGET_API_KEY --skip-duplicate

View File

@@ -1,4 +1,7 @@
<Solution>
<Folder Name="/Элементы решения/">
<File Path="README.md" />
</Folder>
<Project Path="BotPages.Core/BotPages.Core.csproj" />
<Project Path="BotPages.Telegram/BotPages.Telegram.csproj" />
<Project Path="BotPages/BotPages.csproj" />

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12
nuget.config Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Gitea_FrigaT" value="https://git.frigat.duckdns.org/api/packages/FrigaT/nuget/index.json" />
</packageSources>
<packageSourceCredentials>
<GiteaFeed>
<add key="Username" value="FrigaT" />
<add key="ClearTextPassword" value="e5a0d9cc9684bbb4bf8d3f12fd2d0b43f9b0f336" />
</GiteaFeed>
</packageSourceCredentials>
</configuration>