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