更换项目结构,添加build代码 #5
Workflow file for this run
This file contains 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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' # 只在标签以 "v" 开头时触发 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # 你可以指定具体的 Python 版本 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt # 如果你有 requirements.txt 文件 | |
- name: Run build script | |
run: python build.py # 使用Python运行build.py | |
- name: Copy assets | |
run: | | |
mkdir -p build/assets | |
cp -r assets build/assets # 复制 assets 目录到 build 目录 | |
- name: List Files | |
run: | | |
echo "Listing files in dist/assets/" | |
ls -R dist/assets/ | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref }} | |
files: | | |
dist/MAA_YYS_BACKEND | |
dist/MAA_YYS | |
dist/assets/** | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |