Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
ActivePeter committed Oct 13, 2024
1 parent 2f966f4 commit b715d09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
python3 -c '
import yaml, os, json
folders = [f"releases/{d[:-3]}" for d in os.listdir("./") if d.endswith(".yml")]
folders = [f"releases/{d[:-4]}" for d in os.listdir("./") if d.endswith(".yml")]
with open("folders.json", "w") as fh:
json.dump(folders, fh)
'
Expand All @@ -70,6 +70,7 @@ jobs:

create_releases:
needs: build
permissions: write-all
runs-on: ubuntu-latest

steps:
Expand All @@ -84,6 +85,7 @@ jobs:
- name: Read folders
id: read_folders
run: |
cat folders.json
folders=$(cat folders.json)
echo "folders=$folders" >> $GITHUB_OUTPUT
Expand All @@ -108,10 +110,12 @@ jobs:
# 遍历文件夹列表,创建 release
for folder in folder_list:
print(f"Creating release for folder: {folder}")
print(f"Files in {folder}: {os.listdir(folder)}")
folder_name = os.path.basename(folder)
# 使用 os.system 调用 'gh release create' 命令
os.system(f'gh release create {folder_name} --title "Release for {folder}" --notes "Automated release"')
EOF
env:
folders: ${{ steps.read_folders.outputs.folders }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b715d09

Please sign in to comment.