Skip to content

fix: implement proper multi-arch support in publish workflow - #30

Merged
c-vigo merged 4 commits into
mainfrom
dev
Jan 28, 2026
Merged

c-vigo merged 4 commits into
mainfrom
dev

Conversation

@c-vigo

@c-vigo c-vigo commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR enhances the publish-container-image.yml workflow with architecture validation and dynamic architecture selection. Users can now specify which architectures to build (amd64, arm64, or both) when manually triggering the workflow, with comprehensive validation to ensure only valid architectures are processed.

Changes

1. Architecture Input Validation

  • New Job: validate-architectures (lines 103-160)
    • Parses comma-separated architecture input from workflow_dispatch
    • Validates each architecture against allowed values: amd64, arm64
    • Rejects invalid architectures with clear error messages
    • Checks for duplicate architectures
    • Generates dynamic JSON matrix for build job

2. Dynamic Build Matrix

  • Updated: build job now uses dynamic matrix from validation
    • matrix: ${{ fromJson(needs.validate-architectures.outputs.matrix) }}
    • Builds only the architectures specified by the user
    • For tag pushes, always builds both architectures (default behavior)

3. Smart Manifest Creation

  • Enhanced: manifest job dynamically handles built architectures
    • Verifies and includes only the architectures that were actually built
    • Creates version-specific manifest with selected architectures
    • Updates latest tag only for tag pushes with both architectures
    • Skips latest tag for single-architecture or manual workflow runs

4. Bug Fixes

  • Fixed default architecture value: 'amd64,arm' → 'amd64,arm64'
  • Fixed ARM runner name: 'ubuntu-22.04-arm' → 'ubuntu-22.04-arm64'

Usage Examples

Manual Workflow Dispatch

Build only amd64:

architectures: amd64

Build only arm64:

architectures: arm64

Build both (default):

architectures: amd64,arm64

Tag Pushes

  • Always builds both architectures (amd64,arm64)
  • Creates multi-arch manifest and updates latest tag

Validation Behavior

Valid Inputs

  • amd64
  • arm64
  • amd64,arm64
  • arm64,amd64
  • amd64, arm64 (spaces are removed)

Benefits

  1. Flexibility: Users can test single-architecture builds without waiting for both
  2. Cost Efficiency: Save CI minutes by building only needed architectures during development
  3. Safety: Validation prevents typos and invalid architecture specifications
  4. Clear Errors: Comprehensive error messages guide users to correct inputs
  5. Smart Defaults: Tag pushes always build both architectures for production releases

Testing

The changes can be tested by:

  1. Manual workflow dispatch with different architecture combinations
  2. Verifying validation errors for invalid inputs
  3. Checking that tag pushes still build both architectures

Documentation Updated

  • Updated CHANGELOG.md for version 0.2.1
  • Added architecture validation feature documentation

Related Issues

Closes #[issue-number] (if applicable)

@c-vigo c-vigo self-assigned this Jan 28, 2026
@c-vigo
c-vigo merged commit 068a74f into main Jan 28, 2026
@c-vigo
c-vigo deleted the dev branch January 28, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant