Добавлена сборка
This commit is contained in:
39
.gitea/workflows/ci.yaml
Normal file
39
.gitea/workflows/ci.yaml
Normal 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
|
||||
57
.gitea/workflows/release-package.yaml
Normal file
57
.gitea/workflows/release-package.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
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: 10.0.x
|
||||
|
||||
- name: Set version from tag
|
||||
id: version
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME#v}"
|
||||
echo "PACKAGE_VERSION=$TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Replace ProjectReference with PackageReference
|
||||
run: |
|
||||
sed -i "s#<ProjectReference Include=\"..\/YandexMusic.API\/YandexMusic.API.csproj\" />#<PackageReference Include=\"YandexMusic.API\" Version=\"${{ steps.version.outputs.PACKAGE_VERSION }}\" />#" YandexMusic/YandexMusic.csproj
|
||||
|
||||
- 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: |
|
||||
YandexMusic.API
|
||||
YandexMusic
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user