Skip to content

Commit

Permalink
Add support for arm64 builds for charm-local-users (#39)
Browse files Browse the repository at this point in the history
This ports the release.yaml changes from charm-local-users to here. :)
  • Loading branch information
samuelallan72 authored Aug 6, 2024
1 parent c7dcbba commit a83cba1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
8 changes: 7 additions & 1 deletion terraform-plans/configs/charm-local-users_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ templates = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
branch = "main"
branch = "main",
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-latest], [Ubuntu_ARM64_4C_16G_01]]",
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ templates = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
branch = "main"
branch = "main",
runs_on = "ubuntu-latest",
}
}
}
1 change: 1 addition & 0 deletions terraform-plans/templates/github/charm_check.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
with:
provider: "lxd"
juju-channel: $${{ matrix.juju-channel }}
charmcraft-channel: "2.x/stable"

- name: Install latest tox version
run: |
Expand Down
19 changes: 13 additions & 6 deletions terraform-plans/templates/github/charm_release.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,24 @@ jobs:

release:
needs: check
runs-on: ubuntu-latest
runs-on: $${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: ${runs_on}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize lxd # This should dropped once it's implemented on charming-actions itself. https://github.com/canonical/charming-actions/issues/140
uses: canonical/setup-lxd@v0.1.1
- name: Upload charm to charmhub
uses: canonical/charming-actions/upload-charm@2.4.0
# revision is latest main at time of writing; using because it contains a fix to https://github.com/canonical/setup-lxd/issues/19
uses: canonical/setup-lxd@2aa6f7caf7d1484298a64192f7f63a6684e648a4

- name: Pack and upload to charmhub
uses: canonical/charming-actions/upload-charm@2.6.2
with:
charmcraft-channel: "2.x/stable"
credentials: "$${{ secrets.CHARMHUB_TOKEN }}"
github-token: "$${{ secrets.GITHUB_TOKEN }}"
channel: "latest/edge"
# Note(rgildein): Right now we are not using destructive-mode, since our charmcraft.yaml is designed with a single build-on and the ability to run-on multiple bases. Running with destructive-mode would require aligning the base defined in this job with the one defined in charmcraft.yaml (build-on).
# Ensure the charm is built in an isolated environment and on the correct base in an lxd container.
destructive-mode: false

0 comments on commit a83cba1

Please sign in to comment.