aboutsummaryrefslogtreecommitdiff
path: root/tools/deploy/get-latest-builds.sh
blob: fc3046dac157ffdecebafe662aed66a2021890f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

echo Get build information
curl -o project-meta.json -H "Content-Type: application/json" https://ci.appveyor.com/api/projects/XianNox/smolbote-hg

commit=$(jq -r .build.commitId project-meta.json)
echo Build commit: $commit

for (( i=0; i<$(jq -r '.build.jobs | length' project-meta.json); i++ ))
do
    jobId=$(jq -r .build.jobs[$i].jobId project-meta.json)
    osType=$(jq -r .build.jobs[$i].osType project-meta.json)

    echo Downloading $jobId-$osType
    curl -o smolbote-nightly-$commit-$osType.7z -L https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/smolbote.7z

    echo Extracting package
    7za x smolbote-nightly-$commit-$osType.7z smolbote-install/bin
    mv smolbote-nightly-$commit-$osType.7z serve/
    mv smolbote-install/bin serve/smolbote-$commit-$osType
    rm -r smolbote-install
done