Skip to content

Commit

Permalink
static build
Browse files Browse the repository at this point in the history
  • Loading branch information
qurious-pixel committed Apr 25, 2024
1 parent 2544715 commit 9b46936
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,34 @@ jobs:
strategy:
matrix:
ARCH: [x86_64, i386, aarch64, armhf]
USE_STATIC_RUNTIME: [""]
UPDATE: ["1"]

include:
# test build
- ARCH: x86_64
DOCKER_ARCH: amd64
BUILD_TYPE: coverage

# experimental build
- ARCH: x86_64
BUILD_TYPE: appimage
USE_STATIC_RUNTIME: -static

fail-fast: false

name: ${{ matrix.ARCH }}
name: ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME }}
runs-on: ubuntu-latest

env:
ARCH: ${{ matrix.ARCH }}
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
DEBIAN_FRONTEND: interactive
USE_STATIC_RUNTIME: ${{ matrix.USE_STATIC_RUNTIME }}

steps:
# check out once git command is available
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -31,10 +45,10 @@ jobs:
run: bash ci/build-in-docker.sh

- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: AppImage ${{ matrix.ARCH }}
path: linuxdeploy-plugin-qt-${{ matrix.ARCH }}.AppImage*
name: AppImage ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME}}
path: linuxdeploy-plugin-qt${{ matrix.USE_STATIC_RUNTIME}}-${{ matrix.ARCH }}.AppImage*

upload:
name: Create release and upload artifacts
Expand All @@ -43,7 +57,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Create release and upload artifacts
Expand All @@ -52,4 +66,4 @@ jobs:
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **/linuxdeploy-plugin-qt*.AppImage*
./pyuploadtool-x86_64.AppImage **/linuxdeploy*.AppImage*
3 changes: 2 additions & 1 deletion ci/build-in-docker.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ run_in_docker() {
-i \
--init \
-e GITHUB_RUN_NUMBER \
-e USE_STATIC_RUNTIME \
-e ARCH \
-e CI \
--user "$uid" \
Expand All @@ -118,4 +119,4 @@ run_in_docker() {
}

run_in_docker bash ci/build.sh
run_in_docker bash ci/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage
run_in_docker bash ci/test.sh linuxdeploy-plugin-qt"$USE_STATIC_RUNTIME"-"$ARCH".AppImage
13 changes: 12 additions & 1 deletion ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ patchelf_path="$(which patchelf)"
strip_path="$(which strip)"

export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-qt|continuous|linuxdeploy-plugin-qt-$ARCH.AppImage"
export OUTPUT="linuxdeploy-plugin-qt-$ARCH.AppImage"

# special set of builds using a different experimental runtime, used for testing purposes
if [[ "${USE_STATIC_RUNTIME:-}" != "" ]]; then
custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-$ARCH"
wget "$custom_runtime_url"
runtime_filename="$(echo "$custom_runtime_url" | rev | cut -d/ -f1 | rev)"
LDAI_RUNTIME_FILE="$(readlink -f "$runtime_filename")"
export LDAI_RUNTIME_FILE
export OUTPUT="linuxdeploy-plugin-qt-static-$ARCH.AppImage"
fi

wget "https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage"
# qemu is not happy about the AppImage type 2 magic bytes, so we need to "fix" that
Expand All @@ -56,4 +67,4 @@ chmod +x linuxdeploy*.AppImage
-e "$strip_path" \
--output appimage

mv linuxdeploy-plugin-qt-"$ARCH".AppImage* "$OLD_CWD"/
mv "$OUTPUT"* "$OLD_CWD"/

0 comments on commit 9b46936

Please sign in to comment.