mycroforge/.gitea/workflows/build_plugin_template.yml
mdnapo 33ba944f8a
All checks were successful
Test MycroForge.CLI / test (push) Successful in 2m23s
Updated scripts
2024-10-13 18:12:04 +02:00

34 lines
1.3 KiB
YAML

name: Build and publish MycroForge.PluginTemplate package
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.PluginTemplate package
on: [ workflow_dispatch ]
jobs:
build:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/main'
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: "Build and publish NuGet package"
run: |
# Build the NuGet package
cd MycroForge.PluginTemplate.Package
dotnet publish
dotnet pack -v m
# Add the NuGet source
dotnet nuget add source --name devdisciples \
--username ${{ secrets.NUGET_USER }} \
--password ${{ secrets.NUGET_PASS }} \
--store-password-in-clear-text \
https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json
# Set the path to the package
VERSION=$(grep '<PackageVersion>' < MycroForge.PluginTemplate.Package.csproj | sed 's/.*<PackageVersion>\(.*\)<\/PackageVersion>/\1/' | xargs)
PACKAGE="bin/Release/MycroForge.PluginTemplate.Package.$VERSION.nupkg"
# Push the package
dotnet nuget push "$PACKAGE" --source devdisciples