Native Windows Applications and Games

Use Case: Native Windows Applications and Games Versioning with Versioning Tools API

Context

In native Windows application and game development, managing versions is critical for tracking changes, distributing updates, and maintaining consistency across releases. This use case illustrates how a developer can use the Versioning Tools API to automate versioning for native Windows applications and games. The process involves retrieving the next version identifier, updating version information locally, tagging the repository, and preparing for deployment.

Scenario

A developer has finished adding a new feature to a native Windows application or game. To prepare for release, the developer needs to:

  1. Retrieve the next semantic version from the Versioning Tools API.

  2. Update the application’s version information in the local codebase.

  3. Tag the version in the version control system (Git).

  4. Prepare the application or game for deployment.

Step-by-Step Guide

1. Retrieve the Next Version Identifier

The developer first needs to obtain the next semantic version from the Versioning Tools API.

Command:

curl -X 'POST' \
  'https://api.versioning.tools/v1/SemVer/myWindowsAppOrGame?apiKey=YOUR_API_KEY' \
  -H 'accept: */*'

Explanation:

  • myWindowsAppOrGame: Replace with your service ID, representing the Windows application or game.

  • YOUR_API_KEY: Replace with your API key.

Response:

{
  "version": "1.5.0"
}

The response provides the next version number, for example, 1.5.0.

2. Update the Application’s Version Information

Update the application’s version information in the local codebase. The approach will vary depending on how versioning is managed in the application.

For .NET Applications:

  1. Update AssemblyInfo.cs:

    • Locate AssemblyInfo.cs file, typically found in the Properties folder of your project.

    • Update AssemblyVersion and AssemblyFileVersion attributes:

      [assembly: AssemblyVersion("1.5.0.0")]
      [assembly: AssemblyFileVersion("1.5.0.0")]

    Explanation:

    • AssemblyVersion: Specifies the version of the assembly being attributed.

    • AssemblyFileVersion: Specifies the file version of the assembly.

For Standalone Executable or Game Builds:

  1. Update Version Information in Configuration Files:

    • If version information is maintained in configuration files, such as .ini, .xml, or other custom files, update the version information accordingly.

      <version>1.5.0</version>

    Explanation:

    • version: The new version number for the build.

3. Tag the Version in Git

After updating the local codebase, tag the version in the Git repository.

Command:

git tag v1.5.0 -m "Release version 1.5.0"

Explanation:

  • v1.5.0: The version number received from the API.

  • -m "Release version 1.5.0": A message describing the tag.

4. Push the Tag to the Remote Repository

Push the new tag to the remote repository.

Command:

git push origin v1.5.0

Explanation:

  • origin: The name of the remote repository.

  • v1.5.0: The tag being pushed.

5. Prepare for Deployment

Prepare the application or game for deployment. This step involves:

  1. Build Artifacts:

    • Generate the build artifacts (executables, installers, etc.) with the updated version.

  2. Documentation:

    • Update any release notes or changelogs to reflect the new version.

  3. Deployment:

    • Deploy the updated application or game to the appropriate distribution channels (e.g., internal distribution systems, public download sites).

Example Workflow

Here is an example workflow a developer might follow:

  1. Complete Development:

    • Finalize coding and ensure all tests pass.

  2. Retrieve the Next Version:

    NEXT_VERSION=$(curl -X 'POST' \
      'https://api.versioning.tools/v1/SemVer/myWindowsAppOrGame?apiKey=YOUR_API_KEY' \
      -H 'accept: */*')
  3. Update Version Information:

    • For .NET applications, update AssemblyInfo.cs.

    • For standalone executables or games, update configuration files.

  4. Tag the Repository:

    git tag "v$NEXT_VERSION" -m "Release version $NEXT_VERSION"
  5. Push the Tag:

    git push origin "v$NEXT_VERSION"
  6. Prepare for Deployment:

    • Build the application or game and update deployment documentation.


Last updated