Skip to content

Adopt semantic versioning and add GitHub Actions #314

@somethingwithproof

Description

@somethingwithproof

Goal

Move the plugin to semantic versioning (MAJOR.MINOR.PATCH) and add GitHub Actions to support versioning and release workflow.

Current state

  • Version: INFO has version = 4.9 (two segments only)
  • GitHub Actions: No .github/workflows — no CI or release automation

Semantic versioning

  1. Format: Use MAJOR.MINOR.PATCH in INFO (e.g. 4.9.0). Initial semver release can be 4.9.0 (current 4.9 = 4.9.0).
  2. Policy: Document in README or docs/VERSIONING.md:
    • MAJOR: Incompatible API/behavior changes
    • MINOR: New features, backward compatible
    • PATCH: Bug fixes, backward compatible
  3. Single source of truth: Version lives in INFO; scripts/workflows read it from there.

Cacti-idiomatic GitHub Actions

Align with Cacti core’s workflow so plugin CI matches project norms:

  • Triggers: push and pull_request to develop (and main if used). Same as core.
  • Permissions: contents: read only.
  • Concurrency: group: build-${{ github.event.pull_request.number || github.ref }}, cancel-in-progress: true.
  • Env: COMPOSER_ALLOW_SUPERUSER: 1.
  • PHP matrix: php: ['8.1', '8.2', '8.3', '8.4'], os: [ubuntu-latest], fail-fast: false.
  • PHP setup: shivammathur/setup-php@v2 with:
    • php-version: ${{ matrix.php }}
    • extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring
    • ini-values: "post_max_size=256M, max_execution_time=60, date.timezone=America/New_York"
  • Composer: composer validate --strict; cache vendor (or include/vendor if aligned with core) with key ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}; composer install.
  • Composer scripts: Run lint, phpcsfixer, phpstan, test where defined (omit if not in plugin’s composer.json).
  • Actions: actions/checkout@v3, actions/cache@v3.
  • Workflow file: Optional GPL header at top, same style as core.

Plugin CI should stay lightweight (no full Cacti install): checkout → PHP setup → Composer validate/cache/install → lint → phpcsfixer → phpstan → test. Add a step to validate INFO version is semver.

GitHub Actions to add

  1. CI — As above; Cacti-style PHP matrix and composer usage.
  2. Version validationINFO version matches ^[0-9]+\.[0-9]+\.[0-9]+(-\S+)?.
  3. Release workflow — On tag v*.*.* or manual; create GitHub Release; optional plugin zip; optional tag/INFO match.
  4. Changelog — Optional: use CHANGELOG.md for release notes.

Suggested improvements

  • Branch protection: require CI to pass.
  • One ci.yml, one release.yml.

Out of scope

  • Implementing the workflows (planning/tracking only).
  • Changing Cacti core versioning.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions