Swift Academy · Lesson

Semantic versioning & tagging releases

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

Lesson 2 of 38 steps

Semantic versioning & tagging releases is a free Swift Academy lesson on CoddyKit. This is lesson 2 of 3. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the Swift Academy learning path, and your progress syncs across the web and the CoddyKit app. The Swift Academy course includes 3 lessons in total.

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.

Free to start

Learn Swift with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
122
Lessons
409

Frequently Asked Questions

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

Yes — any 3 lessons of the Swift Academy learning path, including “Semantic versioning & tagging releases”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The Swift Academy course includes 3 lessons in total.

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, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 3.

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