- Local pipeline:
task pipeline:local- Runs format, lint, build, test, coverage, and docs - Show version:
task version:show:full- Displays current version - Bump version:
task version:bump:patch(orminor/major) - Release:
task release:patch(orminor/major) - Full release pipeline - Build binary:
task build:release- Creates universal binary (arm64 + x86_64)
- Build debug:
swift buildortask build:debug - Build release:
task build:release- Creates optimized universal binary - Test all:
swift test --parallelortask test - Test single:
swift test --filter <TestName>(e.g.,swift test --filter SemanticVersionTests) - Format:
task formatorswift package plugin --allow-writing-to-package-directory format-source-code - Lint:
task lintorswift package plugin lint-source-code - Coverage:
task test:coverage(requires 85% threshold) - Documentation:
task document- Generates DocC documentation in./docs
- Version file:
version.json- Contains semantic version components - Version bumping: Use
task version:bump:[patch|minor|major](auto-commits) - Pre-release:
task version:set:prerelease -- alpha.1 - Build metadata:
task version:set:build -- 20250514.3 - Git tags: Created automatically during release (
task release:*)
- Prepare release:
task release:dry-run- Test without pushing - Create release:
task release:[patch|minor|major]- Full automated release- Bumps version and commits
- Builds universal binary
- Generates Homebrew formula with SHA256
- Creates GitLab package and release
- Tags and pushes to main
- Rollback:
task release:rollback- Reverts last release if needed
The .gitlab-ci.yml defines automated workflows:
- build: Compiles project and runs initial checks
- test: Runs test suite with coverage
- package: Creates release artifacts (manual trigger)
- release: Publishes to GitLab registry (manual trigger)
- build-job: Format, lint, and build debug version
- test-job: Run tests with 85% coverage requirement
- package-job: Build universal binary and generate Homebrew formula
- release-job: Upload to GitLab package registry
- Test coverage reports (Cobertura format)
- Universal binary:
.build/release/semantic-version-manager - Homebrew formula:
Formula/semantic-version-manager.rb
- Swift version: 6.1, macOS 14+ minimum
- Formatting: 2-space indentation, 100 char line length, 1 blank line max (via .swift-format.json)
- Imports: Foundation first, then external packages, then internal modules
- Naming: PascalCase for types, camelCase for variables/functions, SCREAMING_SNAKE for constants
- Access control: Explicit
public/internal/private, preferletovervar - Error handling: Use custom errors (e.g.,
SemanticVersionError), throw specific errors - Testing: Use Swift Testing framework (
@Test,@Suite), descriptive test names - File structure: Sources/[Module]/ for code, Tests/[Module]Tests/ for tests
- Dependencies: Check Package.swift before adding new packages
- Documentation: Swift DocC for public APIs with
AllPublicDeclarationsHaveDocumentationrule enabled
The project uses Task for automation. Key task groups:
version:show:[core|full|major|minor|patch|prerelease|build]- Display version componentsversion:bump:[patch|minor|major]- Increment version with git commitversion:set:[major|minor|patch|prerelease|build]- Set specific version values
build:debug- Debug build with code coveragebuild:release- Optimized universal binary (arm64 + x86_64)
format- Auto-format codelint- Check code styletest- Run test suitetest:coverage- Generate coverage reportdocument- Generate DocC documentation
pipeline:local- Complete local validationpipeline:ci- GitLab CI pipeline steps
release:prepare- Generate Homebrew formularelease:create- Create GitLab releaserelease:dry-run- Test release without pushingrelease:patch|minor|major- Complete release workflowrelease:rollback- Undo last release
- Registry: Packages published to
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/semantic-version-manager - Releases: Created via GitLab API with binary and formula as assets
- Protected branches: Release jobs require protected branch/tag
- Manual triggers: Package and release stages require manual approval
- Always run
task pipeline:localbefore committing - Documentation comments required for all public APIs
- Universal binaries built with
lipofor both architectures - Homebrew formula auto-generated with SHA256 checksums
- Git commits automated for version bumps (use
--no-committo disable)