mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Build xray-core
This commit is contained in:
17
Other/xray-core/build.ps1
Normal file
17
Other/xray-core/build.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent)
|
||||
|
||||
git clone https://github.com/xtls/xray-core -b 'v1.4.3' src
|
||||
if ( -Not $? ) {
|
||||
Pop-Location
|
||||
exit $lastExitCode
|
||||
}
|
||||
|
||||
$Env:CGO_ENABLED='0'
|
||||
$Env:GOROOT_FINAL='/usr'
|
||||
|
||||
$Env:GOOS='windows'
|
||||
$Env:GOARCH='amd64'
|
||||
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\release\xray.exe' '.\src\main'
|
||||
|
||||
Pop-Location
|
||||
exit $lastExitCode
|
||||
0
Other/xray-core/deps.ps1
Normal file
0
Other/xray-core/deps.ps1
Normal file
@@ -1,24 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
$OutputPath
|
||||
)
|
||||
|
||||
try {
|
||||
Invoke-WebRequest `
|
||||
-Uri 'https://github.com/v2fly/v2ray-core/releases/download/v4.41.1/v2ray-windows-64.zip' `
|
||||
-OutFile 'v2ray-core.zip'
|
||||
}
|
||||
catch {
|
||||
exit 1
|
||||
}
|
||||
|
||||
7z x 'v2ray-core.zip' -o'v2ray-core'
|
||||
if ( -Not $? ) { exit $lastExitCode }
|
||||
|
||||
mv -Force 'v2ray-core\v2ctl.exe' $OutputPath
|
||||
mv -Force 'v2ray-core\v2ray.exe' $OutputPath
|
||||
mv -Force 'v2ray-core\wv2ray.exe' $OutputPath
|
||||
|
||||
rm -Recurse -Force v2ray-core
|
||||
rm -Recurse -Force v2ray-core.zip
|
||||
exit 0
|
||||
@@ -1,22 +0,0 @@
|
||||
param (
|
||||
[string]
|
||||
$OutputPath
|
||||
)
|
||||
|
||||
try {
|
||||
Invoke-WebRequest `
|
||||
-Uri 'https://github.com/XTLS/Xray-core/releases/download/v1.4.2/Xray-windows-64.zip' `
|
||||
-OutFile 'xray-core.zip'
|
||||
}
|
||||
catch {
|
||||
exit 1
|
||||
}
|
||||
|
||||
7z x 'xray-core.zip' -o'xray-core'
|
||||
if ( -Not $? ) { exit $lastExitCode }
|
||||
|
||||
mv -Force 'xray-core\xray.exe' $OutputPath
|
||||
|
||||
rm -Recurse -Force xray-core
|
||||
rm -Recurse -Force xray-core.zip
|
||||
exit 0
|
||||
Reference in New Issue
Block a user