From 1d89daf5633d8a7c1ae97c2689050bf91debfcf7 Mon Sep 17 00:00:00 2001 From: quydang <81231812+quydang04@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:16:30 +0700 Subject: [PATCH] Update armv7.yml --- .github/workflows/armv7.yml | 39 +++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/armv7.yml b/.github/workflows/armv7.yml index dd2fb824..693655b5 100644 --- a/.github/workflows/armv7.yml +++ b/.github/workflows/armv7.yml @@ -1,4 +1,4 @@ -name: Release X-UI armv7 +name: Release X-UI on: push: @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - platform: [armv7] # Thêm nền tảng armv7 vào danh sách + platform: [amd64, arm64, armv7] # Thêm armv7 vào danh sách runs-on: ubuntu-latest steps: - name: Checkout repository @@ -27,6 +27,12 @@ jobs: sudo apt-get update sudo apt install gcc-aarch64-linux-gnu + - name: Install dependencies for armv7 # Thêm bước cài đặt cho armv7 + if: matrix.platform == 'armv7' + run: | + sudo apt-get update + sudo apt install gcc-arm-linux-gnueabihf + - name: Get dependencies run: | go get github.com/shirou/gopsutil/v3/cpu @@ -36,13 +42,16 @@ jobs: go get github.com/shirou/gopsutil/v3/mem go get github.com/shirou/gopsutil/v3/net - - name: Build for armv7 - if: matrix.platform == 'armv7' + - name: Build run: | export CGO_ENABLED=1 export GOOS=linux - export GOARCH=arm - export GOARM=7 + export GOARCH=${{ matrix.platform }} + if [ "${{ matrix.platform }}" == "arm64" ]; then + export CC=aarch64-linux-gnu-gcc + elif [ "${{ matrix.platform }}" == "armv7" ]; then # Thêm điều kiện cho armv7 + export CC=arm-linux-gnueabihf-gcc + fi go build -o xui-release -v main.go mkdir x-ui @@ -54,10 +63,20 @@ jobs: cd x-ui/bin # Download dependencies - wget https://github.com/XTLS/Xray-core/releases/download/v1.8.4/Xray-linux-32.zip - unzip -o Xray-linux-32.zip - rm -f Xray-linux-32.zip - + if [ "${{ matrix.platform }}" == "amd64" ]; then + wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip + unzip Xray-linux-64.zip + rm -f Xray-linux-64.zip + elif [ "${{ matrix.platform }}" == "arm64" ]; then + wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-arm64-v8a.zip + unzip Xray-linux-arm64-v8a.zip + rm -f Xray-linux-arm64-v8a.zip + elif [ "${{ matrix.platform }}" == "armv7" ]; then # Thêm điều kiện cho armv7 + # Giữ liên kết tải về cho armv7 nguyên thủy + wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-32.zip + unzip Xray-linux-32.zip + rm -f Xray-linux-32.zip + fi rm -f geoip.dat geosite.dat iran.dat wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat