mycroforge/.gitea/workflows/build.yml
mdnapo 5c7d07afb0
All checks were successful
Build and publish MycroForge.CLI / test (push) Successful in 41s
Test MycroForge.CLI / test (push) Has been skipped
Fixed syntax error
2024-10-06 14:20:47 +02:00

35 lines
1.2 KiB
YAML

name: Build and publish MycroForge.CLI
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.CLI
on: [ push ]
jobs:
test:
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.CLI && 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
VERSION=$(grep '<Version>' < MycroForge.CLI.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/')
TAG="nupkg/$(ls nupkg)"
echo "TAG=$TAG"
# Push the package
dotnet nuget push "$TAG" --source devdisciples
# dotnet nuget push "nupkg/MycroForge.CLI.$VERSION.nupkg" --source devdisciples