Skip to content

Fetch xray to latest version #820

Fetch xray to latest version

Fetch xray to latest version #820

Workflow file for this run

name: Fetch xray to latest version
on:
workflow_dispatch:
schedule:
- cron: "30 12 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Fetch xray to latest version
run: |
cur_dir=$(pwd)
rm -f bin/xray-linux-amd64 bin/xray-linux-arm64 bin/xray-linux-s390x bin/wgcf-fetchlog.txt
actions_date=$(date)
repo_last_ver=$(curl -Ls "https://api.github.com/repos/XTLS/Xray-core/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
mkdir actions-temp
cd actions-temp
wget -N https://github.com/XTLS/Xray-core/releases/download/$repo_last_ver/Xray-linux-64.zip
unzip Xray-linux-64.zip
rm -f Xray-linux-64.zip geoip.dat geosite.dat LICENSE README.md
mv xray $cur_dir/bin/xray-linux-amd64
wget -N https://github.com/XTLS/Xray-core/releases/download/$repo_last_ver/Xray-linux-arm64-v8a.zip
unzip Xray-linux-arm64-v8a.zip
rm -f Xray-linux-arm64-v8a.zip geoip.dat geosite.dat LICENSE README.md
mv xray $cur_dir/bin/xray-linux-arm64
wget -N https://github.com/XTLS/Xray-core/releases/download/$repo_last_ver/Xray-linux-s390x.zip
unzip Xray-linux-s390x.zip
rm -f Xray-linux-s390x.zip geoip.dat geosite.dat LICENSE README.md
mv xray $cur_dir/bin/xray-linux-s390x
cat <<EOF > $cur_dir/bin/xray-fetchlog.txt
# xray fetch log generated by GitHub Actions
Last Version: $repo_last_ver
Fetch Date: $actions_date
EOF
- name: Upload to GitHub
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git commit -m "CI: Auto fetch xray at $(date +"%m-%d %H:%M")"
git push