Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit f8b4d78

Browse files
authored
Use Azure blob to get packages. (#102)
1 parent 663a314 commit f8b4d78

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

.vsts-ci/templates/releaseBuildPhase.yml

+9
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ jobs:
9292
displayName: Build snap $(channel)
9393
condition: and(succeeded(), ne(variables['$(channel)'],'no'))
9494
95+
- powershell: |
96+
Get-ChildItem /home/vsts/.local/state/snapcraft/log/*.log | foreach-object {
97+
$name = $_.fullname
98+
Write-Verbose -Verbose "uploading '$name'"
99+
Write-Host "##vso[artifact.upload containerfolder=$(channel)-logs;artifactname=$(channel)-log]$name"
100+
}
101+
displayName: 'Install $(channel) snap'
102+
condition: always()
103+
95104
- powershell: |
96105
sudo snap install $(PS_SNAP_PATH) --classic --dangerous
97106
displayName: 'Install $(channel) snap'

lts/snap/snapcraft.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ parts:
4646
then
4747
version=$(cat $file)
4848
else
49-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .LTSReleaseTag[0] | sed 's/"//g' | sed 's/v//')
49+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
5050
fi
5151
snapcraftctl set-version "$version"
5252
snapcraftctl set-grade "stable"
@@ -58,18 +58,20 @@ parts:
5858
version=$(cat $file)
5959
else
6060
echo "getting latest version from GitHub"
61-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .LTSReleaseTag[0] | sed 's/"//g' | sed 's/v//')
61+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
6262
echo "Writing version to file"
6363
echo $version > $file
6464
fi
65-
echo "getting powershell $version"
65+
container=$(echo v$version| sed 's/\./-/g')
66+
echo "getting powershell $version - $container"
67+
# These urls are subject to change.
6668
case "$SNAPCRAFT_ARCH_TRIPLET" in
6769
aarch64-linux-gnu)
68-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm64.tar.gz ;;
70+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
6971
arm-linux-gnueabihf)
70-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm32.tar.gz ;;
72+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
7173
x86_64-linux-gnu)
72-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-x64.tar.gz ;;
74+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
7375
*)
7476
# fail because we don't have a build for the requested platform
7577
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

preview/snap/snapcraft.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ parts:
4444
then
4545
version=$(cat $file)
4646
else
47-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .PreviewReleaseTag | sed 's/"//g' | sed 's/v//')
47+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview | jq -r .ReleaseTag | sed 's/v//')
4848
fi
4949
snapcraftctl set-version "$version"
5050
snapcraftctl set-grade "stable"
@@ -56,18 +56,20 @@ parts:
5656
version=$(cat $file)
5757
else
5858
echo "getting latest version from GitHub"
59-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .PreviewReleaseTag | sed 's/"//g' | sed 's/v//')
59+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview | jq -r .ReleaseTag | sed 's/v//')
6060
echo "Writing version to file"
6161
echo $version > $file
6262
fi
63-
echo "getting powershell $version"
63+
container=$(echo v$version| sed 's/\./-/g')
64+
echo "getting powershell $version - $container"
65+
# These urls are subject to change.
6466
case "$SNAPCRAFT_ARCH_TRIPLET" in
6567
aarch64-linux-gnu)
66-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm64.tar.gz ;;
68+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
6769
arm-linux-gnueabihf)
68-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm32.tar.gz ;;
70+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
6971
x86_64-linux-gnu)
70-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-x64.tar.gz ;;
72+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
7173
*)
7274
# fail because we don't have a build for the requested platform
7375
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

stable/snap/snapcraft.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ parts:
4646
then
4747
version=$(cat $file)
4848
else
49-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .StableReleaseTag | sed 's/"//g' | sed 's/v//')
49+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
5050
fi
5151
snapcraftctl set-version "$version"
5252
snapcraftctl set-grade "stable"
@@ -58,18 +58,20 @@ parts:
5858
version=$(cat $file)
5959
else
6060
echo "getting latest version from GitHub"
61-
version=$(curl -s 'https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json' | jq .StableReleaseTag | sed 's/"//g' | sed 's/v//')
61+
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
6262
echo "Writing version to file"
6363
echo $version > $file
6464
fi
65-
echo "getting powershell $version"
65+
container=$(echo v$version| sed 's/\./-/g')
66+
echo "getting powershell $version - $container"
67+
# These urls are subject to change.
6668
case "$SNAPCRAFT_ARCH_TRIPLET" in
6769
aarch64-linux-gnu)
68-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm64.tar.gz ;;
70+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
6971
arm-linux-gnueabihf)
70-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-arm32.tar.gz ;;
72+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
7173
x86_64-linux-gnu)
72-
curl -L -o powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-linux-x64.tar.gz ;;
74+
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
7375
*)
7476
# fail because we don't have a build for the requested platform
7577
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

0 commit comments

Comments
 (0)