added release pipeline
This commit is contained in:
38
.gitea/workflows/publish-nuget.yaml
Normal file
38
.gitea/workflows/publish-nuget.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: .NET Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
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
|
||||||
|
source-url: https://gitea.example.com/api/packages/just/nuget/index.json
|
||||||
|
env:
|
||||||
|
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_PACKAGE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore Railway/Railway.csproj
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --no-restore --configuration Release Railway/Railway.csproj
|
||||||
|
|
||||||
|
- name: Create the package
|
||||||
|
env:
|
||||||
|
RELEASE_VERSION: ${{ gitea.event.release.tag_name }}
|
||||||
|
run: dotnet pack --no-build --configuration Release --output nupkgs Railway/Railway.csproj `echo $RELEASE_VERSION | 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
|
||||||
|
run: dotnet nuget push nupkgs/*.nupkg
|
||||||
|
|
||||||
@@ -3,11 +3,15 @@ name: .NET Test
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
paths-ignore:
|
||||||
|
- 'README.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user