Skip to content

Commit

Permalink
feat(ci): Enhance CI workflow to support Linux ARM64 builds and clean…
Browse files Browse the repository at this point in the history
… up Windows build artifacts
  • Loading branch information
chenx-dust committed Jan 20, 2025
1 parent 2accd90 commit 72b6f26
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
tar -xf zju-connect-windows-amd64.zip
rm zju-connect-windows-amd64.zip
cp ../libs/wintun/bin/amd64/wintun.dll .
rm vc_redist.x64.exe
cd ..
Compress-Archive -Path "${{ env.DISPLAY_NAME }}" -DestinationPath ${{ env.ARCHIVE_NAME }}.zip
Expand Down Expand Up @@ -371,6 +372,76 @@ jobs:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}.AppImage

build-linux-arm64:
runs-on: ubuntu-22.04-arm
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-linux-x64
steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: 'linux_arm64'
target: 'desktop'
arch: 'linux_gcc_arm64'
modules: 'qt5compat'
cache: 'true'
cache-key-prefix: 'install-qt-action'

- name: Configure
env:
NIGHTLY_BUILD: ${{ inputs.nightly || github.event_name != 'release' }}
RELEASE_VERSION: ${{ inputs.version || github.event.release.tag_name }}
run: |
mkdir build
if ${{ env.NIGHTLY_BUILD }} ; then
cmake -DNIGHTLY_BUILD=ON -DGIT_HASH=$(git rev-parse --short=7 HEAD) -S . -B build
else
VER=${{ env.RELEASE_VERSION }}
cmake -DNIGHTLY_BUILD=OFF -DREL_VER=${VER#v} -S . -B build
fi
- name: Build
run: |
cmake --build build --target ${{ env.TARGET_NAME }} --parallel $(nproc)
- name: Download and copy files
run: |
sudo apt install -y libxcb-cursor0 fuse
wget -O linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-aarch64.AppImage
wget -O linuxdeploy-plugin-qt https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-plugin-qt-aarch64.AppImage
chmod a+x linuxdeploy linuxdeploy-plugin-qt
mkdir AppDir
mkdir -p AppDir/usr/bin AppDir/usr/lib AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/scalable/apps
cp build/${{ env.TARGET_NAME }} AppDir/usr/bin/
wget -O zju-connect-linux-arm64.zip https://github.com/Mythologyli/zju-connect/releases/latest/download/zju-connect-linux-arm64.zip
unzip zju-connect-linux-arm64.zip
cp zju-connect AppDir/usr/bin/
cp resource/icon.png AppDir/usr/share/icons/hicolor/scalable/apps/${{ env.TARGET_NAME }}.png
cat <<EOF > AppDir/usr/share/applications/${{ env.TARGET_NAME }}.desktop
[Desktop Entry]
Name=${{ env.DISPLAY_NAME }}
Exec=${{ env.TARGET_NAME }}
Icon=${{ env.TARGET_NAME }}
Type=Application
Categories=Network;Security;
EOF
./linuxdeploy --appdir AppDir --output appimage --plugin qt
mv *.AppImage ${{ env.ARCHIVE_NAME }}.AppImage
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}.AppImage

release:
runs-on: ubuntu-latest
if: github.event_name == 'release'
Expand All @@ -380,6 +451,7 @@ jobs:
- build-macos-x64
- build-macos-arm64
- build-linux-x64
- build-linux-arm64
env:
ARCHIVE_PREFIX: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
steps:
Expand Down

0 comments on commit 72b6f26

Please sign in to comment.