From cc07782fdee4b53f2c125845c6223bb6046b1c3c Mon Sep 17 00:00:00 2001 From: Konstantin Hintermayer Date: Wed, 14 May 2025 21:56:48 +0200 Subject: [PATCH] CI: Setup dotnet SDK before running automatic build --- .gitea/workflows/ci.yml | 27 +++++++++++++++++++++++---- .gitea/workflows/release.yml | 2 ++ Package/release.sh | 5 ++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d950e2b..e986e60 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,9 +13,28 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - name: Checkout + - name: Checkout Module uses: https://github.com/actions/checkout@v4 - - name: Build - run: dotnet build --configuration Release + with: + path: Module.EventRegistration + - name: Checkout Oqtane + uses: https://github.com/actions/checkout@v4 + with: + repository: Diplomarbeit-Absolventenverein/oqtane.framework + path: oqtane.framework + ref: v6.1.1 + - name: Setup Dotnet SDK + uses: https://github.com/actions/setup-dotnet@v4 + with: + dotnet-version: '9.x' + # - name: Setup NuGet + # uses: https://github.com/nuget/setup-nuget@v2 + # with: + # nuget-api-key: ${{ secrets.NuGetAPIKey }} + # nuget-version: '5.x' + - name: Build Oqtane + run: dotnet build ./oqtane.framework/Oqtane.sln --configuration Debug + - name: Build Module + run: dotnet build ./Module.EventRegistration/SZUAbsolventenverein.Module.EventRegistration.sln --configuration Release - name: Test - run: dotnet test --configuration Release --no-build \ No newline at end of file + run: dotnet test ./Module.EventRegistration/SZUAbsolventenverein.Module.EventRegistration.sln --configuration Release --no-build \ No newline at end of file diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 065b80e..95bfc12 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -19,6 +19,8 @@ jobs: git branch --remote --contains | grep origin/main - name: Set VERSION variable from tag run: echo "VERSION=${GITEA_REF/refs\/tags\/v/}" >> $GITEA_ENV + - name: Setup Dotnet SDK + uses: https://github.com/actions/setup-dotnet@v4 - name: Build run: dotnet build --configuration Release /p:Version=${VERSION} - name: Test diff --git a/Package/release.sh b/Package/release.sh index 0fd258f..d8c57f3 100644 --- a/Package/release.sh +++ b/Package/release.sh @@ -1,5 +1,8 @@ TargetFramework=$1 ProjectName=$2 -"..\..\oqtane.framework\oqtane.package\nuget.exe" pack %ProjectName%.nuspec -Properties targetframework=%TargetFramework%;projectname=%ProjectName% +chmod +x ../../oqtane.framework/Oqtane.Package/nuget.exe +# "../../oqtane.framework/Oqtane.Package/nuget.exe" pack %ProjectName%.nuspec -Properties targetframework=%TargetFramework%;projectname=%ProjectName% +dotnet nuget pack %ProjectName%.nuspec -Properties targetframework=%TargetFramework%;projectname=%ProjectName% + cp -f "*.nupkg" "..\..\oqtane.framework\Oqtane.Server\Packages\" \ No newline at end of file