ci(snap): use native Github arm64 runners

This commit introduces another dimension to the
snap building matrix. Critically, it means the
build pipeline no longer relies upon Snapcraft's
reomte build capability - which simplifies both
the pipeline itself, and should  make debugging
easier.
This commit is contained in:
Jon Seager 2025-01-17 09:04:49 +02:00
parent 6a5fa714ae
commit 0311bcecc4
No known key found for this signature in database

View file

@ -145,43 +145,27 @@ jobs:
path: yazi-${{ matrix.target }}.zip path: yazi-${{ matrix.target }}.zip
build-snap: build-snap:
if: false # Can't make CI pass, disable for now
strategy: strategy:
matrix: matrix:
arch: include:
- amd64 - os: ubuntu-24.04
- arm64 arch: amd64
runs-on: ubuntu-latest - os: ubuntu-24.04
arch: arm64
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: canonical/setup-lxd@v0.1.2 - name: Setup LXD
uses: canonical/setup-lxd@v0.1.2
- name: Setup snapcraft - name: Setup snapcraft
run: | run: sudo snap install --classic snapcraft
sudo snap install --classic snapcraft
mkdir -p ~/.local/share/snapcraft
echo "${{ secrets.LP_TOKEN }}" > ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "Github Actions"
- name: Build snap - name: Build snap
env: run: snapcraft --verbose
arch: ${{ matrix.arch }}
run: |
# Modify the `platforms` to use a single arch only, but run this in a matrix so they
# all get hit
yq -i '.platforms |= {env(arch): {"build-on": env(arch)}}' snap/snapcraft.yaml
# Now run a remote-build, targeting just the single arch specified
snapcraft remote-build --launchpad-accept-public-upload
# Output the build logs from the remote-build
cat snapcraft-yazi*.txt || echo "Could not find build log"
- name: Rename snap - name: Rename snap
run: mv yazi_*.snap yazi-${{ matrix.arch }}.snap run: mv yazi_*.snap yazi-${{ matrix.arch }}.snap