From fc12773a0ba9c6cf3bb4f4ceead9813e102b7099 Mon Sep 17 00:00:00 2001 From: Christophe Date: Wed, 21 Feb 2024 21:59:29 +0100 Subject: [PATCH 01/12] fix: fix backup versionning --- .github/workflows/generate-token-lists.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 01aede87..5bbe7fdb 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -221,7 +221,9 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then - aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath${{ steps.onlineVersion.outputs.onlineVersion }}/ + backupCommand=aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath + backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}/ + backupCommand fi done From 86d71fb8cf52c2af99de62aeb8c01a551a4416ae Mon Sep 17 00:00:00 2001 From: Christophe Date: Wed, 21 Feb 2024 22:05:02 +0100 Subject: [PATCH 02/12] Fix interpolation --- .github/workflows/generate-token-lists.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 5bbe7fdb..676bb262 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -221,9 +221,9 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then - backupCommand=aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath + backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}/ - backupCommand + $backupCommand fi done From 478aee18f3befe24a39e5760c6b844801458a3a0 Mon Sep 17 00:00:00 2001 From: Christophe Date: Wed, 21 Feb 2024 22:13:23 +0100 Subject: [PATCH 03/12] Remove duplicate ArbTokenLists in path --- .github/workflows/generate-token-lists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 676bb262..2a0cc3f2 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -191,7 +191,7 @@ jobs: if: ${{ matrix.commands.version == true && matrix.commands.version == true }} run: | # Check if the list exists online (it will not exist on the first run) - if curl --silent --head --fail "https://tokenlist.arbitrum.io/ArbTokenLists/${{ matrix.commands.paths[0] }}"; then + if curl --silent --head --fail "https://tokenlist.arbitrum.io/${{ matrix.commands.paths[0] }}"; then # Get the version from the online list (formatted to major.minor.patch) version=$(curl https://tokenlist.arbitrum.io/${{ matrix.commands.paths[0] }} | jq .version | jq 'join(".")') if [[ -n $version ]]; then From 305e5ec866d9ff2c01b81611567e380bf17f5db2 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 16:55:33 +0100 Subject: [PATCH 04/12] Change backup path to ArbTokenLists/List/version.json --- .github/workflows/generate-token-lists.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 2a0cc3f2..8f8147d8 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -222,7 +222,8 @@ jobs: lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" - backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}/ + backupCommand+=path + backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json $backupCommand fi done From 3ed9437310534ca0b0d92f0117a0fd1d5bb67a64 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 16:57:45 +0100 Subject: [PATCH 05/12] Add missing slash --- .github/workflows/generate-token-lists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 8f8147d8..a7d9a3ba 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -222,7 +222,7 @@ jobs: lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" - backupCommand+=path + backupCommand+=path/ backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json $backupCommand fi From d73baefc3f81291cd71a111abea542c77c6e76ca Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:01:04 +0100 Subject: [PATCH 06/12] Fix path --- .github/workflows/generate-token-lists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index a7d9a3ba..58ab6112 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -222,7 +222,7 @@ jobs: lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" - backupCommand+=path/ + backupCommand+=echo $path/ | awk -F'.json' '{print $1}' # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json $backupCommand fi From c793a19f3266120434a4c469c76e0fab2ccf33e2 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:06:02 +0100 Subject: [PATCH 07/12] Debug --- .github/workflows/generate-token-lists.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 58ab6112..cef4972e 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -224,6 +224,7 @@ jobs: backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" backupCommand+=echo $path/ | awk -F'.json' '{print $1}' # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json + echo $backupCommand $backupCommand fi done From 3c468b94ef400d0a0bc2e9687845bc7e3fe1f1d4 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:18:51 +0100 Subject: [PATCH 08/12] Fix path --- .github/workflows/generate-token-lists.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index cef4972e..978801be 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -221,10 +221,10 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then + backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" - backupCommand+=echo $path/ | awk -F'.json' '{print $1}' # Remove .json + backupCommand+=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json - echo $backupCommand $backupCommand fi done From 4161d3d22aa5cb23a121c6e65203d9d728a43023 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:21:19 +0100 Subject: [PATCH 09/12] Add debug --- .github/workflows/generate-token-lists.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 978801be..bbe30022 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -225,6 +225,7 @@ jobs: backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" backupCommand+=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json + echo $backupCommand $backupCommand fi done From ea418ffbcfa4b5eabcd147e72100b064bd28f3d9 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:23:16 +0100 Subject: [PATCH 10/12] Add debug --- .github/workflows/generate-token-lists.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index bbe30022..fe1d84ba 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -221,11 +221,12 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then - + debugVar=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" backupCommand+=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json echo $backupCommand + echo $debugVar $backupCommand fi done From 87b99974c8c46de05b4acbbfa308fac18b442e9d Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:25:16 +0100 Subject: [PATCH 11/12] Cleanup --- .github/workflows/generate-token-lists.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index fe1d84ba..d76e9a79 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -221,12 +221,9 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then - debugVar=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" - backupCommand+=$(echo $pppp | awk -F'.json' '{print $1}') # Remove .json + backupCommand+=$(echo $path | awk -F'.json' '{print $1}') # Remove .json backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json - echo $backupCommand - echo $debugVar $backupCommand fi done From 2f99bf3270ae993e9f6926f84be81e4a65e218b1 Mon Sep 17 00:00:00 2001 From: Christophe Date: Mon, 26 Feb 2024 17:38:57 +0100 Subject: [PATCH 12/12] Add slash before the file name --- .github/workflows/generate-token-lists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index d76e9a79..2fa400d1 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -223,7 +223,7 @@ jobs: if (( $lines > 0 )); then backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" backupCommand+=$(echo $path | awk -F'.json' '{print $1}') # Remove .json - backupCommand+=${{ steps.onlineVersion.outputs.onlineVersion }}.json + backupCommand+=/${{ steps.onlineVersion.outputs.onlineVersion }}.json $backupCommand fi done