|
| 1 | +# Release Guide |
| 2 | + |
| 3 | +This document covers how to create releases for each component in the repository. |
| 4 | + |
| 5 | +## Tag Convention |
| 6 | + |
| 7 | +Each component uses a prefixed tag to trigger its release workflow: |
| 8 | + |
| 9 | +| Component | Tag pattern | Example | Workflow | |
| 10 | +|-----------|------------|---------|----------| |
| 11 | +| CLI | `cli/v<semver>` | `cli/v1.2.3` | `.github/workflows/cli-release.yaml` | |
| 12 | +| Karpenter | `karpenter/v<semver>` | `karpenter/v0.5.0` | `.github/workflows/karpenter-publish.yaml` | |
| 13 | + |
| 14 | +All tags must follow [Semantic Versioning](https://semver.org/). |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## CLI Release |
| 19 | + |
| 20 | +The CLI release workflow builds cross-platform binaries with [GoReleaser](https://goreleaser.com/) and publishes them as a GitHub Release. |
| 21 | + |
| 22 | +### Artifacts |
| 23 | + |
| 24 | +Each release includes: |
| 25 | + |
| 26 | +- `aks-flex-cli_<version>_linux_amd64.tar.gz` |
| 27 | +- `aks-flex-cli_<version>_linux_arm64.tar.gz` |
| 28 | +- `aks-flex-cli_<version>_darwin_arm64.tar.gz` |
| 29 | +- `checksums.txt` |
| 30 | +- Auto-generated changelog |
| 31 | + |
| 32 | +### Steps |
| 33 | + |
| 34 | +1. Make sure all changes are merged to `main`. |
| 35 | + |
| 36 | +2. Decide on a version number following semver (e.g. `v1.0.0`). |
| 37 | + |
| 38 | +3. Create and push the tag: |
| 39 | + |
| 40 | + ```bash |
| 41 | + git tag cli/v1.0.0 |
| 42 | + git push origin cli/v1.0.0 |
| 43 | + ``` |
| 44 | + |
| 45 | +4. The [Release CLI](.../../.github/workflows/cli-release.yaml) workflow runs automatically. Monitor it in the **Actions** tab. |
| 46 | + |
| 47 | +5. Once complete, the GitHub Release appears under **Releases** with all binary archives attached. |
| 48 | + |
| 49 | +### Local Snapshot Build |
| 50 | + |
| 51 | +To build binaries locally without publishing: |
| 52 | + |
| 53 | +```bash |
| 54 | +cd cli |
| 55 | +make build # binaries only |
| 56 | +make build-archives # binaries + tar.gz archives |
| 57 | +``` |
| 58 | + |
| 59 | +Snapshot builds append a `-snapshot-<commit>` suffix to the version. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Karpenter Release |
| 64 | + |
| 65 | +The Karpenter workflow builds a multi-platform Docker image and pushes it to GHCR. |
| 66 | + |
| 67 | +### Image |
| 68 | + |
| 69 | +``` |
| 70 | +ghcr.io/<owner>/aks-flex/karpenter:<tag> |
| 71 | +``` |
| 72 | + |
| 73 | +### Triggers |
| 74 | + |
| 75 | +The workflow runs on: |
| 76 | + |
| 77 | +- Push to `main` when files under `karpenter/` or `plugin/` change (tagged as `main` and `sha-<short>`). |
| 78 | +- A `karpenter/v*` tag push (tagged with the semver and `latest`). |
| 79 | +- Manual `workflow_dispatch`. |
| 80 | + |
| 81 | +### Steps |
| 82 | + |
| 83 | +1. Make sure all changes are merged to `main`. |
| 84 | + |
| 85 | +2. Decide on a version number (e.g. `v0.5.0`). |
| 86 | + |
| 87 | +3. Create and push the tag: |
| 88 | + |
| 89 | + ```bash |
| 90 | + git tag karpenter/v0.5.0 |
| 91 | + git push origin karpenter/v0.5.0 |
| 92 | + ``` |
| 93 | + |
| 94 | +4. The [Publish Karpenter Image](../../.github/workflows/karpenter-publish.yaml) workflow runs automatically. |
| 95 | + |
| 96 | +5. Once complete, the image is available at: |
| 97 | + |
| 98 | + ``` |
| 99 | + ghcr.io/<owner>/aks-flex/karpenter:0.5.0 |
| 100 | + ghcr.io/<owner>/aks-flex/karpenter:latest |
| 101 | + ``` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Troubleshooting |
| 106 | + |
| 107 | +- **Workflow did not trigger** -- Verify the tag matches the expected pattern exactly (`cli/v*` or `karpenter/v*`). Tags like `CLI/v1.0.0` or `v1.0.0` without a prefix will not trigger the workflows. |
| 108 | +- **GoReleaser fails with "tag is not a semver"** -- Ensure the portion after the prefix is valid semver (e.g. `v1.2.3`, not `v1.2`). |
| 109 | +- **Permission denied on release** -- The workflow requires `contents: write` permission. This is configured in the workflow file but may need to be allowed in the repository settings if the default token permissions are restricted. |
0 commit comments