From 58d56b4b29e425fbc4a01798873dc0f2629d0409 Mon Sep 17 00:00:00 2001 From: soumyadghosh Date: Wed, 13 Dec 2023 17:45:21 +0530 Subject: [PATCH 1/2] [workflow]: fix the source-url --- .github/workflows/sync-upstream.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml index aadef41..84f8634 100644 --- a/.github/workflows/sync-upstream.yml +++ b/.github/workflows/sync-upstream.yml @@ -24,6 +24,6 @@ jobs: update-script: | source_url="$(curl -sL https://developer.android.com/studio/index.html | grep -Eo '"((https)?://.*linux.tar.gz)"' | tr -d '"')" codename="$(curl -sL https://developer.android.com/studio/index.html | grep -Po 'Download Android Studio (?!today)[A-Za-z0-9]+' | head -n1 | cut -d ' ' -f4)" - version="$(echo "$source_url" | rev | cut -d '/' -f2 | rev && echo "$codename")" - sed -i 's/^\(source: \).*$/\1'"\"$source_url\""'/' snap/snapcraft.yaml + version="$(basename "$source_url" .tar.gz | grep -oP '\d+\.\d+\.\d+\.\d+') $codename" + yq -i ".parts.android-studio.source = \"$source_url\"" snap/snapcraft.yaml sed -i 's/^\(version: \).*$/\1'"\"$version\""'/' snap/snapcraft.yaml From acd930cdfc9685482a90516049e71e9eb099fb03 Mon Sep 17 00:00:00 2001 From: soumyadghosh Date: Fri, 15 Dec 2023 22:28:57 +0530 Subject: [PATCH 2/2] [workflow]: revert yq to sed --- .github/workflows/sync-upstream.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml index 84f8634..c9261ef 100644 --- a/.github/workflows/sync-upstream.yml +++ b/.github/workflows/sync-upstream.yml @@ -25,5 +25,5 @@ jobs: source_url="$(curl -sL https://developer.android.com/studio/index.html | grep -Eo '"((https)?://.*linux.tar.gz)"' | tr -d '"')" codename="$(curl -sL https://developer.android.com/studio/index.html | grep -Po 'Download Android Studio (?!today)[A-Za-z0-9]+' | head -n1 | cut -d ' ' -f4)" version="$(basename "$source_url" .tar.gz | grep -oP '\d+\.\d+\.\d+\.\d+') $codename" - yq -i ".parts.android-studio.source = \"$source_url\"" snap/snapcraft.yaml + sed -i "s|source: .*$|source: $source_url|g" snap/snapcraft.yaml sed -i 's/^\(version: \).*$/\1'"\"$version\""'/' snap/snapcraft.yaml