Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 65 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
outfile: lde-macos-x86-64
- os: macos-15
outfile: lde-macos-aarch64
- os: ubuntu-22.04
- os: ubuntu-22.04-arm
outfile: lde-android-aarch64
android: true

Expand Down Expand Up @@ -76,19 +76,82 @@ jobs:
shell: pwsh
run: echo "SEA_CC=aarch64-w64-mingw32-clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Cache Android NDK
if: matrix.android
id: cache-android-ndk
uses: actions/cache@v5
with:
path: android-ndk-r29
key: android-ndk-r29-aarch64

- name: Setup Android NDK
if: matrix.android
run: |
if [[ "${{ steps.cache-android-ndk.outputs.cache-hit }}" != "true" ]]; then
wget -q https://github.com/lzhiyong/termux-ndk/releases/download/android-ndk/android-ndk-r29-aarch64.7z
7z x android-ndk-r29-aarch64.7z -o. > /dev/null
fi
echo "ANDROID_NDK_ROOT=$PWD/android-ndk-r29" >> $GITHUB_ENV

- name: Set SEA_CC (Android)
if: matrix.android
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV

- name: Install macOS build deps
if: startsWith(matrix.os, 'macos')
run: brew install autoconf automake libtool

- uses: lde-org/setup-lde@master
if: "!matrix.android"
with:
version: nightly

- name: Setup lde (Android)
if: matrix.android
uses: lde-org/setup-lde@master
with:
version: nightly
platform: Android
arch: aarch64

- name: Cache curl-sys build
uses: actions/cache@v5
with:
path: packages/*/target/curl-sys
key: curl-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}

- name: Build lde
if: "!matrix.android"
run: |
cd packages/lde
lde compile --outfile ${{ matrix.outfile }}

- name: Fix workspace permissions (Android)
if: matrix.android
run: chmod -R a+rw ${{ github.workspace }}

- name: Setup Android build image
if: matrix.android
run: |
docker run --privileged --platform linux/arm64 --name termux-build \
-e DEBIAN_FRONTEND=noninteractive \
termux/termux-docker:aarch64 \
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make cmake autoconf automake libtool openssl perl"
docker commit termux-build termux-android:latest
docker rm termux-build

- name: Build lde (Android)
if: matrix.android
run: |
docker run --rm --privileged \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-v $HOME/.lde/lde:/workspace/lde \
-w /workspace \
-e ANDROID_NDK_ROOT=/workspace/android-ndk-r29 \
termux-android:latest \
bash -c "/workspace/lde --setup && cd /workspace/packages/lde && /workspace/lde compile --outfile /workspace/packages/lde/${{ matrix.outfile }}"

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,31 @@ jobs:
if: matrix.android
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV

- name: Install macOS build deps
if: startsWith(matrix.os, 'macos')
run: brew install autoconf automake libtool

- uses: lde-org/setup-lde@master
if: "!matrix.android"
with:
version: nightly

- name: Setup lde (Android)
if: matrix.android
uses: lde-org/setup-lde@master
with:
version: nightly
platform: Android
arch: aarch64

- name: Cache curl-sys build
uses: actions/cache@v5
with:
path: packages/*/target/curl-sys
key: curl-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}

- name: Build lde
if: "!matrix.android"
run: |
cd packages/lde
lde compile --outfile ${{ matrix.outfile }}
Expand All @@ -128,7 +148,7 @@ jobs:
uses: actions/cache@v5
with:
path: /tmp/termux-android.tar
key: termux-android-v1
key: termux-android-v2

- name: Setup Android test image
if: matrix.android
Expand All @@ -140,7 +160,7 @@ jobs:
docker run --privileged --platform linux/arm64 --name termux-build \
-e DEBIAN_FRONTEND=noninteractive \
termux/termux-docker:aarch64 \
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make"
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make openssl"
docker commit termux-build termux-android:latest
docker rm termux-build
docker save termux-android:latest -o /tmp/termux-android.tar
Expand All @@ -152,9 +172,12 @@ jobs:
docker run --rm --privileged \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-v $HOME/.lde/lde:/workspace/lde \
-w /workspace \
-e ANDROID_NDK_ROOT=/workspace/android-ndk-r29 \
-e LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib \
termux-android:latest \
bash -c "/workspace/packages/lde/${{ matrix.outfile }} test"
bash -c "/workspace/lde --setup && cd /workspace/packages/lde && /workspace/lde compile --outfile /workspace/packages/lde/${{ matrix.outfile }} && /workspace/packages/lde/${{ matrix.outfile }} test"

- name: Upload nightly release asset
uses: softprops/action-gh-release@v2
Expand Down
67 changes: 65 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
outfile: lde-macos-x86-64
- os: macos-15
outfile: lde-macos-aarch64
- os: ubuntu-22.04
- os: ubuntu-22.04-arm
outfile: lde-android-aarch64
android: true

Expand Down Expand Up @@ -80,19 +80,82 @@ jobs:
shell: pwsh
run: echo "SEA_CC=aarch64-w64-mingw32-clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Cache Android NDK
if: matrix.android
id: cache-android-ndk
uses: actions/cache@v5
with:
path: android-ndk-r29
key: android-ndk-r29-aarch64

- name: Setup Android NDK
if: matrix.android
run: |
if [[ "${{ steps.cache-android-ndk.outputs.cache-hit }}" != "true" ]]; then
wget -q https://github.com/lzhiyong/termux-ndk/releases/download/android-ndk/android-ndk-r29-aarch64.7z
7z x android-ndk-r29-aarch64.7z -o. > /dev/null
fi
echo "ANDROID_NDK_ROOT=$PWD/android-ndk-r29" >> $GITHUB_ENV

- name: Set SEA_CC (Android)
if: matrix.android
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV

- name: Install macOS build deps
if: startsWith(matrix.os, 'macos')
run: brew install autoconf automake libtool

- uses: lde-org/setup-lde@master
if: "!matrix.android"
with:
version: nightly

- name: Setup lde (Android)
if: matrix.android
uses: lde-org/setup-lde@master
with:
version: nightly
platform: Android
arch: aarch64

- name: Cache curl-sys build
uses: actions/cache@v5
with:
path: packages/*/target/curl-sys
key: curl-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}

- name: Build lde
if: "!matrix.android"
run: |
cd packages/lde
lde compile --outfile ${{ matrix.outfile }}

- name: Fix workspace permissions (Android)
if: matrix.android
run: chmod -R a+rw ${{ github.workspace }}

- name: Setup Android build image
if: matrix.android
run: |
docker run --privileged --platform linux/arm64 --name termux-build \
-e DEBIAN_FRONTEND=noninteractive \
termux/termux-docker:aarch64 \
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make cmake autoconf automake libtool openssl perl"
docker commit termux-build termux-android:latest
docker rm termux-build

- name: Build lde (Android)
if: matrix.android
run: |
docker run --rm --privileged \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-v $HOME/.lde/lde:/workspace/lde \
-w /workspace \
-e ANDROID_NDK_ROOT=/workspace/android-ndk-r29 \
termux-android:latest \
bash -c "/workspace/lde --setup && cd /workspace/packages/lde && /workspace/lde compile --outfile /workspace/packages/lde/${{ matrix.outfile }}"

- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,34 @@ jobs:
if: matrix.android
run: echo "SEA_CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV

- name: Install macOS build deps
if: startsWith(matrix.os, 'macos')
run: brew install autoconf automake libtool

- uses: lde-org/setup-lde@master
if: "!matrix.android"
with:
version: nightly

- name: Setup lde (Android)
if: matrix.android
uses: lde-org/setup-lde@master
with:
version: nightly
platform: Android
arch: aarch64

- name: Cache curl-sys build
uses: actions/cache@v5
with:
path: packages/*/target/curl-sys
key: curl-sys-${{ matrix.os }}-${{ runner.arch }}${{ matrix.android && '-android' || '' }}

- name: Build lde
# lde's own tests invoke the lde binary directly (e.g. to test CLI flags),
# so we must compile a fresh binary from source before running tests.
# Using the pre-installed nightly binary would miss any CLI changes in this PR.
if: "!matrix.android"
run: |
cd packages/lde
lde compile --outfile ${{ env.OUTFILE }}
Expand All @@ -121,7 +141,7 @@ jobs:
uses: actions/cache@v5
with:
path: /tmp/termux-android.tar
key: termux-android-v1
key: termux-android-v2

- name: Setup Android test image
if: matrix.android
Expand All @@ -133,7 +153,7 @@ jobs:
docker run --privileged --platform linux/arm64 --name termux-build \
-e DEBIAN_FRONTEND=noninteractive \
termux/termux-docker:aarch64 \
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make"
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make cmake autoconf automake libtool openssl perl"
docker commit termux-build termux-android:latest
docker rm termux-build
docker save termux-android:latest -o /tmp/termux-android.tar
Expand All @@ -145,6 +165,9 @@ jobs:
docker run --rm --privileged \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-v $HOME/.lde/lde:/workspace/lde \
-w /workspace \
-e ANDROID_NDK_ROOT=/workspace/android-ndk-r29 \
-e LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib \
termux-android:latest \
bash -c "/workspace/packages/lde/${{ env.OUTFILE }} test"
bash -c "/workspace/lde --setup && cd /workspace/packages/lde && /workspace/lde compile --outfile /workspace/packages/lde/${{ env.OUTFILE }} && cd /workspace && /workspace/packages/lde/${{ env.OUTFILE }} test"
7 changes: 0 additions & 7 deletions packages/http/lde.json

This file was deleted.

44 changes: 0 additions & 44 deletions packages/http/src/init.lua

This file was deleted.

2 changes: 1 addition & 1 deletion packages/lde-core/lde.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"fs": { "path": "../fs" },
"env": { "path": "../env" },
"util": { "path": "../util" },
"http": { "path": "../http" },
"curl-sys": { "git": "https://github.com/lde-org/curl-sys" },
"semver": { "path": "../semver" },
"lde-test": { "path": "../lde-test" },
"git": { "path": "../git" },
Expand Down
Loading
Loading