Browse Source

Merge pull request #350 from shangfengh/new

fix: 💩 fix py
tags/0.1.0
shangfengh GitHub 2 years ago
parent
commit
993192e59f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions
  1. +20
    -14
      .github/workflows/upload_COS.yml
  2. +3
    -1
      dependency/py/HashFiles.py

+ 20
- 14
.github/workflows/upload_COS.yml View File

@@ -42,19 +42,10 @@ jobs:
dotnet publish "./logic/Server/Server.csproj" -c Debug -r linux-x64 -o ./THUAI6/linux/linux64/Debug --self-contained true dotnet publish "./logic/Server/Server.csproj" -c Debug -r linux-x64 -o ./THUAI6/linux/linux64/Debug --self-contained true
dotnet publish "./logic/Client/Client.csproj" -c Release -r win-x64 -o ./THUAI6/win/win64 --self-contained true dotnet publish "./logic/Client/Client.csproj" -c Release -r win-x64 -o ./THUAI6/win/win64 --self-contained true


rm ./THUAI6/linux/linux64/System.*.dll
rm ./THUAI6/linux/linux64/Debug/System.*.dll
rm ./THUAI6/win/win64/System.*.dll
rm ./THUAI6/win/win64/Debug/System.*.dll
rm ./THUAI6/linux/linux64/*.pdb rm ./THUAI6/linux/linux64/*.pdb
rm ./THUAI6/linux/linux64/Debug/*.pdb rm ./THUAI6/linux/linux64/Debug/*.pdb
rm ./THUAI6/win/win64/*.pdb rm ./THUAI6/win/win64/*.pdb
rm ./THUAI6/win/win64/Debug/*.pdb rm ./THUAI6/win/win64/Debug/*.pdb
rm ./THUAI6/win/win64/Debug/grpc_csharp_ext.x64.dll
rm ./THUAI6/win/win64/grpc_csharp_ext.x64.dll

rm ./THUAI6/linux/linux64/*.so
rm ./THUAI6/linux/linux64/Debug/*.so


- name: Copy CAPI - name: Copy CAPI
run: | run: |
@@ -120,23 +111,38 @@ jobs:
image_import: ./images image_import: ./images
build_html: false build_html: false


- name: Hash Files
run: |
python ./dependency/py/HashFiles.py -t ./THUAI6
- name: Upload COS - name: Upload COS
uses: zkqiang/tencent-cos-action@v0.1.0 uses: zkqiang/tencent-cos-action@v0.1.0
with: with:
args: upload -r ./THUAI6/ /THUAI6/
args: upload -r ./THUAI6/hash.json /
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }} secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }} secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
bucket: ${{ secrets.COS_BUCKET }} bucket: ${{ secrets.COS_BUCKET }}
region: ${{ secrets.COS_REGION }} region: ${{ secrets.COS_REGION }}


- name: Hash Files
run: |
python ./dependency/py/HashFiles.py -t ./THUAI6
- name: Remove Files
run: |
rm ./THUAI6/hash.json
rm ./THUAI6/win/win64/PresentationCore.dll
rm ./THUAI6/win/win64/WindowsBase.dll
rm ./THUAI6/linux/linux64/System.*.dll
rm ./THUAI6/linux/linux64/Debug/System.*.dll
rm ./THUAI6/win/win64/System.*.dll
rm ./THUAI6/win/win64/Debug/System.*.dll
rm ./THUAI6/win/win64/Debug/grpc_csharp_ext.x64.dll
rm ./THUAI6/win/win64/grpc_csharp_ext.x64.dll

rm ./THUAI6/linux/linux64/*.so
rm ./THUAI6/linux/linux64/Debug/*.so
- name: Upload COS - name: Upload COS
uses: zkqiang/tencent-cos-action@v0.1.0 uses: zkqiang/tencent-cos-action@v0.1.0
with: with:
args: upload -r ./THUAI6/hash.json /
args: upload -r ./THUAI6/ /THUAI6/
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }} secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }} secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
bucket: ${{ secrets.COS_BUCKET }} bucket: ${{ secrets.COS_BUCKET }}

+ 3
- 1
dependency/py/HashFiles.py View File

@@ -16,7 +16,9 @@ def generateHashFile():
path = os.path.join(root, file) path = os.path.join(root, file)
with open(path, 'rb') as f: with open(path, 'rb') as f:
data = f.read() data = f.read()
hashlist[path.replace('\\','/')]=hashlib.md5(data).hexdigest()
pathr = path.replace('../','')
pathr = path.replace('./','')
hashlist[pathr.replace('\\','/')]=hashlib.md5(data).hexdigest()
targetFile=os.path.join(targetfolder,'hash.json') targetFile=os.path.join(targetfolder,'hash.json')
with open(targetFile, 'w') as fp: with open(targetFile, 'w') as fp:
json.dump(hashlist,fp) json.dump(hashlist,fp)


Loading…
Cancel
Save