diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3d5aa5f..c8dbd1c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,50 @@ jobs: release_name: ${{ github.ref }} draft: false prerelease: false + linux386build: + name: build x-ui 386 version + needs: release + runs-on: ubuntu-latest + container: docker.io/ubuntu:18.04 + steps: + - uses: actions/checkout@v3.5.2 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: stable + - name: build linux 386 version + run: | + apt-get update + apt install -y sudo curl wget unzip ca-certificates build-essential + CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -o xui-release -v main.go + mkdir x-ui + cp xui-release x-ui/xui-release + cp x-ui.service x-ui/x-ui.service + cp x-ui.sh x-ui/x-ui.sh + cd x-ui + mv xui-release x-ui + mkdir bin + cd bin + 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 + mv xray xray-linux-386 + rm -f geoip.dat geosite.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 + cd .. + cd .. + - name: package + run: tar -zcvf x-ui-linux-386.tar.gz x-ui + - name: upload + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.release.outputs.upload_url }} + asset_path: x-ui-linux-386.tar.gz + asset_name: x-ui-linux-386.tar.gz + asset_content_type: application/gzip linuxamd64build: name: build x-ui amd64 version diff --git a/install.sh b/install.sh index e423b0d..a5bbb29 100644 --- a/install.sh +++ b/install.sh @@ -31,7 +31,9 @@ fi arch=$(arch) -if [[ $arch == "x86_64" || $arch == "x64" || $arch == "amd64" ]]; then +if [[ $arch == "i386" || $arch == "i686" ]]; then + arch="386" +elif [[ $arch == "x86_64" || $arch == "x64" || $arch == "amd64" ]]; then arch="amd64" elif [[ $arch == "aarch64" || $arch == "arm64" ]]; then arch="arm64" @@ -44,11 +46,6 @@ fi echo "Arch: ${arch}" -if [ $(getconf WORD_BIT) != '32' ] && [ $(getconf LONG_BIT) != '64' ]; then - echo "This software does not support 32-bit system (x86), please use 64-bit system (x86_64), if the detection is wrong, please contact the author" - exit -1 -fi - os_version="" # os version diff --git a/install_CN.sh b/install_CN.sh index 0249602..7325dee 100644 --- a/install_CN.sh +++ b/install_CN.sh @@ -31,7 +31,9 @@ fi arch=$(arch) -if [[ $arch == "x86_64" || $arch == "x64" || $arch == "amd64" ]]; then +if [[ $arch == "i386" || $arch == "i686" ]]; then + arch="386" +elif [[ $arch == "x86_64" || $arch == "x64" || $arch == "amd64" ]]; then arch="amd64" elif [[ $arch == "aarch64" || $arch == "arm64" ]]; then arch="arm64" diff --git a/web/service/server.go b/web/service/server.go index 76630a8..ff680f5 100644 --- a/web/service/server.go +++ b/web/service/server.go @@ -255,6 +255,8 @@ func (s *ServerService) downloadXRay(version string) (string, error) { } switch arch { + case "386": + arch = "32" case "amd64": arch = "64" case "arm64":