Skip to content

Commit e2b52e9

Browse files
committed
add: 加入了上传到国内OSS的功能
1 parent 21a5d49 commit e2b52e9

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,19 @@ jobs:
2626
artifacts: "package_air_index.json,package_air_cn_index.json"
2727
tag: "Nightly"
2828
allowUpdates: true
29-
29+
30+
- name: publish OSS
31+
env:
32+
OSS_CONFIG: ${{ secrets.OSS_CONFIG }}
33+
OSS_NAME: ${{ secrets.OSS_NAME }}
34+
run: |
35+
sudo apt update
36+
sudo pip3 install setuptools
37+
sudo pip3 install -r requirements.txt
38+
cd ..
39+
wget http://gosspublic.alicdn.com/ossutil/1.7.1/ossutil64
40+
sudo chmod 755 ossutil64
41+
echo -e "${OSS_CONFIG}" > ~/.ossutilconfig
42+
./ossutil64 rm oss://${OSS_NAME}/ -r -f
43+
./ossutil64 cp -u -r temp/ oss://${OSS_NAME}/
44+
./ossutil64 cp -u package_air_cn_index.json oss://${OSS_NAME}/

main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def f(host, suffixName):
218218

219219
data['systems'] = system
220220
dataCn['systems'] = systemCn
221-
return data,dataCn
221+
return data, dataCn
222222

223223

224224
def PlatformsAirMCU(version):
@@ -241,7 +241,7 @@ def PlatformsAirMCU(version):
241241
{'packager': "AirM2M", 'name': "CMSIS", 'version': CMSISVersion},
242242
{'packager': "AirM2M", 'name': "AirISP", 'version': AirISPVersion}]
243243
dataCn = data
244-
dataCn['url'] = "https://arduino.luatos.com/" + version + "/" + fileName
244+
dataCn['url'] = "https://arduino.luatos.com/" + fileName
245245
return data, dataCn
246246

247247

@@ -258,7 +258,7 @@ def PackagesAirM2M():
258258

259259
PlatformsVersion.extend(GetRepoVersion("Air-duino", "Arduino-AirMCU"))
260260
for item in PlatformsVersion:
261-
temp,tempCn = PlatformsAirMCU(item)
261+
temp, tempCn = PlatformsAirMCU(item)
262262
platforms.append(temp)
263263
platformsCn.append(tempCn)
264264
data['platforms'] = platforms
@@ -295,7 +295,7 @@ def Encode():
295295
json_str_cn = json.dumps(dataCn, indent=2)
296296
with open(packagesCNPath, "w+") as f:
297297
f.write(json_str_cn)
298-
return json_str,json_str_cn
298+
return json_str, json_str_cn
299299

300300

301301
def main():

0 commit comments

Comments
 (0)