From 770ebe8db0729ea21f6ab1e12e752e9d4000789e Mon Sep 17 00:00:00 2001 From: xrgzs Date: Thu, 26 Sep 2024 01:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E5=88=87=E6=8D=A2IP=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 54 +++++++++++++++++------------------ .github/workflows/release.yml | 54 +++++++++++++++++------------------ 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 715b32f..6b2b98f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,28 +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 @@ -81,11 +81,11 @@ jobs: run: | . .\build.ps1 - # - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83358bb..d1e14e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,28 +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 @@ -73,11 +73,11 @@ jobs: run: | . .\build.ps1 - # - 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