|
61 | 61 |
|
62 | 62 | #### Building for multiple CPU architectures
|
63 | 63 |
|
64 |
| -To build for CPU architectures other than `x86_64`, the GitHub Actions workflow has to either natively be running on that architecture (e.g. on an `cch64` self-hosted GitHub Actions runner), or the container used must be configured to emulate the requested architecture (e.g. with QEMU). |
| 64 | +To build for CPU architectures other than `x86_64`, the GitHub Actions workflow has to either natively be running on that architecture (e.g. on an `aarch64` self-hosted GitHub Actions runner), or the container used must be configured to emulate the requested architecture (e.g. with QEMU). |
65 | 65 |
|
66 | 66 | For example, to build a Flatpak for both `x86_64` and `aarch64` using emulation, use the following workflow as a guide:
|
67 | 67 |
|
@@ -107,6 +107,44 @@ jobs:
|
107 | 107 | arch: ${{ matrix.arch }}
|
108 | 108 | ```
|
109 | 109 |
|
| 110 | +#### Multi arch build using public ARM64 runners |
| 111 | + |
| 112 | +Since, January 2025, [GitHub offers public ARM64 runners](https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/). |
| 113 | +So a multi-arch build can be performed using that. |
| 114 | + |
| 115 | +```yaml |
| 116 | +name: CI |
| 117 | +
|
| 118 | +on: |
| 119 | + push: |
| 120 | + branches: [main] |
| 121 | + pull_request: |
| 122 | +
|
| 123 | +jobs: |
| 124 | + flatpak: |
| 125 | + name: "Flatpak" |
| 126 | + container: |
| 127 | + image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48 |
| 128 | + options: --privileged |
| 129 | + strategy: |
| 130 | + matrix: |
| 131 | + variant: |
| 132 | + - arch: x86_64 |
| 133 | + runner: ubuntu-24.04 |
| 134 | + - arch: aarch64 |
| 135 | + runner: ubuntu-24.04-arm |
| 136 | + runs-on: ${{ matrix.variant.runner }} |
| 137 | + steps: |
| 138 | + - uses: actions/checkout@<commit hash> |
| 139 | + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 |
| 140 | + with: |
| 141 | + bundle: palette.flatpak |
| 142 | + manifest-path: org.gnome.zbrown.Palette.yml |
| 143 | + cache-key: flatpak-builder-${{ github.sha }} |
| 144 | + arch: ${{ matrix.variant.arch }} |
| 145 | + verbose: true |
| 146 | +``` |
| 147 | + |
110 | 148 | #### Building for Automated Tests
|
111 | 149 |
|
112 | 150 | As described in the [Inputs](#inputs) documentation, specifying `run-tests: true` will amend the Flatpak manifest to enable Network and X11 access automatically. Any other changes to the manifest must be made manually, such as building the tests (e.g. `-Dtests=true`) or any other options (e.g. `--buildtype=debugoptimized`).
|
|
0 commit comments