Skip to content

Commit d718cfe

Browse files
Support ARM for snap (#2410)
1 parent bb50f16 commit d718cfe

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
timeout-minutes: 30
3737
strategy:
3838
matrix:
39-
os: [macos-15-intel, ubuntu-22.04]
39+
os: [macos-15-intel, ubuntu-22.04, ubuntu-22.04-arm]
4040
steps:
4141
- uses: actions/checkout@v4
4242
- uses: pnpm/action-setup@v4
@@ -59,10 +59,10 @@ jobs:
5959
# fileName: 'win-certificate.pfx'
6060
# encodedString: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
6161
- name: Setup LXD
62-
if: matrix.os == 'ubuntu-22.04' && startsWith(github.ref, 'refs/tags/')
62+
if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
6363
uses: canonical/setup-lxd@v0.1.3
6464
- name: Setup Snapcraft for Publishing
65-
if: matrix.os == 'ubuntu-22.04' && startsWith(github.ref, 'refs/tags/')
65+
if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
6666
run: |
6767
sudo snap install snapcraft --classic
6868
echo "/snap/bin" >> $GITHUB_PATH
@@ -74,16 +74,17 @@ jobs:
7474
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
7575
# WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }}
7676
# WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
77-
- name: List files in out directory
78-
if: matrix.os == 'ubuntu-22.04' && startsWith(github.ref, 'refs/tags/')
79-
run: |
80-
echo "Contents of out directory:"
81-
ls -la out/
82-
echo "Looking for snap files:"
83-
find out/ -name "*.snap" -o -name "*snap*" | head -10
8477
- name: Publish Snap to Snap Store
85-
if: matrix.os == 'ubuntu-22.04' && startsWith(github.ref, 'refs/tags/')
86-
run: snapcraft upload $(find out/make/snap/x64/ -name "swach_*_amd64.snap") --release latest/stable
78+
if: startsWith(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/')
79+
run: |
80+
if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then
81+
SNAP_ARCH="arm64"
82+
ELECTRON_ARCH="arm64"
83+
else
84+
SNAP_ARCH="amd64"
85+
ELECTRON_ARCH="x64"
86+
fi
87+
snapcraft upload $(find out/make/snap/${ELECTRON_ARCH}/ -name "swach_*_${SNAP_ARCH}.snap") --release latest/stable
8788
env:
8889
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
8990
- name: GitHub release

forge.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ const config: ForgeConfig = {
9494
'/usr/lib/x86_64-linux-gnu/imlib2': {
9595
bind: '$SNAP/usr/lib/x86_64-linux-gnu/imlib2',
9696
},
97+
'/usr/lib/aarch64-linux-gnu/imlib2': {
98+
bind: '$SNAP/usr/lib/aarch64-linux-gnu/imlib2',
99+
},
97100
},
98101
appConfig: {
99102
extensions: ['gnome'],

0 commit comments

Comments
 (0)