mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
ci(snap): enable snapcraft build across platforms
This commit is contained in:
parent
0bd5d2fe9e
commit
2e49ba1add
1 changed files with 29 additions and 6 deletions
35
.github/workflows/draft.yml
vendored
35
.github/workflows/draft.yml
vendored
|
|
@ -145,12 +145,11 @@ 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:
|
||||||
include:
|
arch:
|
||||||
- os: ubuntu-latest
|
- amd64
|
||||||
target: x86_64-unknown-linux-gnu
|
- arm64
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -158,8 +157,32 @@ jobs:
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.6
|
uses: mozilla-actions/sccache-action@v0.0.6
|
||||||
|
|
||||||
- name: Build
|
- name: Setup LXD
|
||||||
uses: snapcore/action-build@v1
|
uses: canonical/setup-lxd@v1
|
||||||
|
|
||||||
|
- name: Setup snapcraft
|
||||||
|
run: |
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
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-${name}*${arch}*.txt || echo "Could not find build log"
|
||||||
|
|
||||||
- name: Rename snap
|
- name: Rename snap
|
||||||
run: mv yazi_*.snap yazi-${{ matrix.target }}.snap
|
run: mv yazi_*.snap yazi-${{ matrix.target }}.snap
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue