File tree 3 files changed +80
-19
lines changed
3 files changed +80
-19
lines changed Original file line number Diff line number Diff line change 11
11
jobs :
12
12
appimage :
13
13
strategy :
14
+ fail-fast : false
14
15
matrix :
15
- arch : [' x86_64', ' i386' ]
16
+ ARCH : [x86_64, i386]
16
17
17
- name : AppImage ${{ matrix.arch }}
18
+ name : AppImage ${{ matrix.ARCH }}
18
19
runs-on : ubuntu-20.04
19
20
env :
20
21
ARCH : ${{ matrix.ARCH }}
22
+ APPIMAGE_EXTRACT_AND_RUN : 1
21
23
steps :
22
- - uses : actions/checkout@v2
24
+ - uses : actions/checkout@v3
23
25
with :
24
26
submodules : recursive
25
- - name : Install dependencies
26
- if : ${{ matrix.ARCH == 'i386' }}
27
- run : |
28
- sudo dpkg --add-architecture i386
29
- sudo apt-get update
30
- sudo apt-get install -y g++-multilib libc6-dev:i386 libstdc++-5-dev:i386 zlib1g:i386 libfuse2:i386
31
- - name : Build AppImage
32
- run : bash -ex ci/build-appimage.sh
27
+ - name : Set up QEMU integration for Docker
28
+ run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
29
+ - name : Run build in Docker
30
+ run : bash -euxo pipefail ci/build-in-docker.sh
33
31
- name : Archive artifacts
34
- uses : actions/upload-artifact@v2
32
+ uses : actions/upload-artifact@v3
35
33
with :
36
34
name : AppImage ${{ matrix.ARCH }}
37
35
path : linuxdeploy-plugin-appimage*.AppImage*
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -e
4
- set -x
3
+ set -euxo pipefail
5
4
6
5
# use RAM disk if possible
7
- if [ " $CI " == " " ] && [ -d /dev/shm ]; then
8
- TEMP_BASE=/dev/shm
6
+ if [ " ${CI :- } " == " " ] && [ -d /docker-ramdisk ]; then
7
+ TEMP_BASE=/docker-ramdisk
9
8
else
10
9
TEMP_BASE=/tmp
11
10
fi
12
11
13
12
BUILD_DIR=$( mktemp -d -p " $TEMP_BASE " linuxdeploy-plugin-appimage-build-XXXXXX)
14
13
15
- cleanup () {
14
+ cleanup () {
16
15
if [ -d " $BUILD_DIR " ]; then
17
16
rm -rf " $BUILD_DIR "
18
17
fi
@@ -51,7 +50,6 @@ chmod +x linuxdeploy-"$ARCH".AppImage
51
50
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-" $AIK_ARCH " .AppImage
52
51
53
52
chmod +x appimagetool-" $AIK_ARCH " .AppImage
54
- dd if=/dev/zero of=appimagetool-" $AIK_ARCH " .AppImage bs=1 count=3 seek=8 conv=notrunc
55
53
56
54
./appimagetool-" $AIK_ARCH " .AppImage --appimage-extract
57
55
mv squashfs-root/ AppDir/appimagetool-prefix/
@@ -60,7 +58,6 @@ ln -s ../../appimagetool-prefix/AppRun AppDir/usr/bin/appimagetool
60
58
export UPD_INFO=" gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-appimage|continuous|linuxdeploy-plugin-appimage-$ARCH .AppImage"
61
59
62
60
# deploy linuxdeploy-plugin-appimage
63
- dd if=/dev/zero of=linuxdeploy-x86_64.AppImage bs=1 count=3 seek=8 conv=notrunc
64
61
./linuxdeploy-" $ARCH " .AppImage --appimage-extract-and-run \
65
62
--appdir AppDir -d " $REPO_ROOT " /resources/linuxdeploy-plugin-appimage.desktop \
66
63
-i " $REPO_ROOT " /resources/linuxdeploy-plugin-appimage.svg
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -euxo pipefail
4
+
5
+ if [[ " ${ARCH:- } " == " " ]]; then
6
+ echo " Usage: env ARCH=... bash $0 "
7
+ exit 1
8
+ fi
9
+
10
+ case " $ARCH " in
11
+ x86_64)
12
+ image_prefix=amd64
13
+ platform=linux/amd64
14
+ ;;
15
+ i386)
16
+ image_prefix=i386
17
+ platform=linux/i386
18
+ ;;
19
+ armhf)
20
+ image_prefix=arm32v7
21
+ platform=linux/arm/v7
22
+ ;;
23
+ aarch64)
24
+ image_prefix=arm64v8
25
+ platform=linux/arm64/v8
26
+ ;;
27
+ * )
28
+ echo " unknown architecture: $ARCH "
29
+ exit 2
30
+ ;;
31
+ esac
32
+
33
+ image=" $image_prefix " /debian:stable
34
+
35
+ repo_root=" $( readlink -f " $( dirname " ${BASH_SOURCE[0]} " ) " /..) "
36
+
37
+ # run the build with the current user to
38
+ # a) make sure root is not required for builds
39
+ # b) allow the build scripts to "mv" the binaries into the /out directory
40
+ uid=" $( id -u) "
41
+
42
+ # make sure Docker image is up to date
43
+ docker pull " $image "
44
+
45
+ docker run \
46
+ --platform " $platform " \
47
+ --rm \
48
+ -i \
49
+ -e ARCH \
50
+ -e GITHUB_ACTIONS \
51
+ -e GITHUB_RUN_NUMBER \
52
+ -e OUT_UID=" $uid " \
53
+ -v " $repo_root " :/source:ro \
54
+ -v " $PWD " :/out \
55
+ -w /out \
56
+ --tmpfs /docker-ramdisk:exec,mode=777 \
57
+ " $image " \
58
+ bash -exo pipefail \
59
+ << \EOF
60
+
61
+ apt-get update
62
+ apt-get install -y gcc g++ cmake git wget file curl
63
+
64
+ bash -euxo pipefail ci/build-appimage.sh
65
+
66
+ EOF
You can’t perform that action at this time.
0 commit comments