Skip to content

Chore: Automate versioning with GitHub actions#69

Merged
brenocq merged 11 commits intodevfrom
automate-versioning
Mar 5, 2025
Merged

Chore: Automate versioning with GitHub actions#69
brenocq merged 11 commits intodevfrom
automate-versioning

Conversation

@brenocq
Copy link
Owner

@brenocq brenocq commented Mar 4, 2025

Automate versioning with GitHub actions

This PR introduces a GitHub Actions workflow to automate versioning based on PR labels. It ensures that versioning is handled consistently by automatically updating the version in CMakeLists.txt, committing the change, and tagging the new version in Git.

🔍 How It Works

When you're ready to merge a PR, you add a versioning label (version:major, version:minor, or version:patch).
This triggers the workflow, which will:

  1. Merge dev into the PR branch to ensure the latest version is used.

    • If there are merge conflicts, the workflow fails and requires manual resolution.
  2. Determine the new version based on the label:

    • version:major1.2.3 → 2.0.0
    • version:minor1.2.3 → 1.3.0
    • version:patch (default) → 1.2.3 → 1.2.4
  3. Update CMakeLists.txt with the new version and create a commit (if necessary).

  4. Create and push a new Git tag, linking it to the latest commit.

    • The PR title is used as the tag description for better traceability.

Once the workflow completes, the PR can be merged into dev, and the new version is tagged automatically.

🔧 Changelog

  • Feat
    • Add workflow dispatch trigger to Linux, MacOS, Web, and Windows workflows
    • Add auto versioning workflow
  • Style
    • Use concise matrix configuration in Linux, MacOS, Web, and Windows workflows
  • Chore
    • Update workflow names with emojis for better visual distinction
    • Update actions/checkout to version 4

@brenocq brenocq added prio:low Low priority status:doing Work is currently in progress type:chore Maintenance tasks (dependencies, configs) version:patch Increases the patch version when added to a PR labels Mar 4, 2025
@brenocq brenocq self-assigned this Mar 4, 2025
@brenocq brenocq added type:chore Maintenance tasks (dependencies, configs) and removed version:patch Increases the patch version when added to a PR type:chore Maintenance tasks (dependencies, configs) labels Mar 4, 2025
@brenocq brenocq added type:chore Maintenance tasks (dependencies, configs) version:patch Increases the patch version when added to a PR and removed type:chore Maintenance tasks (dependencies, configs) labels Mar 4, 2025
@brenocq brenocq added version:minor Increases the minor version when added to a PR and removed version:patch Increases the patch version when added to a PR labels Mar 4, 2025
@brenocq brenocq added version:patch Increases the patch version when added to a PR and removed version:minor Increases the minor version when added to a PR labels Mar 4, 2025
@brenocq brenocq linked an issue Mar 4, 2025 that may be closed by this pull request
8 tasks
@brenocq brenocq changed the title Automate versioning Automate versioning with GitHub actions Mar 4, 2025
@brenocq brenocq added version:patch Increases the patch version when added to a PR and removed version:patch Increases the patch version when added to a PR labels Mar 4, 2025
@brenocq brenocq changed the title Automate versioning with GitHub actions Automate versioning with GitHub actions (#67) Mar 4, 2025
@brenocq brenocq changed the title Automate versioning with GitHub actions (#67) Feat: Automate versioning with GitHub actions (#67) Mar 4, 2025
@brenocq brenocq added version:patch Increases the patch version when added to a PR status:done Task completed successfully and removed version:patch Increases the patch version when added to a PR status:doing Work is currently in progress labels Mar 4, 2025
@brenocq brenocq changed the title Feat: Automate versioning with GitHub actions (#67) Automate versioning with GitHub actions Mar 5, 2025
@brenocq brenocq added version:patch Increases the patch version when added to a PR and removed version:patch Increases the patch version when added to a PR labels Mar 5, 2025
@brenocq brenocq merged commit 6e87160 into dev Mar 5, 2025
6 checks passed
@brenocq brenocq deleted the automate-versioning branch March 5, 2025 06:41
@brenocq brenocq changed the title Automate versioning with GitHub actions Chore: Automate versioning with GitHub actions Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prio:low Low priority status:done Task completed successfully type:chore Maintenance tasks (dependencies, configs) version:patch Increases the patch version when added to a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Automate versioning with GitHub actions

1 participant