setup arm64 emulated builder
This commit is contained in:
parent
dfde9df3c3
commit
ef96801df5
1 changed files with 56 additions and 26 deletions
82
.github/workflows/build.yml
vendored
82
.github/workflows/build.yml
vendored
|
@ -66,10 +66,15 @@ jobs:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: https://github.com/docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
- name: Clone Main Repo
|
- name: Clone Main Repo
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://github.com/liamcottle/reticulum-meshchat reticulum-meshchat
|
git clone --depth 1 https://github.com/liamcottle/reticulum-meshchat reticulum-meshchat
|
||||||
|
|
||||||
- name: Get Latest Tag
|
- name: Get Latest Tag
|
||||||
working-directory: ./reticulum-meshchat
|
working-directory: ./reticulum-meshchat
|
||||||
run: |
|
run: |
|
||||||
|
@ -79,34 +84,59 @@ jobs:
|
||||||
echo "Latest tag is $LATEST_TAG"
|
echo "Latest tag is $LATEST_TAG"
|
||||||
git checkout $LATEST_TAG
|
git checkout $LATEST_TAG
|
||||||
|
|
||||||
- name: Install NodeJS
|
- name: Setup ARM64 Build Environment
|
||||||
uses: https://github.com/actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install Python
|
|
||||||
uses: https://github.com/actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.11"
|
|
||||||
|
|
||||||
- name: Install Python Deps
|
|
||||||
working-directory: ./reticulum-meshchat
|
|
||||||
run: pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: Install NodeJS Deps
|
|
||||||
working-directory: ./reticulum-meshchat
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Install Cross-Compilation Tools
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
sudo apt-get install -y qemu-user-static binfmt-support
|
||||||
|
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
|
||||||
- name: Build Electron App for AArch64
|
- name: Set up Docker Buildx
|
||||||
working-directory: ./reticulum-meshchat
|
uses: docker/setup-buildx-action@v3
|
||||||
run: npm run dist
|
|
||||||
env:
|
- name: Build in ARM64 Container
|
||||||
ELECTRON_BUILDER_ARCH: arm64
|
run: |
|
||||||
|
cat > Dockerfile << 'EOF'
|
||||||
|
FROM arm64v8/ubuntu:22.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git curl wget python3 python3-pip \
|
||||||
|
build-essential libssl-dev \
|
||||||
|
fakeroot rpm libsqlite3-dev libffi-dev \
|
||||||
|
libx11-dev libxkbfile-dev libsecret-1-dev \
|
||||||
|
libasound2 libnss3 libxtst6 libglib2.0-0 libgconf-2-4
|
||||||
|
|
||||||
|
# Install Node.js 18
|
||||||
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
|
RUN apt-get install -y nodejs
|
||||||
|
|
||||||
|
# Set up working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy application code
|
||||||
|
COPY ./reticulum-meshchat /app
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pip3 install -r requirements.txt
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Build the AppImage
|
||||||
|
CMD npm run dist
|
||||||
|
EOF
|
||||||
|
|
||||||
|
docker buildx build --platform linux/arm64 -t arm64-build-env .
|
||||||
|
|
||||||
|
# Run the build process in the container
|
||||||
|
docker run --platform linux/arm64 --rm -v $(pwd)/reticulum-meshchat:/app \
|
||||||
|
-e ELECTRON_BUILDER_ARCH=arm64 \
|
||||||
|
-v $(pwd)/dist:/app/dist \
|
||||||
|
arm64-build-env
|
||||||
|
|
||||||
|
# Copy the built artifacts
|
||||||
|
mkdir -p reticulum-meshchat/dist
|
||||||
|
cp -r dist/* reticulum-meshchat/dist/ || true
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
Loading…
Add table
Reference in a new issue