mirror of
https://github.com/kunkunsh/kunkun-ext-neohtop.git
synced 2025-04-04 09:46:43 +00:00
183 lines
7.3 KiB
YAML
183 lines
7.3 KiB
YAML
name: Linux (aarch64) Nightly Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_upload_url:
|
|
description: 'Release upload URL'
|
|
required: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
PKG_CONFIG_ALLOW_CROSS: 1
|
|
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
|
|
PKG_CONFIG: /usr/bin/aarch64-linux-gnu-pkg-config
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Linux aarch64 Packages
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'lts/*'
|
|
cache: 'npm'
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-unknown-linux-gnu
|
|
|
|
- name: Configure ARM64 repositories
|
|
run: |
|
|
sudo dpkg --add-architecture arm64
|
|
# Remove all existing sources
|
|
sudo rm -rf /etc/apt/sources.list.d/*
|
|
sudo truncate -s 0 /etc/apt/sources.list
|
|
# Add only ports.ubuntu.com repository
|
|
sudo tee /etc/apt/sources.list << EOF
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse
|
|
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
|
|
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
|
|
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse
|
|
EOF
|
|
sudo apt-get update
|
|
# Install required packages including cross-compilation tools
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
pkg-config \
|
|
crossbuild-essential-arm64 \
|
|
gcc-aarch64-linux-gnu \
|
|
g++-aarch64-linux-gnu \
|
|
libgtk-3-dev:arm64 \
|
|
libayatana-appindicator3-dev:arm64 \
|
|
librsvg2-dev:arm64 \
|
|
libglib2.0-dev:arm64 \
|
|
libjavascriptcoregtk-4.0-dev:arm64 \
|
|
libsoup-3.0-dev:arm64 \
|
|
libwebkit2gtk-4.1-dev:arm64 \
|
|
libssl-dev:arm64 \
|
|
libssl-dev \
|
|
openssl:arm64
|
|
# Configure pkg-config for cross-compilation
|
|
echo "PKG_CONFIG=/usr/bin/aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV
|
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
|
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
|
|
- name: Setup cross-compilation environment
|
|
run: |
|
|
sudo apt-get install -y \
|
|
crossbuild-essential-arm64 \
|
|
pkg-config \
|
|
libssl-dev:arm64 \
|
|
libssl-dev \
|
|
openssl:arm64 \
|
|
file \
|
|
desktop-file-utils \
|
|
libfuse2 \
|
|
qemu-user-static
|
|
|
|
# Setup pkg-config
|
|
sudo tee /usr/bin/aarch64-linux-gnu-pkg-config << 'EOF'
|
|
#!/bin/sh
|
|
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
|
|
exec pkg-config "$@"
|
|
EOF
|
|
sudo chmod +x /usr/bin/aarch64-linux-gnu-pkg-config
|
|
|
|
# Create .cargo/config
|
|
mkdir -p .cargo
|
|
cat > .cargo/config << EOF
|
|
[target.aarch64-unknown-linux-gnu]
|
|
linker = "aarch64-linux-gnu-gcc"
|
|
ar = "aarch64-linux-gnu-ar"
|
|
EOF
|
|
|
|
# Download and setup appimagetool for ARM64
|
|
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage
|
|
chmod +x appimagetool-aarch64.AppImage
|
|
sudo mv appimagetool-aarch64.AppImage /usr/local/bin/appimagetool
|
|
|
|
# Set environment variables
|
|
echo "PKG_CONFIG=/usr/bin/aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV
|
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
|
echo "OPENSSL_DIR=/usr" >> $GITHUB_ENV
|
|
echo "OPENSSL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
|
|
echo "OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
|
|
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
echo "APPIMAGE_EXTRACT_AND_RUN=1" >> $GITHUB_ENV
|
|
|
|
- name: Build Frontend
|
|
run: npm run build
|
|
|
|
- name: Build AppImage
|
|
run: |
|
|
echo "Building AppImage for aarch64..."
|
|
npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles appimage
|
|
cd src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/
|
|
for f in *.AppImage; do
|
|
echo "AARCH64_APPIMAGE_PATH=src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/$f" >> $GITHUB_ENV
|
|
done
|
|
|
|
- name: Build Debian Package
|
|
run: |
|
|
echo "Building Debian package for aarch64..."
|
|
npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles deb
|
|
cd src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/
|
|
for f in *.deb; do
|
|
echo "AARCH64_DEB_PATH=src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/$f" >> $GITHUB_ENV
|
|
done
|
|
|
|
- name: Build RPM Package
|
|
run: |
|
|
echo "Building RPM package for aarch64..."
|
|
npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles rpm
|
|
cd src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/rpm/
|
|
for f in *.rpm; do
|
|
echo "AARCH64_RPM_PATH=src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/rpm/$f" >> $GITHUB_ENV
|
|
done
|
|
|
|
- name: Get version from package.json
|
|
id: version
|
|
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload AppImage to Release
|
|
if: github.event.inputs.release_upload_url != ''
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.inputs.release_upload_url }}
|
|
asset_path: ${{ env.AARCH64_APPIMAGE_PATH }}
|
|
asset_name: NeoHtop_${{ steps.version.outputs.version }}_aarch64.AppImage
|
|
asset_content_type: application/x-executable
|
|
|
|
- name: Upload Debian Package to Release
|
|
if: github.event.inputs.release_upload_url != ''
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.inputs.release_upload_url }}
|
|
asset_path: ${{ env.AARCH64_DEB_PATH }}
|
|
asset_name: NeoHtop_${{ steps.version.outputs.version }}_aarch64.deb
|
|
asset_content_type: application/vnd.debian.binary-package
|
|
|
|
- name: Upload RPM Package to Release
|
|
if: github.event.inputs.release_upload_url != ''
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.inputs.release_upload_url }}
|
|
asset_path: ${{ env.AARCH64_RPM_PATH }}
|
|
asset_name: NeoHtop_${{ steps.version.outputs.version }}_aarch64.rpm
|
|
asset_content_type: application/x-rpm |