diff --git a/lts/snap/snapcraft.yaml b/lts/snap/snapcraft.yaml index 25913ef..91ef4b4 100644 --- a/lts/snap/snapcraft.yaml +++ b/lts/snap/snapcraft.yaml @@ -52,26 +52,26 @@ parts: snapcraftctl set-grade "stable" override-build: | file="./version.txt" + buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4) + baseurl=$(echo $buildinfo | jq -r .BaseUrl) if [ -f "$file" ] then echo "using version file" version=$(cat $file) else echo "getting latest version from GitHub" - version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//') + version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//') echo "Writing version to file" echo $version > $file fi - container=$(echo v$version| sed 's/\./-/g') - echo "getting powershell $version - $container" - # These urls are subject to change. + echo "getting powershell $version - $baseurl/v$version" case "$SNAPCRAFT_ARCH_TRIPLET" in aarch64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;; arm-linux-gnueabihf) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;; x86_64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;; *) # fail because we don't have a build for the requested platform echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting." diff --git a/preview/snap/snapcraft.yaml b/preview/snap/snapcraft.yaml index 8cd87a7..3e3387b 100644 --- a/preview/snap/snapcraft.yaml +++ b/preview/snap/snapcraft.yaml @@ -50,26 +50,26 @@ parts: snapcraftctl set-grade "stable" override-build: | file="./version.txt" + buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview) + baseurl=$(echo $buildinfo | jq -r .BaseUrl) if [ -f "$file" ] then echo "using version file" version=$(cat $file) else echo "getting latest version from GitHub" - version=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview | jq -r .ReleaseTag | sed 's/v//') + version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//') echo "Writing version to file" echo $version > $file fi - container=$(echo v$version| sed 's/\./-/g') - echo "getting powershell $version - $container" - # These urls are subject to change. + echo "getting powershell $version - $baseurl/v$version" case "$SNAPCRAFT_ARCH_TRIPLET" in aarch64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;; arm-linux-gnueabihf) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;; x86_64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;; *) # fail because we don't have a build for the requested platform echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting." diff --git a/stable/snap/snapcraft.yaml b/stable/snap/snapcraft.yaml index 525aa9b..2f217cf 100644 --- a/stable/snap/snapcraft.yaml +++ b/stable/snap/snapcraft.yaml @@ -52,26 +52,26 @@ parts: snapcraftctl set-grade "stable" override-build: | file="./version.txt" + buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4) + baseurl=$(echo $buildinfo | jq -r .BaseUrl) if [ -f "$file" ] then echo "using version file" version=$(cat $file) else echo "getting latest version from GitHub" - version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//') + version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//') echo "Writing version to file" echo $version > $file fi - container=$(echo v$version| sed 's/\./-/g') - echo "getting powershell $version - $container" - # These urls are subject to change. + echo "getting powershell $version - $baseurl/v$version" case "$SNAPCRAFT_ARCH_TRIPLET" in aarch64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;; arm-linux-gnueabihf) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;; x86_64-linux-gnu) - curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;; + curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;; *) # fail because we don't have a build for the requested platform echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."