Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix backup versionning #131

Merged
merged 12 commits into from
Mar 19, 2024
7 changes: 5 additions & 2 deletions .github/workflows/generate-token-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -221,7 +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
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better if we do /token_list_name/version.json, that will be much easier to find because it's grouped by token list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/OffchainLabs/arbitrum-token-lists/actions/runs/8052421755/job/21992515216?pr=131#step:7:34

Updated, it backup to /TestFolder/ArbTokenLists/42170_arbed_gemini_token_list/2.0.0.json now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image that looks odd to me why are there quotation marks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github add quotation because the variable is coming from github environment, not the bash environment itself. But it does work:

TestFolder/ArbTokenLists/42170_arbed_gemini_token_list/2.0.0.json

backupCommand+=$(echo $path | awk -F'.json' '{print $1}') # Remove .json
backupCommand+=/${{ steps.onlineVersion.outputs.onlineVersion }}.json
$backupCommand
fi
done

Expand Down
Loading