Skip to content

Latest commit

 

History

History
93 lines (66 loc) · 3.4 KB

File metadata and controls

93 lines (66 loc) · 3.4 KB

Contributing

Thanks for helping improve contentful.net.

Development with Dev Containers

This repository includes a .devcontainer configuration for a reproducible local setup. GitHub Actions uses the same devcontainer configuration for CI.

Visual Studio Code

Open the repository in Visual Studio Code, install the Dev Containers extension if needed, then run Dev Containers: Reopen in Container. Wait for the container build and post-create setup to finish.

Terminal or other editors

Install Docker and the Dev Container CLI (npm install -g @devcontainers/cli). From the repository root, run:

devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash

Verify the environment

dotnet build && dotnet test Contentful.AspNetCore.Tests && dotnet test Contentful.Core.Tests

Other Useful Commands

dotnet restore
dotnet test Contentful.AspNetCore.Tests
dotnet test Contentful.Core.Tests

Pull Requests

  1. Fork the repository and create a branch for your change.
  2. Run the relevant checks from the dev container.
  3. Open a pull request with a short summary of the change and any follow-up context.

Prerequisites

Tool Version Notes
.NET SDK 6.0.428 (see global.json) Pinned in global.json at repo root
Docker any recent Required for the devcontainer workflow
Dev Container CLI optional npm install -g @devcontainers/cli for non-VS Code editors

Testing

  • Framework: xUnit
  • Location: Contentful.Core.Tests/ and Contentful.AspNetCore.Tests/
  • Run all:
    dotnet test Contentful.Core.Tests && dotnet test Contentful.AspNetCore.Tests
  • Run single project:
    dotnet test Contentful.Core.Tests
    dotnet test Contentful.AspNetCore.Tests

Branch Strategy

  • master — default branch; represents the latest stable published version
  • Feature branches — create from master, open a PR to merge back
  • No long-lived release branches; releases are cut from master manually

Release Process

Releases are manual. Both NuGet packages (contentful.csharp and contentful.aspnetcore) must be published separately in order.

  1. Bump VersionPrefix in Contentful.Core/Contentful.Core.csproj according to semver
  2. Run dotnet build && dotnet test to confirm everything passes
  3. cd Contentful.Core && dotnet pack -c=Release
  4. Push to NuGet: dotnet nuget push bin/Release/contentful.csharp.<version>.nupkg --source https://api.nuget.org/v3/index.json --api-key <api_key>
  5. Update contentful.csharp package reference in Contentful.AspNetCore/Contentful.AspNetCore.csproj to the new version
  6. Bump VersionPrefix (and Version) in Contentful.AspNetCore/Contentful.AspNetCore.csproj
  7. cd Contentful.AspNetCore && dotnet pack -c=Release
  8. Push to NuGet: dotnet nuget push bin/Release/contentful.aspnetcore.<version>.nupkg --source https://api.nuget.org/v3/index.json --api-key <api_key>
  9. Draft a GitHub Release at https://github.com/contentful/contentful.net/releases
  10. Update CHANGELOG.md

For NuGet org access setup and additional details, contact the Contentful Developer Experience team.

CI/CD

Job Trigger What it does
CI (.github/workflows/ci.yml) Push to master, PR to master Runs dotnet build && dotnet test inside the devcontainer