Skip to content

xray

xray #17

Workflow file for this run

name: xray
permissions:
contents: read
on:
push:
branches: [ xray ]
workflow_dispatch:
inputs:
remote_port:
description: 'remote port'
required: true
default: '42001'
user:
description: 'remote port'
required: true
default: 'ga.yylt'
env:
GO111MODULE: on
FRP_BRANCH: v0.37.1
XRAY_BRANCH: v1.8.7
FRP_SERVER: frp.freefrp.net:7000
FRP_TOKEN: freefrp.net
REMOTE_PORT: 42001
USER: ga.yylt
MODE: rathole
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out repo code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: install binary
run: |
cd $(mktemp -d)
wget -q https://github.com/XTLS/Xray-core/releases/download/v1.8.24/Xray-linux-64.zip
wget -q -O - https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.0_linux_amd64.tar.gz | tar xzf -
wget -q "https://github.com/rapiz1/rathole/releases/download/v0.5.0/rathole-x86_64-unknown-linux-gnu.zip"
unzip rathole*.zip
unzip Xray*.zip
bindir=$(echo $PATH | awk -F : '{print $1}')
echo "copy binary to $bindir, 1 in $PATH"
find . -type f -perm /011 -exec cp {} $bindir/ \;
- name: Setting
run: |
set -x
if ${{ github.event_name == 'workflow_dispatch' }} ; then
echo "REMOTE_PORT=${{ github.event.inputs.remote_port }}" >> $GITHUB_ENV
echo "USER=${{ github.event.inputs.user }}" >> $GITHUB_ENV
fi
echo "trigger by ${{ github.event_name }}"
echo "REMOTE_PORT is ${{ env.REMOTE_PORT }}"
echo "USER is ${{ env.USER }}"
- name: run frpc and xray
run: |
if [ "${{ env.MODE }}" = "frp" ];then
frpc tcp -l 3000 --ue --uc --tls_enable -s ${{ env.FRP_SERVER }} -t ${{ env.FRP_TOKEN }} -u ${{ env.USER }} -r ${{ env.REMOTE_PORT }} &
else
sed -i "s/{{ remote }}/${{ secrets.RATHOLE_REMOTE }}/" xray/ra.toml
sed -i "s/{{ token }}/${{ secrets.RATHOLE_TOKEN }}/" xray/ra.toml
rathole -c xray/ra.toml 1>/dev/null 2>&1 &
fi
xray run -c xray/cc.json