From aeb9467ac0ca49c4ce06101384c4cbff8c531f3c Mon Sep 17 00:00:00 2001 From: Fati Iseni Date: Mon, 24 Jul 2023 16:08:50 +0200 Subject: [PATCH] Created new CI and Release workflows. (#350) --- .github/workflows/build-test-ef6.yml | 33 ------------------------ .github/workflows/build-test.yml | 38 ---------------------------- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++ .github/workflows/publish.yml | 31 ----------------------- .github/workflows/publishef6.yml | 34 ------------------------- .github/workflows/publishefcore.yml | 31 ----------------------- .github/workflows/release.yml | 25 ++++++++++++++++++ ci.slnf | 13 ++++++++++ 8 files changed, 72 insertions(+), 167 deletions(-) delete mode 100644 .github/workflows/build-test-ef6.yml delete mode 100644 .github/workflows/build-test.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/publishef6.yml delete mode 100644 .github/workflows/publishefcore.yml create mode 100644 .github/workflows/release.yml create mode 100644 ci.slnf diff --git a/.github/workflows/build-test-ef6.yml b/.github/workflows/build-test-ef6.yml deleted file mode 100644 index c985e63..0000000 --- a/.github/workflows/build-test-ef6.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build and Test Ardalis.Specification.EntityFramework6 - -on: - workflow_dispatch: - branches: - - main - push: - branches: - - main - paths: - - 'Specification.EntityFramework6/**' - pull_request: - branches: - - main - paths: - - 'Specification.EntityFramework6/**' - -jobs: - build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.0.2 - - name: Build with dotnet - run: dotnet build Specification.EntityFramework6/src/Ardalis.Specification.EntityFramework6/Ardalis.Specification.EntityFramework6.csproj --configuration Release - - name: Test with dotnet - run: dotnet test Specification.EntityFramework6/tests/Ardalis.Specification.EntityFramework6.IntegrationTests/Ardalis.Specification.EntityFramework6.IntegrationTests.csproj --configuration Release diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml deleted file mode 100644 index 260fa20..0000000 --- a/.github/workflows/build-test.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Test .NET CI - -on: - workflow_dispatch: - branches: - - main - push: - branches: - - main - paths: - - 'Specification/**' - - 'Specification.EntityFrameworkCore/**' - pull_request: - branches: - - main - paths: - - 'Specification/**' - - 'Specification.EntityFrameworkCore/**' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - name: Build with dotnet 7 - run: | - dotnet build Specification/src/Ardalis.Specification/Ardalis.Specification.csproj --configuration Release - dotnet build Specification/tests/Ardalis.Specification.UnitTests/Ardalis.Specification.UnitTests.csproj --configuration Release - dotnet build Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/Ardalis.Specification.EntityFrameworkCore.csproj --configuration Release - dotnet build Specification.EntityFrameworkCore/tests/Ardalis.Specification.EntityFrameworkCore.IntegrationTests/Ardalis.Specification.EntityFrameworkCore.IntegrationTests.csproj --configuration Release - - name: chmod - run: chmod 555 ./RunTests.sh - - name: Run integration tests with Docker - run: ./RunTests.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..76549cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Build and Test + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - 'Specification/**' + - 'Specification.EntityFrameworkCore/**' + - 'Specification.EntityFramework6/**' + pull_request: + branches: + - main + paths: + - 'Specification/**' + - 'Specification.EntityFrameworkCore/**' + - 'Specification.EntityFramework6/**' + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Build + run: dotnet build ci.slnf --configuration Release + - name: Test + run: dotnet test ci.slnf --configuration Release --no-build --no-restore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index e956c3a..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: publish Ardalis.Specification to nuget -on: - push: - branches: - - main # Your default release branch - paths: - - 'Specification/src/**' -jobs: - publish: - name: list on nuget - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest - # Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - # Publish - - name: publish on version change - uses: rohith/publish-nuget@v2 - with: - PROJECT_FILE_PATH: Specification/src/Ardalis.Specification/Ardalis.Specification.csproj # Relative to repository root - # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file - VERSION_REGEX: (.*)<\/Version> # Regex pattern to extract version info in a capturing group - TAG_COMMIT: true # Flag to enable / disable git tagging - TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version - NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key diff --git a/.github/workflows/publishef6.yml b/.github/workflows/publishef6.yml deleted file mode 100644 index d7cc7fc..0000000 --- a/.github/workflows/publishef6.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: publish Ardalis.Specification.EntityFramework6 to nuget -on: - push: - branches: - - main # Your default release branch - paths: - - 'Specification.EntityFramework6/src/**' -jobs: - publish: - name: list on nuget - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - # Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest - # Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.0.2 - - # Publish - - name: publish on version change - uses: rohith/publish-nuget@v2 - with: - PROJECT_FILE_PATH: Specification.EntityFramework6/src/Ardalis.Specification.EntityFramework6/Ardalis.Specification.EntityFramework6.csproj # Relative to repository root - # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file - VERSION_REGEX: (.*)<\/Version> # Regex pattern to extract version info in a capturing group - TAG_COMMIT: true # Flag to enable / disable git tagging - TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version - NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key diff --git a/.github/workflows/publishefcore.yml b/.github/workflows/publishefcore.yml deleted file mode 100644 index 1c38e16..0000000 --- a/.github/workflows/publishefcore.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: publish Ardalis.Specification.EntityFrameworkCore to nuget -on: - push: - branches: - - main # Your default release branch - paths: - - 'Specification.EntityFrameworkCore/src/**' -jobs: - publish: - name: list on nuget - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest - # Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - # Publish - - name: publish on version change - uses: rohith/publish-nuget@v2 - with: - PROJECT_FILE_PATH: Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/Ardalis.Specification.EntityFrameworkCore.csproj # Relative to repository root - # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file - VERSION_REGEX: (.*)<\/Version> # Regex pattern to extract version info in a capturing group - TAG_COMMIT: true # Flag to enable / disable git tagging - TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version - NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1ac31ad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release to Nuget + +on: + release: + types: [published] + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Build + run: dotnet build ci.slnf --configuration Release + - name: Test + run: dotnet test ci.slnf --configuration Release --no-build --no-restore + - name: Pack + run: dotnet pack ci.slnf --configuration Release --no-build --no-restore --output . + - name: Push to NuGet + run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json diff --git a/ci.slnf b/ci.slnf new file mode 100644 index 0000000..a2c8d5f --- /dev/null +++ b/ci.slnf @@ -0,0 +1,13 @@ +{ + "solution": { + "path": "Ardalis.Specification.sln", + "projects": [ + "Specification.EntityFramework6\\src\\Ardalis.Specification.EntityFramework6\\Ardalis.Specification.EntityFramework6.csproj", + "Specification.EntityFramework6\\tests\\Ardalis.Specification.EntityFramework6.IntegrationTests\\Ardalis.Specification.EntityFramework6.IntegrationTests.csproj", + "Specification.EntityFrameworkCore\\src\\Ardalis.Specification.EntityFrameworkCore\\Ardalis.Specification.EntityFrameworkCore.csproj", + "Specification.EntityFrameworkCore\\tests\\Ardalis.Specification.EntityFrameworkCore.IntegrationTests\\Ardalis.Specification.EntityFrameworkCore.IntegrationTests.csproj", + "Specification\\src\\Ardalis.Specification\\Ardalis.Specification.csproj", + "Specification\\tests\\Ardalis.Specification.UnitTests\\Ardalis.Specification.UnitTests.csproj" + ] + } +} \ No newline at end of file