Skip to content

Contribution Guide

SecRandom welcomes anyone to submit code to our repository. You can help us in many ways, including but not limited to:

  • Submitting patches to fix bugs
  • Adding new features
  • Optimizing existing features
  • Improving code performance
  • Improving documentation and translations
  • More…

By reading this guide, you will understand the process of contributing code to SecRandom, including how to trigger binary builds with commit messages. Let’s get started!

Before contributing code to SecRandom, please make sure you have completed the following:

[!NOTE] Besides the command line, you can also use GitHub Desktop or the built-in features/plugins of your IDE.

  1. Fork the project

  2. Clone the repository

    [!WARNING] Make sure to switch your terminal working directory to where you want to save/modify the SecRandom source code before this step.

    Terminal window
    git clone https://github.com/your-username/SecRandom.git
    cd SecRandom
  3. Add the upstream repository

    Terminal window
    git remote add upstream https://github.com/SECTL/SecRandom.git
  4. Prepare the development environment

    [!TIP] If you don’t need to run the code to test, you can skip this part.

    v3 requires the .NET 10 SDK (available from dotnet.microsoft.com).

    Terminal window
    # Restore dependencies
    dotnet restore SecRandom.sln
    # Build
    dotnet build SecRandom.sln
    # Run the desktop app
    dotnet run --project SecRandom.Desktop
  1. Create a branch

    Terminal window
    git checkout -b feature/your-feature
  2. Make changes

    • Write your code
    • Add necessary comments
    • Follow the project code style
  3. Commit changes

    Terminal window
    git add .
    git commit -m "Describe your changes"
  4. Sync upstream changes

    Terminal window
    git fetch upstream
    git rebase upstream/master
  5. Push and create a Pull Request (PR)

    Terminal window
    git push origin feature/your-feature
    • Visit your GitHub fork
    • Click “Compare & pull request”
    • Fill in the PR description and submit
  • Use clear comments; follow the existing project code style (C# / .NET conventions)
  • Follow .NET naming conventions (PascalCase methods/properties, async naming suffix, etc.)
  • Make sure there are no unused using directives
  • Verify third-party UI components and other library types exist

[!TIP] You can use dotnet format to check code style:

Terminal window
dotnet format SecRandom.sln --verify-no-changes
  • Use clear, concise commit messages
  • Start with conventional words like fix, feat, etc.
  • Avoid overly simple descriptions (e.g., “fix bug”)

[!TIP] We recommend using Conventional Commits for commit messages.

  • PR title should concisely describe the changes (if there is only one commit, you can use its title)
  • Provide detailed change notes, including:
    • Added/modified/removed features
    • Added/modified/removed dependencies and .NET version/TargetFramework changes
    • Other breaking changes (if any)
  • Make sure all tests pass
  • Make sure your code runs correctly on your machine at least
  • Link related Issues (if any)

Once a SecRandom maintainer reviews your PR and confirms there are no issues, your code will be merged into the main branch.

Now congratulations, you are a SecRandom contributor!

If your PR is not accepted, no worries. Read the maintainers’ suggestions carefully and keep trying — one day you will become a contributor. Go !

If you want to test automatically built binaries, read the following for more info.

SecRandom uses a unified GitHub Actions workflow for building and publishing, located at .github/workflows/build_publish.yml. It uses dotnet publish to build desktop apps for Windows / Linux / macOS (x64 / x86 / arm64).

The old v2 supported triggering builds via commit message keywords; v3 release builds are triggered by version tags:

  1. Release build

    • Create a tag following the version convention (format: vNumber.Number.Number, e.g. v3.0.0)
    • Example: git tag v3.0.0 && git push origin v3.0.0
  2. Manual trigger

    • On the GitHub Actions page, select the Build & Publish workflow
    • Click Run workflow and fill in the release tag

The workflow outputs full and light artifacts:

Artifact Description
full Self-contained packages with the runtime bundled; no .NET runtime installation needed
light Lightweight packages that depend on the system .NET runtime

Each artifact produces Setup and Portable packages for the target platforms, verifies artifact length and hash, then publishes.