From 36dc04fb019a2be007b2a61ceefab9aa7b7baf46 Mon Sep 17 00:00:00 2001 From: Alex Macocian Date: Wed, 21 Aug 2024 12:59:02 +0200 Subject: [PATCH] Add pipelines --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 16 ++++++ .github/workflows/cd.yaml | 53 +++++++++++++++++++ .github/workflows/ci.yaml | 44 +++++++++++++++ Net.Maui.Extensions.sln | 15 ++++++ .../Net.Maui.Extensions.csproj | 2 +- 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/cd.yaml create mode 100644 .github/workflows/ci.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..707dc58 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* amacocian@yahoo.com \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..32f21e9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..6b8b30d --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,53 @@ +name: Net.Maui.Extensions CD Pipeline + +on: + push: + branches: + - master + paths: + - Net.Maui.Extensions/** + - ".github/workflows/cd.yaml" + +jobs: + + build: + environment: Default + strategy: + matrix: + targetplatform: [x64] + + runs-on: windows-latest + + env: + Configuration: Release + Solution_Path: Net.Maui.Extensions.sln + Source_Project_Path: Net.Maui.Extensions\Net.Maui.Extensions.csproj + Actions_Allow_Unsecure_Commands: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.1 + + - name: Restore project + run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier + env: + RuntimeIdentifier: win-${{ matrix.targetplatform }} + + - name: Build Net.Maui.Extensions project + run: dotnet build $env:Source_Project_Path -c $env:Configuration + + - name: Package Net.Maui.Extensions + run: dotnet pack -c Release -o . $env:Source_Project_Path + + - name: Publish + run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c9072d1 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,44 @@ +name: Net.Maui.Extensions CI Pipeline + +on: + pull_request: + branches: + - master + paths: + - Net.Maui.Extensions/** + - ".github/workflows/ci.yaml" + +jobs: + + build: + + strategy: + matrix: + targetplatform: [x64] + + runs-on: windows-latest + + env: + Solution_Path: Net.Maui.Extensions.sln + Source_Project_Path: Net.Maui.Extensions\Net.Maui.Extensions.csproj + Actions_Allow_Unsecure_Commands: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.1 + + - name: Restore Project + run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier + env: + Configuration: Debug + RuntimeIdentifier: win-${{ matrix.targetplatform }} \ No newline at end of file diff --git a/Net.Maui.Extensions.sln b/Net.Maui.Extensions.sln index 558763c..b912616 100644 --- a/Net.Maui.Extensions.sln +++ b/Net.Maui.Extensions.sln @@ -5,6 +5,18 @@ VisualStudioVersion = 17.9.34714.143 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net.Maui.Extensions", "Net.Maui.Extensions\Net.Maui.Extensions.csproj", "{518D6700-2583-4743-A015-C142E33AF3AC}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{617BD830-6D10-4FE9-82FB-9880CEC683D4}" + ProjectSection(SolutionItems) = preProject + .github\CODEOWNERS = .github\CODEOWNERS + .github\dependabot.yml = .github\dependabot.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{FBF28286-4693-460F-A13B-59EA80B1F98F}" + ProjectSection(SolutionItems) = preProject + .github\workflows\cd.yaml = .github\workflows\cd.yaml + .github\workflows\ci.yaml = .github\workflows\ci.yaml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +33,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {FBF28286-4693-460F-A13B-59EA80B1F98F} = {617BD830-6D10-4FE9-82FB-9880CEC683D4} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FDFE725F-2E85-450E-9A22-39587AE90B13} EndGlobalSection diff --git a/Net.Maui.Extensions/Net.Maui.Extensions.csproj b/Net.Maui.Extensions/Net.Maui.Extensions.csproj index 54313a4..549d4db 100644 --- a/Net.Maui.Extensions/Net.Maui.Extensions.csproj +++ b/Net.Maui.Extensions/Net.Maui.Extensions.csproj @@ -20,7 +20,7 @@ enable enable true - 0.1 + 0.1.1 Alexandru Macocian LICENSE true