2023-05-29 15:27:12 +03:00
|
|
|
name: Release 3X-ui
|
|
|
|
|
2023-02-09 22:18:06 +03:00
|
|
|
on:
|
2023-04-12 19:19:09 +03:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "*"
|
2023-02-09 22:18:06 +03:00
|
|
|
workflow_dispatch:
|
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:
|
|
|
|
platform: [amd64, arm64]
|
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
|
2023-07-12 10:39:14 +03:00
|
|
|
uses: actions/checkout@v3.5.3
|
2023-05-29 15:27:12 +03:00
|
|
|
|
|
|
|
- name: Setup Go
|
2023-05-16 13:04:13 +03:00
|
|
|
uses: actions/setup-go@v4.0.1
|
2023-04-12 19:19:09 +03:00
|
|
|
with:
|
2023-05-29 15:27:12 +03:00
|
|
|
go-version: 'stable'
|
|
|
|
|
|
|
|
- name: Install dependencies for arm64
|
|
|
|
if: matrix.platform == 'arm64'
|
2023-04-12 19:19:09 +03:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt install gcc-aarch64-linux-gnu
|
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
|
|
|
|
export CC=aarch64-linux-gnu-gcc
|
|
|
|
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
|
|
|
|
if [ "${{ matrix.platform }}" == "amd64" ]; then
|
2023-07-27 10:36:27 +03:00
|
|
|
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.1/Xray-linux-64.zip
|
2023-05-29 15:27:12 +03:00
|
|
|
unzip Xray-linux-64.zip
|
|
|
|
rm -f Xray-linux-64.zip
|
|
|
|
else
|
2023-07-27 10:36:27 +03:00
|
|
|
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.1/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
|
|
|
|
fi
|
|
|
|
rm -f geoip.dat geosite.dat iran.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
|
|
|
|
wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.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
|
2023-05-29 15:27:12 +03:00
|
|
|
|
|
|
|
- name: Upload
|
2023-05-31 23:11:29 +03:00
|
|
|
uses: svenstaro/upload-release-action@2.6.1
|
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
|
|
|
|
overwrite: true
|