Skip to content

Comments

Use charmcraft remote-build for all platforms#405

Draft
Copilot wants to merge 16 commits intomainfrom
copilot/use-charmcraft-remote-build
Draft

Use charmcraft remote-build for all platforms#405
Copilot wants to merge 16 commits intomainfrom
copilot/use-charmcraft-remote-build

Conversation

Copy link

Copilot AI commented Dec 2, 2025

Simplified Implementation: Use charmcraft remote-build for All Platforms

  • Revert changes to _charm-quality-checks.yaml (complexity not needed)
  • Refactor _charm-release.yaml to use only remote-build
    • Remove runners matrix input
    • Remove platform detection logic
    • Use remote-build for all platforms
    • Add LAUNCHPAD_TOKEN as required secret
    • Simplify to single build job
    • Fix charms output in pack step
    • Set up Launchpad credentials properly with secure permissions
  • Code review and security checks completed

Summary

Simplified approach:

  • No more matrix builds: Everything uses charmcraft remote-build
  • No platform detection: Remote-build handles all platforms defined in charmcraft.yaml
  • Cleaner workflow: Single job that builds and releases all platforms
  • Two secrets required: CHARMHUB_TOKEN (for publishing) and LAUNCHPAD_TOKEN (for remote-build)
  • Secure credential setup: LAUNCHPAD_TOKEN is safely written to ~/.local/share/charmcraft/launchpad-credentials with 600 permissions

This approach is simpler and more maintainable than the previous version.

Original prompt

This section details on the original issue you should resolve

<issue_title>Use charmcraft remote-build for s390x and ppc64el</issue_title>
<issue_description>Currently, to pack a charm, we take runner name as input,

runners:
description: |
Json matrix of the runners to use to build and release the charm.
Example: ["ubuntu-latest","Ubuntu_ARM64_4C_16G_03"]
type: string
required: false
default: '["ubuntu-latest"]'

and currently the workflow is limited to packing for amd64 and arm64, because those are the runners available from github.

- name: Pack charm(s)
id: pack
run: |
cd "${{ inputs.charm-path }}"
charmcraft pack -v
charms="$(basename -a ./*.charm | jq -R -s -c 'split("\n")[:-1]')"
echo "charms=$charms"
echo "charms=$charms" >> "$GITHUB_OUTPUT"
- name: Store charm(s)
uses: actions/upload-artifact@v4

To pack for s390x and ppc64el, we can use charmcraft remote-build.
Currently, the absence of this blocks:

In this centralized CI, packing charms for s390x and ppc64el should be done also as part of PR quality checks, but as the last step only after integration tests succeed.

pack-charm:
name: Pack the charm

Since charmcraft remote-build does not yet support --build-for, the CI should attempt a remote build only if the .platforms section is not empty after removing arm64 and amd64.

References:

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 2, 2025 05:38
Co-authored-by: sed-i <82407168+sed-i@users.noreply.github.com>
Co-authored-by: sed-i <82407168+sed-i@users.noreply.github.com>
Copilot AI changed the title [WIP] Use charmcraft remote-build for s390x and ppc64el Add s390x and ppc64el support via charmcraft remote-build Dec 2, 2025
Copilot AI requested a review from sed-i December 2, 2025 05:47
Copy link
Contributor

@sed-i sed-i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot let's simplify things.

Copilot AI and others added 2 commits December 2, 2025 06:31
…hanges

Co-authored-by: sed-i <82407168+sed-i@users.noreply.github.com>
Co-authored-by: sed-i <82407168+sed-i@users.noreply.github.com>
Copilot AI changed the title Add s390x and ppc64el support via charmcraft remote-build Use charmcraft remote-build for all platforms Dec 2, 2025
Copilot AI requested a review from sed-i December 2, 2025 06:36
Signed-off-by: Leon <82407168+sed-i@users.noreply.github.com>
@sinapah
Copy link
Contributor

sinapah commented Dec 3, 2025

@copilot
Let's make sure we set and use LAUNCHPAD_TOKEN correctly. We need to do echo -e "${LAUNCHPAD_TOKEN}" > ~/.local/share/charmcraft/launchpad-credentials so that we have it in the environment before we attempt to do charmcraft remote-build

Copilot AI and others added 2 commits December 3, 2025 21:54
Co-authored-by: sinapah <55766091+sinapah@users.noreply.github.com>
Co-authored-by: sinapah <55766091+sinapah@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 3, 2025

@copilot
Let's make sure we set and use LAUNCHPAD_TOKEN correctly. We need to do echo -e "${LAUNCHPAD_TOKEN}" > ~/.local/share/charmcraft/launchpad-credentials so that we have it in the environmen...

Added Launchpad credentials setup in commits 1642421 and 8474c82. The token is now written to ~/.local/share/charmcraft/launchpad-credentials with secure 600 permissions using printf instead of echo -e for safer handling.

Copilot AI requested a review from sinapah December 3, 2025 21:57
- define-matrix
- quality-checks
uses: canonical/observability/.github/workflows/_charm-release.yaml@v1
uses: canonical/observability/.github/workflows/_charm-release.yaml@copilot/use-charmcraft-remote-build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder.

@sinapah sinapah mentioned this pull request Jan 14, 2026
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.

Use charmcraft remote-build for s390x and ppc64el

3 participants