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