fix: 修复 YAML 文件编码为 UTF-8
Some checks failed
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Failing after 1m31s
Some checks failed
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Failing after 1m31s
This commit is contained in:
24
.github/workflows/release_skill.yaml
vendored
24
.github/workflows/release_skill.yaml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: 技能自动化发布 (测试版-无鉴权)
|
name: 技能自动化发布 (测试版-无鉴权)
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
@@ -7,23 +7,23 @@ jobs:
|
|||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# 1. 下载源码
|
# 1. 下载源码
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
# 2. 环境及工具准备
|
# 2. 环境及工具准备
|
||||||
- name: Setup Tools
|
- name: Setup Tools
|
||||||
run: pip install pyarmor requests python-frontmatter
|
run: pip install pyarmor requests python-frontmatter
|
||||||
|
|
||||||
# 3. 【核心步骤】PyArmor 源代码混淆加密
|
# 3. 【核心步骤】PyArmor 源代码混淆加密
|
||||||
- name: Encrypt Source Code
|
- name: Encrypt Source Code
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/package
|
mkdir -p dist/package
|
||||||
# 使用 PyArmor 加密 scripts 目录下的所有 Python 源码
|
# 使用 PyArmor 加密 scripts 目录下的所有 Python 源码
|
||||||
pyarmor gen -O dist/package scripts/*.py
|
pyarmor gen -O dist/package scripts/*.py
|
||||||
# 拷贝说明文档到发包目录
|
# 拷贝说明文档到发包目录
|
||||||
cp SKILL.md dist/package/
|
cp SKILL.md dist/package/
|
||||||
|
|
||||||
# 4. 提取元数据并物理打包
|
# 4. 提取元数据并物理打包
|
||||||
- name: Parse Metadata and Pack
|
- name: Parse Metadata and Pack
|
||||||
id: build_task
|
id: build_task
|
||||||
run: |
|
run: |
|
||||||
@@ -33,28 +33,28 @@ jobs:
|
|||||||
metadata = post.metadata
|
metadata = post.metadata
|
||||||
slug = metadata['name']
|
slug = metadata['name']
|
||||||
version = metadata['version']
|
version = metadata['version']
|
||||||
# 设置变量供后续 API 调用使用
|
# 设置变量供后续 API 调用使用
|
||||||
print(f'::set-output name=slug::{slug}')
|
print(f'::set-output name=slug::{slug}')
|
||||||
print(f'::set-output name=version::{version}')
|
print(f'::set-output name=version::{version}')
|
||||||
print(f'::set-output name=metadata::{json.dumps(metadata)}')
|
print(f'::set-output name=metadata::{json.dumps(metadata)}')
|
||||||
# 制作最终的发布 ZIP 包
|
# 制作最终的发布 ZIP 包
|
||||||
shutil.make_archive(slug, 'zip', 'dist/package')
|
shutil.make_archive(slug, 'zip', 'dist/package')
|
||||||
"
|
"
|
||||||
|
|
||||||
# 5. 同步数据库记录 (对应接口: /api/skill/update)
|
# 5. 同步数据库记录 (对应接口: /api/skill/update)
|
||||||
- name: Sync Database (V2.0)
|
- name: Sync Database (V2.0)
|
||||||
run: |
|
run: |
|
||||||
python -c "
|
python -c "
|
||||||
import requests, json
|
import requests, json
|
||||||
metadata = json.loads('${{ steps.build_task.outputs.metadata }}')
|
metadata = json.loads('${{ steps.build_task.outputs.metadata }}')
|
||||||
# 严谨修正:接口路径为 /api/skill/update
|
# 严谨修正:接口路径为 /api/skill/update
|
||||||
url = 'https://jc2009.com/api/skill/update'
|
url = 'https://jc2009.com/api/skill/update'
|
||||||
res = requests.post(url, json=metadata)
|
res = requests.post(url, json=metadata)
|
||||||
print(f'DB Sync Result: {res.text}')
|
print(f'DB Sync Result: {res.text}')
|
||||||
if res.status_code != 200: exit(1)
|
if res.status_code != 200: exit(1)
|
||||||
"
|
"
|
||||||
|
|
||||||
# 6. 上传物理包 (对应接口: /api/upload)
|
# 6. 上传物理包 (对应接口: /api/upload)
|
||||||
- name: Upload Encrypted ZIP
|
- name: Upload Encrypted ZIP
|
||||||
run: |
|
run: |
|
||||||
SLUG=${{ steps.build_task.outputs.slug }}
|
SLUG=${{ steps.build_task.outputs.slug }}
|
||||||
|
|||||||
Reference in New Issue
Block a user