Init_3D_Releases #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Init_3D_Releases | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write # ✅ 允许创建/修改 Release | |
jobs: | |
init_releases: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check gh auth status | |
run: gh auth status | |
- name: Install unzip & gh | |
run: sudo apt-get update && sudo apt-get install unzip -y | |
- name: Download Seed via gh CLI | |
run: | | |
mkdir -p seed | |
gh release download v0.1 \ | |
--pattern "tasks_3d.sql.zip" \ | |
--repo suwei8/LottoAI3_HitMatrix_date_3d \ | |
--dir seed | |
echo "📁 下载完成,内容如下:" | |
ls -lh seed/ | |
- name: Unzip Seed File | |
run: | | |
unzip -P "${{ secrets.BACKUP_PASSWORD }}" seed/tasks_3d.sql.zip -d seed/ | |
echo "📂 解压内容:" | |
[ -f seed/tasks_3d.sql ] || (echo "❌ 解压后未找到 tasks_3d.sql" && exit 1) | |
ls -lh seed/ | |
- name: Split & Upload to 3D Releases | |
run: | | |
PLAYTYPES=( | |
danguan_1 | |
shuangdan_2 | |
sandan_3 | |
wuma_zuxuan | |
liuma_zuxuan | |
qima_zuxuan | |
sha1 | |
sha2 | |
baiwei_ding3 | |
shiwei_ding3 | |
gewei_ding3 | |
baiwei_ding1 | |
shiwei_ding1 | |
gewei_ding1 | |
ding_3x3x3_bai | |
ding_3x3x3_shi | |
ding_3x3x3_ge | |
ding_4x4x4_bai | |
ding_4x4x4_shi | |
ding_4x4x4_ge | |
ding_5x5x5_bai | |
ding_5x5x5_shi | |
ding_5x5x5_ge | |
) | |
for pt in "${PLAYTYPES[@]}"; do | |
cp seed/tasks_3d.sql 3d_tasks_${pt}.sql | |
zip -P ${{ secrets.BACKUP_PASSWORD }} 3d_tasks_${pt}.sql.zip 3d_tasks_${pt}.sql | |
gh release delete 3d_${pt} --yes --repo suwei8/LottoAI3_HitMatrix_date_3d || echo '✅ Release 不存在,跳过删除' | |
gh release create 3d_${pt} --repo suwei8/LottoAI3_HitMatrix_date_3d --title "Init 3d_${pt}" --notes "初始化玩法 ${pt}" | |
gh release upload 3d_${pt} 3d_tasks_${pt}.sql.zip --repo suwei8/LottoAI3_HitMatrix_date_3d --clobber | |
echo "✅ 已初始化上传 ➜ 3d_${pt}" | |
done |