Skip to content

Commit

Permalink
构建 更换IP地址
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Aug 11, 2024
1 parent b8434e7 commit ca642d1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,27 @@ jobs:
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ResetServerAddresses
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses $newDnsServers
}
echo "192.3.232.250 file.uhsea.com" >> C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
- name: Install Cloudfalre WRAP
shell: pwsh
run: |
Write-Host "installing Cloudflare WARP..."
Invoke-WebRequest -Uri "https://1111-releases.cloudflareclient.com/win/latest" -OutFile "C:\cfwarp.msi"
Start-Process "msiexec.exe" -ArgumentList "/i C:\cfwarp.msi /qn" -Wait
Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
.\warp-cli.exe registration new
.\warp-cli.exe connect
# Add a loop to wait for the status to be connected
while ($true) {
$output = .\warp-cli.exe status
if ($output -like "*Status update: Connected*") {
break
}
Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
}
- name: Generate version based on current date and time
id: generate_version
shell: pwsh
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,27 @@ jobs:
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ResetServerAddresses
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses $newDnsServers
}
echo "192.3.232.250 file.uhsea.com" >> C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
- name: Install Cloudfalre WRAP
shell: pwsh
run: |
Write-Host "installing Cloudflare WARP..."
Invoke-WebRequest -Uri "https://1111-releases.cloudflareclient.com/win/latest" -OutFile "C:\cfwarp.msi"
Start-Process "msiexec.exe" -ArgumentList "/i C:\cfwarp.msi /qn" -Wait
Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
.\warp-cli.exe registration new
.\warp-cli.exe connect
# Add a loop to wait for the status to be connected
while ($true) {
$output = .\warp-cli.exe status
if ($output -like "*Status update: Connected*") {
break
}
Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
}
- name: Generate version based on current date and time
id: generate_version
shell: pwsh
Expand Down

0 comments on commit ca642d1

Please sign in to comment.