mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
ci: use GitHub Linux arm64 runners for the snap build (#2214)
This commit is contained in:
parent
3e1c8950f2
commit
ebaf2c29c1
2 changed files with 10 additions and 37 deletions
36
.github/workflows/draft.yml
vendored
36
.github/workflows/draft.yml
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,6 @@ parts:
|
||||||
- usr/lib/libMagickCore-7.Q16HDRI.so*
|
- usr/lib/libMagickCore-7.Q16HDRI.so*
|
||||||
- usr/lib/libMagickWand-7.Q16HDRI.so*
|
- usr/lib/libMagickWand-7.Q16HDRI.so*
|
||||||
|
|
||||||
# Most of what is done here should be done in the `yazi` part, but using
|
|
||||||
# `override-prime` there stops snapcraft from automatically patching ELF
|
|
||||||
# binaries (due to a bug), so we do that work here in a separate part.
|
|
||||||
cleanup:
|
cleanup:
|
||||||
after: [yazi, magick]
|
after: [yazi, magick]
|
||||||
plugin: nil
|
plugin: nil
|
||||||
|
|
@ -149,14 +146,6 @@ parts:
|
||||||
# executable at $SNAP/usr/bin/7zz.
|
# executable at $SNAP/usr/bin/7zz.
|
||||||
mv $CRAFT_PRIME/usr/lib/7zip/7zz $CRAFT_PRIME/usr/bin/7zz
|
mv $CRAFT_PRIME/usr/lib/7zip/7zz $CRAFT_PRIME/usr/bin/7zz
|
||||||
|
|
||||||
# The snapcraft linter highlighted issues with the rpath of these two libraries,
|
|
||||||
# so we fix them up manually here after they are primed in the yazi part.
|
|
||||||
patchelf --force-rpath --set-rpath "\$ORIGIN:\$ORIGIN/pulseaudio:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" $CRAFT_PRIME/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libpulse.so.0.24.2
|
|
||||||
patchelf --force-rpath --set-rpath "\$ORIGIN/lapack:\$ORIGIN/blas:\$ORIGIN:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" $CRAFT_PRIME/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libsphinxbase.so.3.0.0
|
|
||||||
patchelf --force-rpath --set-rpath "\$ORIGIN/../lib:\$ORIGIN/../lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" $CRAFT_PRIME/usr/bin/magick
|
|
||||||
patchelf --force-rpath --set-rpath "\$ORIGIN/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" $CRAFT_PRIME/usr/lib/libMagickCore-7.Q16HDRI.so.10.0.2
|
|
||||||
patchelf --force-rpath --set-rpath "\$ORIGIN:\$ORIGIN/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" $CRAFT_PRIME/usr/lib/libMagickWand-7.Q16HDRI.so.10.0.2
|
|
||||||
|
|
||||||
# Ensure we don't ship duplicates of files that exist in the core24
|
# Ensure we don't ship duplicates of files that exist in the core24
|
||||||
# snap.
|
# snap.
|
||||||
cd /snap/core24/current
|
cd /snap/core24/current
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue