Build v2ray-plugin

This commit is contained in:
Netch
2021-09-12 23:07:04 +08:00
parent 5c9faa3fe9
commit 3d15f727f3
3 changed files with 19 additions and 25 deletions

View File

@@ -0,0 +1,19 @@
Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent)
git clone https://github.com/teddysun/v2ray-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\v2ray-plugin.exe'
Pop-Location
Pop-Location
exit $lastExitCode

View File

View File

@@ -1,25 +0,0 @@
param (
[string]
$OutputPath
)
try {
Invoke-WebRequest `
-Uri 'https://github.com/teddysun/v2ray-plugin/releases/download/v4.42.1/v2ray-plugin-windows-amd64-v4.42.1.tar.gz' `
-OutFile 'v2ray-plugin.tar.gz'
}
catch {
exit 1
}
7z x 'v2ray-plugin.tar.gz'
if ( -Not $? ) { exit $lastExitCode }
7z x 'v2ray-plugin.tar'
if ( -Not $? ) { exit $lastExitCode }
mv -Force 'v2ray-plugin_windows_amd64.exe' "$OutputPath\v2ray-plugin.exe"
rm -Force 'v2ray-plugin.tar'
rm -Force 'v2ray-plugin.tar.gz'
exit 0