-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (40 loc) · 1.49 KB
/
release-qiniu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Release QiNiu
on:
release:
types: [published]
jobs:
upload-qiniu:
name: "Upload to QiNiu"
runs-on: "ubuntu-latest"
steps:
- name: "Upload to QiNiu"
env:
QINIU_BUCKET: ${{ secrets.QINIU_BUCKET }}
QINIU_AK: ${{ secrets.QINIU_AK }}
QINIU_SK: ${{ secrets.QINIU_SK }}
run: |
sudo apt-get update
sudo apt-get install -y unzip
if [ $(uname -m) == 'x86_64' ]; then
wget http://devtools.qiniu.com/qshell-linux-x64-v2.4.1.zip
unzip qshell-linux-x64-v2.4.1.zip
mv qshell-linux-x64-v2.4.1 qshell
else
wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.1.zip
unzip qshell-linux-x86-v2.4.1.zip
mv qshell-linux-x86-v2.4.1 qshell
fi
chmod +x qshell
./qshell account -w ${QINIU_AK} ${QINIU_SK} deploy-account
curl https://api.github.com/repos/PiSugar/pisugar-wifi-config/releases/latest > latest
sudo apt-get install -y jq
for url in $(jq '.assets[].browser_download_url' latest); do
url=$(echo $url | awk -F '"' '{print $2}')
filename=${url##*/}
wget -O ${filename} ${url}
mimetype=application/octet-stream
if (echo "$filename" | grep '.*.sh$'); then
mimetype=text/plain
fi
./qshell rput --overwrite --mimetype ${mimetype} ${QINIU_BUCKET} release/${filename} ${filename}
done