migration
This commit is contained in:
92
.gitea/workflows/build_publish.yml
Normal file
92
.gitea/workflows/build_publish.yml
Normal file
@@ -0,0 +1,92 @@
|
||||
name: Build and publish package
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- "main"
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
paths:
|
||||
- "TimetableDesigner.Backend.Events**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore
|
||||
version:
|
||||
name: Determine version
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
- name: Setup GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v4.2.0
|
||||
with:
|
||||
versionSpec: 6.4.x
|
||||
- name: Determine version
|
||||
uses: gittools/actions/gitversion/execute@v4.2.0
|
||||
id: gitversion
|
||||
with:
|
||||
configFilePath: ./.gitea/config/gitversion.yml
|
||||
outputs:
|
||||
version: ${{ steps.gitversion.outputs.SemVer }}
|
||||
pack:
|
||||
name: Pack
|
||||
needs: version
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
- name: Create NuGet package
|
||||
run: dotnet pack -c Release -p:Version=${{needs.version.outputs.version}} -p:PackageVersion=${{needs.version.outputs.version}} --output ./
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: nuget
|
||||
path: ./TimetableDesigner.Backend.Events.${{needs.version.outputs.version}}.nupkg
|
||||
outputs:
|
||||
version: ${{needs.version.outputs.version}}
|
||||
publish:
|
||||
name: Publish
|
||||
needs: pack
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: nuget
|
||||
path: ./
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
- name: Add package source
|
||||
run: dotnet nuget add source --name gitea --username TimetableDesigner --password ${{ secrets.GITHUB_TOKEN }} https://gitea.example.com/api/packages/TimetableDesigner/nuget/index.json
|
||||
- name: Publish
|
||||
run: dotnet nuget push --source gitea ./TimetableDesigner.Backend.Events.${{needs.pack.outputs.version}}.nupkg
|
||||
- name: Create Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
tag_name: ${{needs.pack.outputs.version}}
|
||||
name: ${{needs.pack.outputs.version}}
|
||||
files: |-
|
||||
TimetableDesigner.Backend.Events.${{needs.pack.outputs.version}}.nupkg
|
||||
Reference in New Issue
Block a user