mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-03 16:56:18 +00:00
Update demo.yml
This commit is contained in:
parent
6689abe018
commit
c8153164fa
1 changed files with 18 additions and 58 deletions
76
.github/workflows/demo.yml
vendored
76
.github/workflows/demo.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Test Release X-UI
|
name: Build for ARM32
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -8,28 +8,20 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
runs-on: ubuntu-20.04 # Chọn phiên bản Ubuntu tương thích với ARM32-bit
|
||||||
matrix:
|
|
||||||
platform: [amd64, arm64, arm]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3.6.0
|
uses: actions/checkout@v2.4.3
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4.1.0
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.21'
|
go-version: '1.16' # Chọn phiên bản Go tương thích
|
||||||
|
|
||||||
- name: Install dependencies for arm64 and arm
|
- name: Install dependencies
|
||||||
if: matrix.platform != 'amd64' # Install dependencies only for non-amd64 platforms
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
if [ "${{ matrix.platform }}" == "arm64" ]; then
|
sudo apt-get install -y gcc-arm-linux-gnueabi
|
||||||
sudo apt install gcc-aarch64-linux-gnu
|
|
||||||
elif [ "${{ matrix.platform }}" == "arm" ]; then
|
|
||||||
sudo apt install gcc-arm-linux-gnueabi
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
|
@ -40,52 +32,20 @@ jobs:
|
||||||
go get github.com/shirou/gopsutil/v3/mem
|
go get github.com/shirou/gopsutil/v3/mem
|
||||||
go get github.com/shirou/gopsutil/v3/net
|
go get github.com/shirou/gopsutil/v3/net
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
if [ "${{ matrix.platform }}" == "arm" ]; then
|
export GOARCH=arm
|
||||||
export GOARCH=arm
|
export GOARM=7 # Chọn phiên bản ARM (armv7a)
|
||||||
export CC=arm-linux-gnueabi-gcc
|
export CC=arm-linux-gnueabi-gcc
|
||||||
else
|
|
||||||
export GOARCH=${{ matrix.platform }}
|
|
||||||
fi
|
|
||||||
go build -o xui-release -v main.go
|
go build -o xui-release -v main.go
|
||||||
|
|
||||||
mkdir x-ui
|
|
||||||
cp xui-release x-ui/
|
|
||||||
cp x-ui.service x-ui/
|
|
||||||
cp x-ui.sh x-ui/
|
|
||||||
mv x-ui/xui-release x-ui/x-ui
|
|
||||||
mkdir x-ui/bin
|
|
||||||
cd x-ui/bin
|
|
||||||
|
|
||||||
# Download dependencies
|
|
||||||
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
|
||||||
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.4/Xray-linux-64.zip
|
|
||||||
unzip Xray-linux-64.zip
|
|
||||||
rm -f Xray-linux-64.zip
|
|
||||||
else
|
|
||||||
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.4/Xray-linux-arm64-v8a.zip
|
|
||||||
unzip Xray-linux-arm64-v8a.zip
|
|
||||||
rm -f Xray-linux-arm64-v8a.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
|
|
||||||
wget https://github.com/MasterKia/iran-hosted-domains/releases/latest/download/iran.dat
|
|
||||||
mv xray xray-linux-${{ matrix.platform }}
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: tar -zcvf x-ui-linux-${{ matrix.platform }}.tar.gz x-ui
|
run: tar -zcvf x-ui-linux-arm.tar.gz xui-release
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: svenstaro/upload-release-action@2.7.0
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
name: x-ui-linux-arm
|
||||||
tag: ${{ github.ref }}
|
path: x-ui-linux-arm.tar.gz
|
||||||
file: x-ui-linux-${{ matrix.platform }}.tar.gz
|
|
||||||
asset_name: x-ui-linux-${{ matrix.platform }}.tar.gz
|
|
||||||
prerelease: true
|
|
||||||
overwrite: true
|
|
||||||
|
|
Loading…
Reference in a new issue