0Pricing
Swift Academy · Lesson

Semantic versioning & tagging releases

Apply Semantic Versioning (MAJOR.MINOR.PATCH), create annotated git tags , and reference versions in SwiftPM dependencies clearly.

Semantic versioning & tagging releases is a free Swift Academy lesson on CoddyKit — lesson 2 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Swift Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What is SemVer?

SemVer = MAJOR.MINOR.PATCH.

  • MAJOR: breaking changes
  • MINOR: new features, backward compatible
  • PATCH: bug fixes, docs, small improvements

When to bump

Choose the bump:

  • Remove/rename public API → MAJOR
  • Add new API without breaking → MINOR
  • Internal refactors / bug fixes → PATCH

Git tagging workflow

Create an annotated tag (e.g., v1.2.0) and push it. SwiftPM resolves packages by git tags.

// Create an annotated tag and push it so SwiftPM can resolve it.
// Prereqs: tests pass; CHANGELOG updated.
//
//   git add -A
//   git commit -m "Release 1.2.0: new JSON helpers"
//   git tag -a v1.2.0 -m "v1.2.0"
//   git push --follow-tags
//
// Note: use the "v" prefix consistently (e.g., v1.2.0).
print("Tagged v1.2.0 and pushed with --follow-tags")

SwiftPM version requirements

In Package.swift, pick a requirement style: from:, exact:, .upToNextMajor, or .upToNextMinor.

// Package.swift (illustrative dependency specs)
// dependencies: [
//   // Compatible with 1.x (>=1.2.0, <2.0.0)
//   .package(url: "https://example.com/Lib.git", from: "1.2.0"),
//
//   // Exact pin:
//   // .package(url: "https://example.com/Lib.git", exact: "1.2.3"),
//
//   // Up to next major (same as "from:"):
//   // .package(url: "https://example.com/Lib.git", .upToNextMajor(from: "1.2.0")),
//
//   // Up to next minor (>=1.2.0, <1.3.0):
//   // .package(url: "https://example.com/Lib.git", .upToNextMinor(from: "1.2.0"))
// ]
print("Declare dependency ranges clearly: from/exact/upToNextMajor/upToNextMinor")

CHANGELOG habits

Summarize changes per version. Highlight BREAKING items clearly so users can upgrade safely.

// Keep a concise CHANGELOG with headings per version.
//
// # Changelog
// ## [1.2.0] - 2025-09-19
// - Add JSON.encodePretty(_:) (non-breaking)
// - Fix crash in Parser.parse() on empty input
//
// ## [2.0.0] - 2026-01-10
// - BREAKING: Renamed Parser.parse(_:) -> Parser.run(_:)
print("Write a short, helpful CHANGELOG for each release")

Pre-release tips

Pre-releases (e.g., 2.0.0-beta.1) signal instability. Avoid tagging if you don’t want users to pick them by default. Keep tag naming consistent.

SemVer bump rule

Quick check: When do you bump MAJOR?

Recap

Recap: Use SemVer (MAJOR.MINOR.PATCH), create annotated git tags like v1.2.0, specify dependency version ranges in Package.swift, and maintain a clear CHANGELOG.

Frequently asked questions

Is the “Semantic versioning & tagging releases” lesson free?

Yes — the full text of “Semantic versioning & tagging releases” is free to read here on the web, and the Swift Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Swift Academy course, upgrade to CoddyKit PRO.

What will I learn in “Semantic versioning & tagging releases”?

Apply Semantic Versioning (MAJOR.MINOR.PATCH), create annotated git tags , and reference versions in SwiftPM dependencies clearly. You practise Swift Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Swift Academy?

No prior experience is required. Swift Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 3, so you can start here or from the beginning and move at your own pace.

How long does the “Semantic versioning & tagging releases” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Swift Academy lesson?

Yes. Every Swift Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Library vs executable packages
  2. Semantic versioning & tagging releases
  3. CI basics with swift test and artifacts
← Back to Swift Academy