|
| 1 | +# Creating GitHub Releases |
| 2 | + |
| 3 | +This guide explains how to create GitHub Releases for Ping Legacy. |
| 4 | + |
| 5 | +## Understanding the Workflow |
| 6 | + |
| 7 | +The GitHub Actions workflow (`build-and-release.yml`) runs different jobs based on the trigger: |
| 8 | + |
| 9 | +| Trigger | Build MSIX | Build Installer | Test Installer | Create Release | |
| 10 | +|---------|-----------|-----------------|----------------|----------------| |
| 11 | +| Push to branch | ? Yes | ? Yes | ? Yes | ?? **Skipped** | |
| 12 | +| Pull request | ? Yes | ? Yes | ? Yes | ?? **Skipped** | |
| 13 | +| **Push version tag** | ? Yes | ? Yes | ? Yes | ? **YES!** | |
| 14 | + |
| 15 | +## Why Was "Create GitHub Release" Skipped? |
| 16 | + |
| 17 | +The workflow contains this condition: |
| 18 | + |
| 19 | +```yaml |
| 20 | +create-release: |
| 21 | + if: startsWith(github.ref, 'refs/tags/v') # Only runs on version tags! |
| 22 | +``` |
| 23 | +
|
| 24 | +**Regular commits don't trigger releases** - only version tags do. |
| 25 | +
|
| 26 | +## Creating a Release |
| 27 | +
|
| 28 | +### Prerequisites |
| 29 | +
|
| 30 | +Before creating a release: |
| 31 | +
|
| 32 | +1. ? **All builds passing** (MSIX bundle and installer) |
| 33 | +2. ? **Version numbers updated** in: |
| 34 | + - `Package.appxmanifest` |
| 35 | + - `InnoSetup.iss` |
| 36 | +3. ? **CHANGELOG updated** (optional but recommended) |
| 37 | +4. ? **All changes committed** to your branch |
| 38 | + |
| 39 | +### Quick Method: Use the Script |
| 40 | + |
| 41 | +```powershell |
| 42 | +# Run the release script |
| 43 | +.\CreateRelease.ps1 -Version "2.0.4.0" |
| 44 | +
|
| 45 | +# Follow the prompts |
| 46 | +``` |
| 47 | + |
| 48 | +The script will: |
| 49 | +1. Check for uncommitted changes |
| 50 | +2. Create annotated tag (`v2.0.4.0`) |
| 51 | +3. Push tag to GitHub |
| 52 | +4. Trigger the release workflow |
| 53 | + |
| 54 | +### Manual Method: Step by Step |
| 55 | + |
| 56 | +#### Step 1: Update Version Numbers |
| 57 | + |
| 58 | +**Update `Package.appxmanifest`:** |
| 59 | +```xml |
| 60 | +<Identity |
| 61 | + Name="34488AvnishKumar.PingLegacy" |
| 62 | + Publisher="CN=1494B4FB-4349-4083-8AFA-16D2A64B8D99" |
| 63 | + Version="2.0.4.0" /> <!-- Update this! --> |
| 64 | +``` |
| 65 | + |
| 66 | +**Update `InnoSetup.iss`:** |
| 67 | +```ini |
| 68 | +#define MyAppVersion "2.0.4.0" <!-- Update this! --> |
| 69 | +``` |
| 70 | + |
| 71 | +#### Step 2: Commit Version Changes |
| 72 | + |
| 73 | +```sh |
| 74 | +git add Package.appxmanifest InnoSetup.iss |
| 75 | +git commit -m "Bump version to 2.0.4.0" |
| 76 | +git push origin avnish/migrateWinUI |
| 77 | +``` |
| 78 | + |
| 79 | +Wait for builds to complete successfully. |
| 80 | + |
| 81 | +#### Step 3: Create Version Tag |
| 82 | + |
| 83 | +```sh |
| 84 | +# Create annotated tag |
| 85 | +git tag -a v2.0.4.0 -m "Release version 2.0.4.0" |
| 86 | +
|
| 87 | +# Push tag to GitHub |
| 88 | +git push origin v2.0.4.0 |
| 89 | +``` |
| 90 | + |
| 91 | +#### Step 4: Monitor GitHub Actions |
| 92 | + |
| 93 | +1. Go to: https://github.com/avikeid2007/Ping-Tool/actions |
| 94 | +2. You'll see a new workflow run triggered by the tag |
| 95 | +3. Watch the progress: |
| 96 | + - ? Build MSIX Bundle (~10 min) |
| 97 | + - ? Build Traditional Installer (~15 min) |
| 98 | + - ? Test Installer (~1 min) |
| 99 | + - ? **Create GitHub Release** (~2 min) |
| 100 | + |
| 101 | +#### Step 5: Verify Release |
| 102 | + |
| 103 | +Once complete, the release will be available at: |
| 104 | +``` |
| 105 | +https://github.com/avikeid2007/Ping-Tool/releases/tag/v2.0.4.0 |
| 106 | +``` |
| 107 | + |
| 108 | +The release will contain: |
| 109 | +- ?? `PingTool.WinUI3_2.0.4.0_x86_x64_ARM64.msixbundle` (~150 MB) |
| 110 | +- ?? `PingLegacy-2.0.4.0-Setup.exe` (~150-200 MB) |
| 111 | +- ?? Auto-generated release notes |
| 112 | + |
| 113 | +## Release Naming Convention |
| 114 | + |
| 115 | +Use semantic versioning with 4 parts: |
| 116 | + |
| 117 | +``` |
| 118 | +v[MAJOR].[MINOR].[PATCH].[BUILD] |
| 119 | +
|
| 120 | +Examples: |
| 121 | +- v2.0.4.0 - Current version |
| 122 | +- v2.0.5.0 - Bug fix release |
| 123 | +- v2.1.0.0 - Minor feature release |
| 124 | +- v3.0.0.0 - Major release |
| 125 | +``` |
| 126 | + |
| 127 | +**Important**: |
| 128 | +- Git tag: `v2.0.4.0` (with 'v' prefix) |
| 129 | +- Version in files: `2.0.4.0` (without 'v') |
| 130 | + |
| 131 | +## Workflow Triggers Explained |
| 132 | + |
| 133 | +### Push to Branch (e.g., `avnish/migrateWinUI`) |
| 134 | + |
| 135 | +```yaml |
| 136 | +on: |
| 137 | + push: |
| 138 | + branches: [ main, avnish/migrateWinUI ] |
| 139 | +``` |
| 140 | + |
| 141 | +**Runs**: Build jobs only (no release) |
| 142 | +**Purpose**: Verify builds work |
| 143 | +**Result**: Artifacts available for 30 days |
| 144 | + |
| 145 | +### Push Version Tag (e.g., `v2.0.4.0`) |
| 146 | + |
| 147 | +```yaml |
| 148 | +on: |
| 149 | + push: |
| 150 | + tags: |
| 151 | + - 'v*' |
| 152 | +``` |
| 153 | + |
| 154 | +**Runs**: All jobs including release |
| 155 | +**Purpose**: Create public release |
| 156 | +**Result**: GitHub Release with downloadable packages |
| 157 | + |
| 158 | +### Pull Request |
| 159 | + |
| 160 | +```yaml |
| 161 | +on: |
| 162 | + pull_request: |
| 163 | + branches: [ main ] |
| 164 | +``` |
| 165 | + |
| 166 | +**Runs**: Build jobs only (no release) |
| 167 | +**Purpose**: Verify PR doesn't break builds |
| 168 | +**Result**: Status check on PR |
| 169 | + |
| 170 | +### Manual Trigger |
| 171 | + |
| 172 | +```yaml |
| 173 | +on: |
| 174 | + workflow_dispatch: |
| 175 | +``` |
| 176 | + |
| 177 | +**How**: Go to Actions tab ? Select workflow ? Run workflow |
| 178 | +**Runs**: Build jobs only (no release unless on tag) |
| 179 | +**Purpose**: Test workflow manually |
| 180 | + |
| 181 | +## Common Issues |
| 182 | + |
| 183 | +### Issue: Tag Already Exists |
| 184 | + |
| 185 | +**Error**: `tag 'v2.0.4.0' already has this tag` |
| 186 | + |
| 187 | +**Solution**: Delete and recreate tag: |
| 188 | +```sh |
| 189 | +# Delete local tag |
| 190 | +git tag -d v2.0.4.0 |
| 191 | +
|
| 192 | +# Delete remote tag |
| 193 | +git push origin :refs/tags/v2.0.4.0 |
| 194 | +
|
| 195 | +# Recreate and push |
| 196 | +git tag -a v2.0.4.0 -m "Release version 2.0.4.0" |
| 197 | +git push origin v2.0.4.0 |
| 198 | +``` |
| 199 | + |
| 200 | +### Issue: Release Created But Empty |
| 201 | + |
| 202 | +**Cause**: Workflow completed before artifacts were uploaded |
| 203 | + |
| 204 | +**Solution**: |
| 205 | +1. Delete the release from GitHub |
| 206 | +2. Delete the tag: `git push origin :refs/tags/v2.0.4.0` |
| 207 | +3. Re-create and push the tag |
| 208 | + |
| 209 | +### Issue: Release Job Still Skipped |
| 210 | + |
| 211 | +**Check**: |
| 212 | +1. Did you push a **tag** (not just a commit)? |
| 213 | +2. Does the tag start with 'v'? (e.g., `v2.0.4.0`) |
| 214 | +3. Check workflow logs for the condition evaluation |
| 215 | + |
| 216 | +### Issue: Wrong Version in Release |
| 217 | + |
| 218 | +**Cause**: Version numbers not updated before tagging |
| 219 | + |
| 220 | +**Solution**: |
| 221 | +1. Delete the release and tag |
| 222 | +2. Update version numbers |
| 223 | +3. Commit changes |
| 224 | +4. Create new tag |
| 225 | + |
| 226 | +## Testing Before Release |
| 227 | + |
| 228 | +Before creating a release tag: |
| 229 | + |
| 230 | +### 1. Test Builds Locally |
| 231 | + |
| 232 | +```powershell |
| 233 | +# Test MSIX bundle |
| 234 | +.\BuildMsixBundle.ps1 |
| 235 | +
|
| 236 | +# Test installer |
| 237 | +.\BuildInstaller.ps1 |
| 238 | +``` |
| 239 | + |
| 240 | +### 2. Push to Branch First |
| 241 | + |
| 242 | +```sh |
| 243 | +git push origin avnish/migrateWinUI |
| 244 | +``` |
| 245 | + |
| 246 | +Watch GitHub Actions to ensure builds succeed. |
| 247 | + |
| 248 | +### 3. Download and Test Artifacts |
| 249 | + |
| 250 | +1. Go to Actions tab |
| 251 | +2. Click on latest workflow run |
| 252 | +3. Download artifacts: |
| 253 | + - `msix-bundle` |
| 254 | + - `installer` |
| 255 | +4. Test installation on clean VM |
| 256 | + |
| 257 | +### 4. Only Then Create Release Tag |
| 258 | + |
| 259 | +Once everything works, create the version tag. |
| 260 | + |
| 261 | +## Release Checklist |
| 262 | + |
| 263 | +Use this checklist before creating a release: |
| 264 | + |
| 265 | +- [ ] Version updated in `Package.appxmanifest` |
| 266 | +- [ ] Version updated in `InnoSetup.iss` |
| 267 | +- [ ] CHANGELOG.md updated |
| 268 | +- [ ] All changes committed and pushed |
| 269 | +- [ ] Branch builds passing on GitHub Actions |
| 270 | +- [ ] Artifacts downloaded and tested |
| 271 | +- [ ] Ready to create tag |
| 272 | + |
| 273 | +Then: |
| 274 | + |
| 275 | +- [ ] Create version tag: `git tag -a v2.0.4.0 -m "Release version 2.0.4.0"` |
| 276 | +- [ ] Push tag: `git push origin v2.0.4.0` |
| 277 | +- [ ] Monitor GitHub Actions workflow |
| 278 | +- [ ] Verify release created successfully |
| 279 | +- [ ] Test download links |
| 280 | +- [ ] Announce release (if applicable) |
| 281 | + |
| 282 | +## Automating Releases |
| 283 | + |
| 284 | +For automated releases in CI/CD pipelines, use the `CreateRelease.ps1` script: |
| 285 | + |
| 286 | +```powershell |
| 287 | +# In your CI/CD pipeline |
| 288 | +.\CreateRelease.ps1 -Version $env:VERSION_NUMBER |
| 289 | +``` |
| 290 | + |
| 291 | +Or directly: |
| 292 | + |
| 293 | +```sh |
| 294 | +git tag -a "v${VERSION}" -m "Release version ${VERSION}" |
| 295 | +git push origin "v${VERSION}" |
| 296 | +``` |
| 297 | + |
| 298 | +## Release Notes Customization |
| 299 | + |
| 300 | +The workflow auto-generates release notes. To customize: |
| 301 | + |
| 302 | +Edit `.github/workflows/build-and-release.yml`: |
| 303 | + |
| 304 | +```yaml |
| 305 | +- name: Create Release Notes |
| 306 | + id: release_notes |
| 307 | + run: | |
| 308 | + $notes = @" |
| 309 | + ## Your Custom Release Notes |
| 310 | + |
| 311 | + ### What's New in ${{ steps.get_version.outputs.VERSION }} |
| 312 | + - Feature 1 |
| 313 | + - Feature 2 |
| 314 | + - Bug fix 3 |
| 315 | + |
| 316 | + [Full Changelog](https://github.com/avikeid2007/Ping-Tool/compare/v2.0.3.0...v${{ steps.get_version.outputs.VERSION }}) |
| 317 | + "@ |
| 318 | +``` |
| 319 | + |
| 320 | +## Resources |
| 321 | + |
| 322 | +- [GitHub Releases Documentation](https://docs.github.com/en/repositories/releasing-projects-on-github) |
| 323 | +- [Git Tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging) |
| 324 | +- [Semantic Versioning](https://semver.org/) |
| 325 | + |
| 326 | +--- |
| 327 | + |
| 328 | +**Quick Reference**: |
| 329 | +```sh |
| 330 | +# Create and push release tag |
| 331 | +git tag -a v2.0.4.0 -m "Release version 2.0.4.0" |
| 332 | +git push origin v2.0.4.0 |
| 333 | +
|
| 334 | +# Watch progress |
| 335 | +# https://github.com/avikeid2007/Ping-Tool/actions |
| 336 | +
|
| 337 | +# View release |
| 338 | +# https://github.com/avikeid2007/Ping-Tool/releases |
| 339 | +``` |
0 commit comments