Files
Just.Railway/.gitea/workflows/publish-nuget.yaml
JustFixMe 3030c671d2
All checks were successful
.NET Test / test (push) Successful in 1m1s
.NET Publish / publish (push) Successful in 54s
fix nuget versioning
2023-11-27 23:19:03 +04:00

35 lines
1.1 KiB
YAML

name: .NET Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: https://github.com/actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore Railway/Railway.csproj
- name: Setup nuget source
run: dotnet nuget add source --name gitea_registry https://gitea.jstdev.ru/api/packages/just/nuget/index.json
- name: Create the package
env:
RELEASE_VERSION: ${{ gitea.event.release.tag_name }}
run: dotnet pack --no-restore --configuration Release --output nupkgs Railway/Railway.csproj `sed -E 's|^(v([0-9]+(\.[0-9]+){2}))(-([a-z0-9]+)){1}|--property:ReleaseVersion=\2 --property:VersionSuffix=\5|; s|^(v([0-9]+(\.[0-9]+){2}))$|--property:ReleaseVersion=\2|'`
- name: Publish the package to Gitea
run: dotnet nuget push --source gitea_registry --api-key ${{ secrets.NUGET_PACKAGE_TOKEN }} nupkgs/*.nupkg