diff --git a/.github/workflows/ui-test-automation.yml b/.github/workflows/ui-test-automation.yml index 2600148ead3..c9566dbf3c7 100644 --- a/.github/workflows/ui-test-automation.yml +++ b/.github/workflows/ui-test-automation.yml @@ -82,8 +82,8 @@ jobs: chmod +x ./utils/replace_node.sh ./utils/replace_node.sh - - name: Output contents from mod.rs file - run: cat ./common/src/warp_runner/mod.rs + - name: Output contents from Makefile modified file + run: cat ./Makefile - name: Build executable 🖥️ run: make dmg @@ -148,8 +148,8 @@ jobs: - name: Replace Warp Peer ID in Uplink 🚀 run: .\utils\replace_node.ps1 - - name: Output contents from mod.rs file - run: Get-Content .\common\src\warp_runner\mod.rs + - name: Output contents from modified Makefile file + run: Get-Content .\Makefile - name: Build executable 🖥️ run: cargo build --release -F production_mode diff --git a/utils/replace_node.ps1 b/utils/replace_node.ps1 index 47efe645f39..c377b81b7f4 100644 --- a/utils/replace_node.ps1 +++ b/utils/replace_node.ps1 @@ -1,10 +1,8 @@ -# Contents of replace_node.ps1 +# Read the values from .\warp\peerID.txt +$localPeerID = Select-String -Path .\warp\peerID.txt -Pattern 'Local PeerID: ([^\s]+)' | ForEach-Object { $_.Matches.Groups[1].Value } -# Read the values from ./warp/peerID -$localPeerId = Select-String -Path .\warp\peerID.txt -Pattern 'Local PeerID: ([^\s]*)' | ForEach-Object { $_.Matches.Groups[1].Value } - -# Update the values in ./common/src/warp_runner/mod.rs and store in a temporary file -(Get-Content .\common\src\warp_runner\mod.rs) -replace '12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu', $localPeerId ` - -replace '/ip4/104.236.194.35/tcp/34053', '/ip4/127.0.0.1/tcp/4444' | - Set-Content -Path .\common\src\warp_runner\mod.rs +# Update the values in .\common\src\warp_runner\mod.rs and store in a temporary file +(Get-Content .\Makefile) -replace 'cargo build --release -F production_mode', 'SHUTTLE_ADDR_POINT=/ip4/127.0.0.1/tcp/4444/p2p/ cargo build --release -F production_mode' -replace ' cargo build --release -F production_mode', "$localPeerID cargo build --release -F production_mode" | Set-Content -Path temp_file +# Replace the original mod.rs with the modified content +Move-Item -Path temp_file -Destination .\Makefile diff --git a/utils/replace_node.sh b/utils/replace_node.sh index 2b2463cdbce..92235b1d7a5 100644 --- a/utils/replace_node.sh +++ b/utils/replace_node.sh @@ -4,9 +4,9 @@ local_peer_id=$(grep -o 'Local PeerID: [^[:space:]]*' ./warp/peerID.txt | awk '{print $NF}') # Update the values in ./common/src/warp_runner/mod.rs and store in a temporary file -sed -e "s/12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu/$local_peer_id/g" \ - -e "s#/ip4/104.236.194.35/tcp/34053#/ip4/127.0.0.1/tcp/4444#" \ - ./common/src/warp_runner/mod.rs > temp_file +sed -e "s#cargo build --release -F production_mode#SHUTTLE_ADDR_POINT=/ip4/127.0.0.1/tcp/4444/p2p/ cargo build --release -F production_mode#" + -e "s/ cargo build --release -F production_mode/$local_peer_id cargo build --release -F production_mode/g" \ + ./Makefile > temp_file # Replace the original mod.rs with the modified content -mv temp_file ./common/src/warp_runner/mod.rs +mv temp_file ./Makefile