File tree Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,28 @@ jobs:
14
14
with :
15
15
repository : redis/redis
16
16
path : redis
17
+ - name : Prepare for cross-compilation
18
+ run : |
19
+ sudo dpkg --add-architecture arm64
20
+ sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
21
+ cat <<_END_ | sudo tee /etc/apt/sources.list.d/crosscompile.list
22
+ deb [arch=arm64] http://ports.ubuntu.com $(lsb_release -cs) main universe
23
+ deb [arch=arm64] http://ports.ubuntu.com $(lsb_release -cs)-updates main universe
24
+ _END_
17
25
- name : Setup Snapcraft
18
26
run : |
19
- sudo snap install snapcraft --classic
20
- echo "$SNAP_TOKEN" | snapcraft login --with -
21
- snapcraft
22
- snapcraft upload --release=edge *.snap
27
+ sudo snap install snapcraft --classic
28
+ echo "$SNAP_TOKEN" | snapcraft login --with -
23
29
env :
24
30
SNAP_TOKEN : ${{secrets.SNAP_TOKEN}}
31
+ - name : Build amd64
32
+ env :
25
33
SNAPCRAFT_BUILD_ENVIRONMENT : host
34
+ run : snapcraft --target-arch amd64 --destructive-mode --enable-experimental-target-arch
35
+ - name : Build arm64
36
+ env :
37
+ SNAPCRAFT_BUILD_ENVIRONMENT : host
38
+ run : snapcraft --target-arch arm64 --destructive-mode --enable-experimental-target-arch
39
+ - name : Upload
40
+ run : |
41
+ snapcraft upload --release=edge *.snap
Original file line number Diff line number Diff line change 64
64
source : redis/
65
65
override-build : |
66
66
mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr
67
+ export CC=${SNAPCRAFT_ARCH_TRIPLET}-gcc
68
+ export DEB_HOST_GNU_TYPE=${SNAPCRAFT_ARCH_TRIPLET}
67
69
make -j4 BUILD_TLS=yes
68
70
PREFIX=${SNAPCRAFT_PART_INSTALL}/usr make BUILD_TLS=yes install
69
71
VER=`sed -n 's/^.* REDIS_VERSION "\(.*\)"$/\1/g p' < src/version.h`
73
75
fi
74
76
snapcraftctl set-version $VER
75
77
build-packages :
76
- - build-essential
77
- - pkg-config
78
- - libssl-dev
79
- - gcc
78
+ - on amd64 :
79
+ - to arm64 :
80
+ - libssl-dev:arm64
81
+ - to amd64 :
82
+ - libssl-dev
You can’t perform that action at this time.
0 commit comments