Skip to content

Commit bb6546a

Browse files
committed
Fix GHCR primary tag display by reordering manifest tags
Workflow changes: - Reorder tags in manifest creation: sha → stable → latest → version - Version tag now listed last (GHCR displays last tag as primary) - Applies to all images: ESP-IDF, ESP-Matter, PlatformIO Cursor rules updates: - Add 'Tag ordering' to Critical Details - Document tag ordering in 'Tag Ordering in Manifests' section - Update workflow template to show correct order Rationale: - GHCR UI shows last created tag as the 'primary' display tag - Previously showed 'sha-XXXXXXX' which is not user-friendly - Now shows version tag (e.g., 'idf-v5.4.1', 'pio-v6.1.18') - More informative for users browsing GHCR package pages - All tags still work correctly, this only affects UI display Result: - GHCR will show: jethome-dev-esp-idf idf-v5.4.1 (instead of sha-a2a2e80) - GHCR will show: jethome-dev-platformio pio-v6.1.18 (instead of sha-a2a2e80)
1 parent a2a2e80 commit bb6546a

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.cursor/rules/github-actions-standards.mdc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ jobs:
173173

174174
- name: 🎯 Create multi-arch manifest
175175
run: |
176-
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:latest \
176+
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:sha-${{ steps.tags.outputs.sha_short }} \
177177
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:stable \
178+
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:latest \
178179
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:<prefix>-${{ matrix.version }} \
179-
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:sha-${{ steps.tags.outputs.sha_short }} \
180180
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:<prefix>-${{ matrix.version }}-linux-amd64 \
181181
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.<IMAGE_NAME> }}:<prefix>-${{ matrix.version }}-linux-arm64
182182
```
@@ -188,6 +188,7 @@ jobs:
188188
- **Cache scoping**: Use image name variable for cache scope: `scope=${{ env.<IMAGE_NAME> }}-${{ steps.platform.outputs.tag }}`
189189
- **Timeouts**: Build jobs use `timeout-minutes: 60`, manifest jobs use `timeout-minutes: 10`
190190
- **Fail-fast**: Use `fail-fast: false` to see all platform failures
191+
- **Tag ordering**: Version tag must be listed LAST in manifest creation (GHCR displays last tag as primary)
191192
- Matrix builds both platforms in parallel for faster CI
192193
- Platform-specific images tagged with arch suffix (e.g., `pio-6.1.18-linux-amd64`)
193194
- Manifest job combines platform images into multi-arch manifest
@@ -267,6 +268,12 @@ jobs:
267268
- `sha-<commit>` - Git commit tracking for debugging/rollback
268269
- **No date tags** - Version tags are semantic and clear; SHA tags provide precise tracking
269270

271+
**Tag Ordering in Manifests:**
272+
- Version tag must be listed LAST in `docker buildx imagetools create` command
273+
- GHCR displays the last created tag as the "primary" tag in the UI
274+
- Order: `sha-<commit>` → `stable` → `latest` → `<prefix>-v<version>` (last = primary display)
275+
- This ensures GHCR shows the informative version tag (e.g., `idf-v5.4.1`) instead of `sha-XXXXXXX`
276+
270277
## Workflow Testing
271278

272279
### Local Testing with act

.github/workflows/esp-idf.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ jobs:
104104
105105
- name: 🎯 Create multi-arch manifest
106106
run: |
107-
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:latest \
107+
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
108108
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:stable \
109+
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:latest \
109110
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:idf-${{ matrix.idf_base_tag }} \
110-
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
111111
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:idf-${{ matrix.idf_base_tag }}-linux-amd64 \
112112
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_IDF_IMAGE_NAME }}:idf-${{ matrix.idf_base_tag }}-linux-arm64
113113
@@ -190,9 +190,9 @@ jobs:
190190
191191
- name: 🎯 Create multi-arch manifest for ESP-Matter
192192
run: |
193-
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:latest \
193+
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
194194
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:stable \
195+
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:latest \
195196
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:idf-${{ matrix.jethome_idf_base_tag }}-matter-${{ matrix.esp_matter_version }} \
196-
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
197197
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:idf-${{ matrix.jethome_idf_base_tag }}-matter-${{ matrix.esp_matter_version }}-linux-amd64 \
198198
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.ESP_MATTER_IMAGE_NAME }}:idf-${{ matrix.jethome_idf_base_tag }}-matter-${{ matrix.esp_matter_version }}-linux-arm64

.github/workflows/platformio.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ jobs:
100100
101101
- name: 🎯 Create multi-arch manifest
102102
run: |
103-
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:latest \
103+
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
104104
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:stable \
105+
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:latest \
105106
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:pio-${{ matrix.pio_version }} \
106-
-t ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:sha-${{ steps.tags.outputs.sha_short }} \
107107
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:pio-${{ matrix.pio_version }}-linux-amd64 \
108108
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.PLATFORMIO_IMAGE_NAME }}:pio-${{ matrix.pio_version }}-linux-arm64

0 commit comments

Comments
 (0)