From 0dd7a2d3fb233b63218b945f8fcc4b26f1d8531f Mon Sep 17 00:00:00 2001 From: Admin Date: Sat, 27 Dec 2025 11:34:23 -0500 Subject: [PATCH] Add Gitea Actions workflows for CI and NuGet release --- .gitea/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++ .gitea/workflows/release.yml | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..9fbbad3 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,39 @@ +# OpenMaui Linux CI/CD Pipeline for Gitea +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main] + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + +jobs: + build: + name: Build and Test + runs-on: windows + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Run tests + run: dotnet test --configuration Release --no-build --verbosity normal + continue-on-error: true + + - name: Pack NuGet (preview) + run: dotnet pack --configuration Release --no-build -o ./nupkg + + - name: Upload NuGet artifact + uses: actions/upload-artifact@v4 + with: + name: nuget-package + path: ./nupkg/*.nupkg diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..575c1e6 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,45 @@ +# OpenMaui Linux Release - Publish to NuGet +name: Release to NuGet + +on: + release: + types: [published] + push: + tags: + - 'v*' + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + +jobs: + release: + name: Build and Publish to NuGet + runs-on: windows + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract version from tag + id: version + shell: pwsh + run: | + $tag = "${{ github.ref_name }}" + $version = $tag -replace '^v', '' + echo "VERSION=$version" >> $env:GITHUB_OUTPUT + echo "Building version: $version" + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Run tests + run: dotnet test --configuration Release --no-build --verbosity normal + + - name: Pack NuGet package + run: dotnet pack --configuration Release --no-build -o ./nupkg /p:PackageVersion=${{ steps.version.outputs.VERSION }} + + - name: Publish to NuGet.org + run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate