2024-01-15 13:14:13 +03:00
|
|
|
name: Release 3X-UI
|
2023-05-29 15:27:12 +03:00
|
|
|
|
2023-02-09 22:18:06 +03:00
|
|
|
on:
|
2024-10-07 11:35:22 +03:00
|
|
|
workflow_dispatch:
|
2023-04-12 19:19:09 +03:00
|
|
|
push:
|
|
|
|
tags:
|
2024-10-07 11:35:22 +03:00
|
|
|
- "v*.*.*"
|
2023-04-12 19:19:09 +03:00
|
|
|
|
2023-02-09 22:18:06 +03:00
|
|
|
jobs:
|
2023-05-29 15:27:12 +03:00
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-01-15 13:14:13 +03:00
|
|
|
platform:
|
|
|
|
- amd64
|
|
|
|
- arm64
|
|
|
|
- armv7
|
|
|
|
- armv6
|
2024-01-20 12:32:35 +03:00
|
|
|
- 386
|
|
|
|
- armv5
|
2024-04-01 12:11:58 +03:00
|
|
|
- s390x
|
2023-02-09 22:18:06 +03:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2023-05-29 15:27:12 +03:00
|
|
|
- name: Checkout repository
|
2024-02-25 22:01:01 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-05-29 15:27:12 +03:00
|
|
|
|
|
|
|
- name: Setup Go
|
2024-02-25 22:01:01 +03:00
|
|
|
uses: actions/setup-go@v5
|
2023-04-12 19:19:09 +03:00
|
|
|
with:
|
2024-07-12 22:42:32 +03:00
|
|
|
go-version-file: go.mod
|
2024-01-15 13:14:13 +03:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-04-12 19:19:09 +03:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-01-15 17:51:40 +03:00
|
|
|
if [ "${{ matrix.platform }}" == "arm64" ]; then
|
2024-01-15 13:14:13 +03:00
|
|
|
sudo apt install gcc-aarch64-linux-gnu
|
2024-01-20 12:32:35 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "armv7" ]; then
|
|
|
|
sudo apt install gcc-arm-linux-gnueabihf
|
|
|
|
elif [ "${{ matrix.platform }}" == "armv6" ]; then
|
2023-12-19 13:27:04 +03:00
|
|
|
sudo apt install gcc-arm-linux-gnueabihf
|
2024-01-20 12:32:35 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "386" ]; then
|
|
|
|
sudo apt install gcc-i686-linux-gnu
|
|
|
|
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
|
|
|
sudo apt install gcc-arm-linux-gnueabi
|
2024-04-01 12:11:58 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
|
|
|
sudo apt install gcc-s390x-linux-gnu
|
2023-12-19 13:27:04 +03:00
|
|
|
fi
|
2023-05-29 15:27:12 +03:00
|
|
|
|
|
|
|
- name: Build x-ui
|
|
|
|
run: |
|
|
|
|
export CGO_ENABLED=1
|
|
|
|
export GOOS=linux
|
|
|
|
export GOARCH=${{ matrix.platform }}
|
|
|
|
if [ "${{ matrix.platform }}" == "arm64" ]; then
|
2024-01-15 17:51:40 +03:00
|
|
|
export GOARCH=arm64
|
2023-05-29 15:27:12 +03:00
|
|
|
export CC=aarch64-linux-gnu-gcc
|
2024-01-20 12:32:35 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "armv7" ]; then
|
2024-01-15 17:51:40 +03:00
|
|
|
export GOARCH=arm
|
2024-01-15 13:14:13 +03:00
|
|
|
export GOARM=7
|
2023-12-19 13:27:04 +03:00
|
|
|
export CC=arm-linux-gnueabihf-gcc
|
2024-01-20 12:32:35 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "armv6" ]; then
|
|
|
|
export GOARCH=arm
|
|
|
|
export GOARM=6
|
|
|
|
export CC=arm-linux-gnueabihf-gcc
|
|
|
|
elif [ "${{ matrix.platform }}" == "386" ]; then
|
|
|
|
export GOARCH=386
|
|
|
|
export CC=i686-linux-gnu-gcc
|
|
|
|
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
|
|
|
export GOARCH=arm
|
|
|
|
export GOARM=5
|
|
|
|
export CC=arm-linux-gnueabi-gcc
|
2024-04-01 12:11:58 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
|
|
|
export GOARCH=s390x
|
|
|
|
export CC=s390x-linux-gnu-gcc
|
2023-05-29 15:27:12 +03:00
|
|
|
fi
|
|
|
|
go build -o xui-release -v main.go
|
|
|
|
|
2023-04-12 19:19:09 +03:00
|
|
|
mkdir x-ui
|
2023-05-29 15:27:12 +03:00
|
|
|
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
|
2024-10-01 10:35:06 +03:00
|
|
|
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v24.9.30/"
|
2023-05-29 15:27:12 +03:00
|
|
|
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
2024-01-10 21:35:19 +03:00
|
|
|
wget ${Xray_URL}Xray-linux-64.zip
|
2023-05-29 15:27:12 +03:00
|
|
|
unzip Xray-linux-64.zip
|
|
|
|
rm -f Xray-linux-64.zip
|
2023-12-19 13:27:04 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "arm64" ]; then
|
2024-01-10 21:35:19 +03:00
|
|
|
wget ${Xray_URL}Xray-linux-arm64-v8a.zip
|
2023-05-29 15:27:12 +03:00
|
|
|
unzip Xray-linux-arm64-v8a.zip
|
|
|
|
rm -f Xray-linux-arm64-v8a.zip
|
2024-01-15 13:14:13 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "armv7" ]; then
|
2024-01-10 21:35:19 +03:00
|
|
|
wget ${Xray_URL}Xray-linux-arm32-v7a.zip
|
2023-12-19 13:27:04 +03:00
|
|
|
unzip Xray-linux-arm32-v7a.zip
|
|
|
|
rm -f Xray-linux-arm32-v7a.zip
|
2024-01-15 13:14:13 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "armv6" ]; then
|
|
|
|
wget ${Xray_URL}Xray-linux-arm32-v6.zip
|
|
|
|
unzip Xray-linux-arm32-v6.zip
|
|
|
|
rm -f Xray-linux-arm32-v6.zip
|
2024-01-20 12:32:35 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "386" ]; then
|
|
|
|
wget ${Xray_URL}Xray-linux-32.zip
|
|
|
|
unzip Xray-linux-32.zip
|
|
|
|
rm -f Xray-linux-32.zip
|
|
|
|
elif [ "${{ matrix.platform }}" == "armv5" ]; then
|
|
|
|
wget ${Xray_URL}Xray-linux-arm32-v5.zip
|
|
|
|
unzip Xray-linux-arm32-v5.zip
|
|
|
|
rm -f Xray-linux-arm32-v5.zip
|
2024-04-01 12:11:58 +03:00
|
|
|
elif [ "${{ matrix.platform }}" == "s390x" ]; then
|
|
|
|
wget ${Xray_URL}Xray-linux-s390x.zip
|
|
|
|
unzip Xray-linux-s390x.zip
|
|
|
|
rm -f Xray-linux-s390x.zip
|
2023-05-29 15:27:12 +03:00
|
|
|
fi
|
2024-01-15 13:14:13 +03:00
|
|
|
rm -f geoip.dat geosite.dat
|
2023-04-12 19:19:09 +03:00
|
|
|
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
|
2023-10-18 12:52:07 +03:00
|
|
|
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
|
|
|
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
2023-12-19 12:38:37 +03:00
|
|
|
wget -O geoip_VN.dat https://github.com/vuong2023/vn-v2ray-rules/releases/latest/download/geoip.dat
|
|
|
|
wget -O geosite_VN.dat https://github.com/vuong2023/vn-v2ray-rules/releases/latest/download/geosite.dat
|
2023-05-31 23:20:37 +03:00
|
|
|
mv xray xray-linux-${{ matrix.platform }}
|
2023-05-29 15:27:12 +03:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
- name: Package
|
2023-05-31 23:20:37 +03:00
|
|
|
run: tar -zcvf x-ui-linux-${{ matrix.platform }}.tar.gz x-ui
|
2024-07-15 12:09:24 +03:00
|
|
|
|
|
|
|
- name: Upload files to Artifacts
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-07-16 02:08:14 +03:00
|
|
|
name: x-ui-linux-${{ matrix.platform }}
|
2024-07-17 11:47:22 +03:00
|
|
|
path: ./x-ui-linux-${{ matrix.platform }}.tar.gz
|
2024-07-15 12:09:24 +03:00
|
|
|
|
2024-02-20 04:54:53 +03:00
|
|
|
- name: Upload files to GH release
|
2024-02-25 22:01:01 +03:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
2023-04-12 19:19:09 +03:00
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
tag: ${{ github.ref }}
|
2023-05-31 23:20:37 +03:00
|
|
|
file: x-ui-linux-${{ matrix.platform }}.tar.gz
|
|
|
|
asset_name: x-ui-linux-${{ matrix.platform }}.tar.gz
|
2023-04-12 19:19:09 +03:00
|
|
|
prerelease: true
|