Skip to content

Commit

Permalink
构建 停用 IP 地址更改
Browse files Browse the repository at this point in the history
  • Loading branch information
xrgzs committed Aug 14, 2024
1 parent d7ceb2e commit dee1ca6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 56 deletions.
55 changes: 27 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,28 @@ jobs:
}
ipconfig /flushdns
- name: Install Cloudflare 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
for ($attemptCount = 0; $attemptCount -lt 10; $attemptCount++) {
$output = .\warp-cli.exe status
Write-Host $output
if ($output -like "*Status update: Connected*") {
break
}
Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
}
if ($attemptCount -eq 10) {
Write-Host "Failed to connect after 10 attempts."
exit 1 # Exit with an error code
}
# - name: Install Cloudflare 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
# for ($attemptCount = 0; $attemptCount -lt 10; $attemptCount++) {
# $output = .\warp-cli.exe status
# Write-Host $output
# if ($output -like "*Status update: Connected*") {
# break
# }
# Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
# }
# if ($attemptCount -eq 10) {
# Write-Host "Failed to connect after 10 attempts."
# exit 1 # Exit with an error code
# }

- name: Generate version based on current date and time
id: generate_version
Expand Down Expand Up @@ -82,11 +81,11 @@ jobs:
run: |
cmd /c build.bat
- name: Disconnect Cloudflare WRAP
shell: pwsh
run: |
Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
.\warp-cli.exe disconnect
# - name: Disconnect Cloudflare WRAP
# shell: pwsh
# run: |
# Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
# .\warp-cli.exe disconnect

- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand Down
55 changes: 27 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,28 @@ jobs:
}
ipconfig /flushdns
- name: Install Cloudflare 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
for ($attemptCount = 0; $attemptCount -lt 10; $attemptCount++) {
$output = .\warp-cli.exe status
Write-Host $output
if ($output -like "*Status update: Connected*") {
break
}
Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
}
if ($attemptCount -eq 10) {
Write-Host "Failed to connect after 10 attempts."
exit 1 # Exit with an error code
}
# - name: Install Cloudflare 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
# for ($attemptCount = 0; $attemptCount -lt 10; $attemptCount++) {
# $output = .\warp-cli.exe status
# Write-Host $output
# if ($output -like "*Status update: Connected*") {
# break
# }
# Start-Sleep -Seconds 5 # Wait for 5 seconds before checking again
# }
# if ($attemptCount -eq 10) {
# Write-Host "Failed to connect after 10 attempts."
# exit 1 # Exit with an error code
# }

- name: Generate version based on current date and time
id: generate_version
Expand Down Expand Up @@ -74,11 +73,11 @@ jobs:
run: |
cmd /c build.bat
- name: Disconnect Cloudflare WRAP
shell: pwsh
run: |
Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
.\warp-cli.exe disconnect
# - name: Disconnect Cloudflare WRAP
# shell: pwsh
# run: |
# Set-Location "C:\Program Files\Cloudflare\Cloudflare WARP"
# .\warp-cli.exe disconnect

- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit dee1ca6

Please sign in to comment.