Module 1 — Code¶
Lesson 24: GitHub Releases, Tags, and Version History — Advanced Repository Release Management¶
Level: Advanced
Type: Practical lesson
Repository: github-deep-dive-training
1. Learning objectives¶
By the end of this lesson, you should understand:
- Git tags versus GitHub Releases.
- Lightweight and annotated tags.
- Semantic Versioning (SemVer).
- Version numbering strategies.
- Release branches and maintenance branches.
- Draft releases and pre-releases.
- Release notes and changelog management.
- Comparing releases and tags.
- Release assets and downloadable artifacts.
- GitHub CLI release management.
- Hotfix releases.
- Release automation with GitHub Actions.
2. Git tags versus GitHub Releases¶
A Git tag is a reference to a particular Git object, usually a commit.
A GitHub Release is a release entry associated with a Git tag.
Git tags identify repository versions. GitHub Releases package release information, notes, and downloadable assets.
Example:
| Git tag | GitHub Release |
|---|---|
| v1.0.0 | Application 1.0.0 |
| v1.1.0 | Application 1.1.0 |
| v1.1.1 | Application 1.1.1 |
You can create Git tags without publishing GitHub Releases.
3. Lightweight versus annotated tags¶
Lightweight tag¶
A lightweight tag is a named reference to an object, usually a commit.
Annotated tag¶
An annotated tag contains:
- Tag name.
- Tagger identity.
- Tagging date.
- Tag message.
- Optional cryptographic signature.
Push a tag:
Push all tags:
Inspect tags:
Annotated tags are recommended for official releases.
4. Semantic Versioning (SemVer)¶
SemVer uses:
Example:
MAJOR¶
Increment when introducing incompatible public API changes.
Example:
MINOR¶
Increment when introducing backward-compatible functionality.
Example:
PATCH¶
Increment when introducing backward-compatible bug fixes.
Example:
Version examples¶
| Change | Current | Next |
|---|---|---|
| Bug fix | 1.0.0 | 1.0.1 |
| Compatible feature | 1.0.1 | 1.1.0 |
| Breaking API change | 1.1.0 | 2.0.0 |
| Bug fix | 2.0.0 | 2.0.1 |
Pre-release versions¶
- Alpha: Early development.
- Beta: Feature testing.
- RC: Release candidate.
- Final: Stable release.
Build metadata is also supported:
Build metadata does not affect version precedence.
Official specification:
https://semver.org/spec/v2.0.0.html
5. Versioning strategies¶
Application versioning¶
Library versioning¶
SaaS platform versioning¶
During initial development, 0.y.z indicates an unstable public API under SemVer.
Monorepo versioning¶
One version for the entire repository:
Independent versions for each component:
Choose the approach according to component dependencies and deployment requirements.
6. Release and maintenance branches¶
Release branches stabilize a version independently of ongoing development.
Example:
main
|
|---- v1.0.0
|
|---- v1.1.0
|
|---- release/1.5
| |
| |---- v1.5.0
| |---- v1.5.1
|
|---- development of v2.0.0
Create a release branch:
Push it:
Commit a maintenance fix:
After review and merging:
If a fix must also appear in another development branch, integrate it using an appropriate merge or cherry-pick.
7. Changelog management¶
Create:
Recommended structure:
## Changelog
All notable changes are documented here.
## [Unreleased]
### Added
### Changed
### Fixed
### Removed
## [1.1.0] - 2026-11-19
### Added
- Added kitchen station management.
- Added order status notifications.
### Changed
- Improved order processing.
### Fixed
- Corrected duplicate order submission.
## [1.0.1] - 2026-11-10
### Fixed
- Fixed authentication validation.
- Corrected receipt generation.
Changelog categories¶
| Category | Meaning |
|---|---|
| Added | New functionality |
| Changed | Changes to existing functionality |
| Deprecated | Planned removal |
| Removed | Removed functionality |
| Fixed | Bug fixes |
| Security | Security-related changes |
Commit history versus changelog¶
Commit history describes individual implementation changes.
A changelog communicates the meaningful changes included in a release.
Automatic release notes¶
GitHub can generate release notes based on merged pull requests and contributors.
You can customize categories using:
Example:
changelog:
categories:
- title: Breaking Changes
labels:
- breaking-change
- title: New Features
labels:
- feature
- title: Bug Fixes
labels:
- bug
- title: Maintenance
labels:
- maintenance
- title: Other Changes
labels:
- "*"
Configure the labels to match the actual labels used by your repository.
8. Draft, pre-release, and published releases¶
Draft release¶
A release that has not yet been published.
Use it when release notes or assets still need review.
Pre-release¶
A release intended for testing rather than general stable use.
Examples:
Published release¶
The official published release entry containing its tag, release notes, and optional assets.
Typical lifecycle¶
- Development.
- Release candidate.
- Draft release.
- Final testing and review.
- Published release.
- Maintenance and patch releases.
GitHub also supports immutable releases. When enabled, publishing a release can restrict later changes to its assets and tag.
9. Release assets¶
Release assets are downloadable files attached to GitHub Releases.
Examples:
| Asset | Purpose |
|---|---|
.exe |
Windows executable |
.msi |
Windows installer |
.zip |
Application package |
.tar.gz |
Compressed distribution |
.apk |
Android application package |
.pdf |
Documentation |
checksums.txt |
Integrity verification |
Upload an asset:
Download a release:
Download a specific file:
GitHub automatically provides source-code ZIP and tarball archives for tagged commits.
Release asset limits documented by GitHub include up to 1,000 assets per release, with each asset under 2 GiB.
10. GitHub CLI release management¶
Check installation:
Authenticate:
List releases:
View a release:
Create a release:
Create a pre-release:
gh release create v1.1.0-beta.1 \
--title "Version 1.1.0 Beta 1" \
--notes "Beta testing release" \
--prerelease
Create a draft:
Edit a release:
Delete a release:
Deleting a GitHub Release and deleting its Git tag are separate operations.
Official reference:
https://cli.github.com/manual/gh_release
11. Comparing releases¶
GitHub comparison URL:
Git CLI:
Show a summary:
List commits:
Compare one file:
Find the nearest reachable tag:
12. Hotfix releases¶
A hotfix is a targeted correction to an existing release.
Example:
Create a branch from the affected version:
Implement and commit the correction:
Push:
Create a PR targeting the appropriate maintenance branch.
After review and merging:
Publish the corresponding GitHub Release.
Ensure the fix is also integrated into future development branches when required.
13. GitHub Actions release automation¶
Create:
Introductory example:
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests
run: |
echo "Run project tests here"
- name: Build application
run: |
echo "Build application here"
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--generate-notes
Replace placeholder commands with actual project tests and build commands before using it.
The workflow:
- Triggers when a matching version tag is pushed.
- Checks out the repository.
- Runs tests.
- Builds the application.
- Creates a GitHub Release.
The contents: write permission allows the workflow to publish the release.
This introductory example does not yet attach compiled assets.
14. Practical exercises¶
Exercise 1 — Tag types¶
Create lightweight and annotated tags.
Inspect them:
Explain the difference.
Exercise 2 — Semantic Versioning¶
Determine the next version for:
- A bug fix.
- A compatible API endpoint.
- A removed public API field.
- An optional configuration setting.
Document the results.
Exercise 3 — Create CHANGELOG.md¶
Create a changelog with:
- Unreleased.
- Version 1.0.0.
- Version 1.0.1.
- Added, Changed, Fixed, and Removed sections.
Exercise 4 — Release branch¶
Create:
Make a documentation change, commit it, and push the branch.
Exercise 5 — Draft release¶
Create a draft release on GitHub, add release notes, save it, and inspect it.
Exercise 6 — Pre-release¶
Create:
Publish it as a pre-release.
Exercise 7 — Release asset¶
Create:
Upload it:
Exercise 8 — Compare releases¶
Create two practice tags on different commits.
Document the changes.
Exercise 9 — Hotfix¶
Create a hotfix branch from a practice version.
Implement a documentation correction, commit it, and create a patch tag.
Exercise 10 — Release automation¶
Create .github/workflows/release.yml.
Review the trigger, runner, jobs, steps, permissions, and release command.
Do not publish a test release until the workflow has been reviewed.
15. Advanced challenge — Design a complete release strategy¶
Scenario:
You maintain a SaaS platform containing:
platform/
├── backend/
│ └── Django REST Framework
├── frontend/
│ └── React + TypeScript
├── mobile/
│ └── React Native
├── infrastructure/
│ └── Docker + Nginx
└── docs/
Your team needs to publish version 1.0.0.
Three months later:
- A new feature is introduced.
- An authentication bug is discovered.
- A beta release is required.
- A breaking API change is introduced.
- An older version must remain supported.
Design a release strategy covering:
- Version numbering.
- Branching strategy.
- Release branch naming.
- Annotated tag conventions.
- Changelog management.
- Draft and pre-release procedures.
- Production release procedures.
- Hotfix procedures.
- Release comparison.
- Release asset management.
- GitHub Actions automation.
Create:
Include a version history table, branch diagram, sample changelog, and step-by-step release procedure.
16. Completion checklist¶
- [ ] I understand Git tags and GitHub Releases.
- [ ] I can create lightweight tags.
- [ ] I can create annotated tags.
- [ ] I understand Semantic Versioning.
- [ ] I can identify breaking changes.
- [ ] I understand release branches.
- [ ] I can create a CHANGELOG.md.
- [ ] I can create draft releases.
- [ ] I can publish pre-releases.
- [ ] I can attach release assets.
- [ ] I can use GitHub CLI for releases.
- [ ] I can compare two versions.
- [ ] I understand hotfix releases.
- [ ] I understand release automation.
- [ ] I completed the practical exercises.
- [ ] I completed the advanced challenge.
17. References¶
-
GitHub Docs — Releasing projects: https://docs.github.com/en/repositories/releasing-projects-on-github
-
GitHub Docs — About releases: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
-
GitHub Docs — Managing releases: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
-
Git documentation — git-tag: https://git-scm.com/docs/git-tag
-
Semantic Versioning: https://semver.org/spec/v2.0.0.html
-
GitHub CLI — Releases: https://cli.github.com/manual/gh_release
Next lesson: Lesson 25 — GitHub Repository Documentation and Project Documentation Management: README, Wiki, GitHub Pages, and Documentation Workflows.