Skip to content

Commit 347a163

Browse files
committed
Add arm64 support to tagged releases.
1 parent 1c24ef1 commit 347a163

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/tags.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
if: github.repository == 'redis/redis-snap'
1112
steps:
1213
- uses: actions/checkout@v2
1314
- name: Determine version
@@ -18,12 +19,28 @@ jobs:
1819
repository: redis/redis
1920
ref: ${{ env.VERSION }}
2021
path: redis
22+
- name: Prepare for cross-compilation
23+
run: |
24+
sudo dpkg --add-architecture arm64
25+
sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
26+
cat <<_END_ | sudo tee /etc/apt/sources.list.d/crosscompile.list
27+
deb [arch=arm64] http://ports.ubuntu.com $(lsb_release -cs) main universe
28+
deb [arch=arm64] http://ports.ubuntu.com $(lsb_release -cs)-updates main universe
29+
_END_
2130
- name: Setup Snapcraft
2231
run: |
23-
sudo snap install snapcraft --classic
24-
echo "$SNAP_TOKEN" | snapcraft login --with -
25-
snapcraft
26-
snapcraft upload --release=stable *.snap
32+
sudo snap install snapcraft --classic
33+
echo "$SNAP_TOKEN" | snapcraft login --with -
2734
env:
2835
SNAP_TOKEN: ${{secrets.SNAP_TOKEN}}
36+
- name: Build amd64
37+
env:
2938
SNAPCRAFT_BUILD_ENVIRONMENT: host
39+
run: snapcraft --target-arch amd64 --destructive-mode --enable-experimental-target-arch
40+
- name: Build arm64
41+
env:
42+
SNAPCRAFT_BUILD_ENVIRONMENT: host
43+
run: snapcraft --target-arch arm64 --destructive-mode --enable-experimental-target-arch
44+
- name: Upload
45+
run: |
46+
for f in *.snap; do snapcraft upload --release=stable $f; done

0 commit comments

Comments
 (0)