Skip to content

Commit

Permalink
fix: 修改为PY32Duino
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfSweet committed Nov 10, 2023
1 parent 4db55da commit 47c90d1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

repository_dispatch:
types: [AirMCU,AirISP]
types: [release]


workflow_dispatch:
Expand All @@ -24,18 +24,18 @@ jobs:

- uses: ncipollo/release-action@v1
with:
artifacts: "package_air_index.json,package_air_cn_index.json"
artifacts: "package_py32_index.json,package_py32_cn_index.json"
tag: "Nightly"
allowUpdates: true

- name: publish OSS
env:
OSS_CONFIG: ${{ secrets.OSS_CONFIG }}
OSS_NAME: ${{ secrets.OSS_NAME }}
run: |
sudo apt update
wget http://gosspublic.alicdn.com/ossutil/1.7.1/ossutil64
sudo chmod 755 ossutil64
echo -e "${OSS_CONFIG}" > ~/.ossutilconfig
./ossutil64 cp -u -r temp/ oss://${OSS_NAME}/
./ossutil64 cp -u package_air_cn_index.json oss://${OSS_NAME}/
# - name: publish OSS
# env:
# OSS_CONFIG: ${{ secrets.OSS_CONFIG }}
# OSS_NAME: ${{ secrets.OSS_NAME }}
# run: |
# sudo apt update
# wget http://gosspublic.alicdn.com/ossutil/1.7.1/ossutil64
# sudo chmod 755 ossutil64
# echo -e "${OSS_CONFIG}" > ~/.ossutilconfig
# ./ossutil64 cp -u -r temp/ oss://${OSS_NAME}/
# ./ossutil64 cp -u package_air_cn_index.json oss://${OSS_NAME}/
42 changes: 21 additions & 21 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import hashlib
import os

packagesPath = "package_air_index.json"
packagesCNPath = "package_air_cn_index.json"
packagesPath = "package_py32_index.json"
packagesCNPath = "package_py32_cn_index.json"

GCCVersion = "12.2.1-1.2"
AirISPVersion = "" # 不定义具体的版本,在GetAirISPVersion函数中创造
Expand Down Expand Up @@ -104,7 +104,7 @@ def DownloadAndCheck(url, fileName, host, suffixName):
temp['size'] = ComputeSize(tempPath)

tempCn = temp.copy()
tempCn['url'] = "https://arduino.luatos.com/" + fileName + suffixName
tempCn['url'] = "https://arduino.py32.halfsweet.cn/" + fileName + suffixName
return temp, tempCn


Expand Down Expand Up @@ -221,45 +221,45 @@ def f(host, suffixName):
return data, dataCn


def PlatformsAirMCU(version):
fileName = "AirMCU-" + version + ".zip"
url = "https://github.com/Air-duino/Arduino-AirMCU/releases/download/" + version + "/" + fileName
def PlatformsPY32(version):
fileName = "Arduino-PY32-" + version + ".zip"
url = "https://github.com/py32duino/Arduino-PY32/releases/download/" + version + "/" + fileName
downloadFile(url)
data = {}
dataCn = {}
data['name'] = "Air MCU"
data['architecture'] = "AirMCU"
data['name'] = "PY32 Arduino"
data['architecture'] = "PY32"
data['version'] = version
data['category'] = "Contributed"
data['help'] = {'online': "https://arduino.luatos.com"}
data['help'] = {'online': "https://arduino.py32.halfsweet.cn"}
data['url'] = url
data['archiveFileName'] = fileName
data['checksum'] = "SHA-256:" + ComputeSHA256(fileName)
data['size'] = ComputeSize(fileName)
data['boards'] = [{'name': "Air001"}]
data['toolsDependencies'] = [{'packager': "AirM2M", 'name': "xpack-arm-none-eabi-gcc", 'version': GCCVersion},
{'packager': "AirM2M", 'name': "CMSIS", 'version': CMSISVersion},
{'packager': "AirM2M", 'name': "AirISP", 'version': AirISPVersion}]
data['toolsDependencies'] = [{'packager': "PY32Duino", 'name': "xpack-arm-none-eabi-gcc", 'version': GCCVersion},
{'packager': "PY32Duino", 'name': "CMSIS", 'version': CMSISVersion},
{'packager': "PY32Duino", 'name': "AirISP", 'version': AirISPVersion}]
dataCn = data.copy()
dataCn['url'] = "https://arduino.luatos.com/" + fileName
dataCn['url'] = "https://arduino.py32.halfsweet.cn/" + fileName
return data, dataCn


def PackagesAirM2M():
def PackagesPY32Duino():
data = {}
dataCn = {}
data['name'] = "AirM2M"
data['maintainer'] = "AirM2M"
data['websiteURL'] = "https://arduino.luatos.com"
data['name'] = "PY32Duino"
data['maintainer'] = "PY32Duino"
data['websiteURL'] = "https://arduino.py32.halfsweet.cn"
data['email'] = "[email protected]"
data['help'] = {'online': "https://arduino.luatos.com"}
data['help'] = {'online': "https://arduino.py32.halfsweet.cn"}
dataCn = data.copy()
platforms = []
platformsCn = []

PlatformsVersion.extend(GetRepoVersion("Air-duino", "Arduino-AirMCU"))
PlatformsVersion.extend(GetRepoVersion("PY32Duino", "Arduino-PY32"))
for item in PlatformsVersion:
temp, tempCn = PlatformsAirMCU(item)
temp, tempCn = PlatformsPY32(item)
platforms.append(temp)
platformsCn.append(tempCn)
data['platforms'] = platforms
Expand Down Expand Up @@ -287,7 +287,7 @@ def PackagesAirM2M():
def Encode():
data = {}
dataCn = {}
temp, tempCn = PackagesAirM2M()
temp, tempCn = PackagesPY32Duino()
data['packages'] = [temp]
dataCn['packages'] = [tempCn]
json_str = json.dumps(data, indent=2)
Expand Down

0 comments on commit 47c90d1

Please sign in to comment.