From 165d97245d9676683bfde532def307356d573ad4 Mon Sep 17 00:00:00 2001 From: mdnapo Date: Sun, 6 Oct 2024 13:50:21 +0200 Subject: [PATCH] Properly configured build actions --- .gitea/workflows/build.yml | 8 ++++---- .gitea/workflows/test.yml | 2 +- MycroForge.CLI/scripts/publish-nuget.sh | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index ffd6e83..83f7cba 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -5,14 +5,12 @@ on: [ push ] jobs: test: runs-on: ubuntu-latest -# if: gitea.ref == 'refs/heads/main' + 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 NuGet package" -# run: cd MycroForge.CLI && dotnet pack -v d - name: "Build and publish NuGet package" run: | # Build the NuGet package @@ -25,5 +23,7 @@ jobs: --store-password-in-clear-text \ https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json + VERSION=$(grep '' < MycroForge.CLI.csproj | sed 's/.*\(.*\)<\/Version>/\1/') + # Push the package - dotnet nuget push nupkg/MycroForge.CLI.1.0.1.nupkg --source devdisciples + dotnet nuget push nupkg/MycroForge.CLI.$VERSION.nupkg --source devdisciples diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 4c05364..87444f1 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -5,7 +5,7 @@ on: [ push ] jobs: test: runs-on: ubuntu-latest - if: gitea.ref == 'refs/heads/main' + if: gitea.ref == 'refs/heads/develop' steps: - uses: https://github.com/actions/checkout@v4 - uses: https://github.com/actions/setup-dotnet@v4 diff --git a/MycroForge.CLI/scripts/publish-nuget.sh b/MycroForge.CLI/scripts/publish-nuget.sh index 8fa3ec0..505e78e 100644 --- a/MycroForge.CLI/scripts/publish-nuget.sh +++ b/MycroForge.CLI/scripts/publish-nuget.sh @@ -2,4 +2,6 @@ dotnet pack -v d -dotnet nuget push nupkg/MycroForge.CLI.1.0.0.nupkg --source devdisciples +VERSION="1.0.0" + +dotnet nuget push nupkg/MycroForge.CLI.$VERSION.nupkg --source devdisciples