0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-06-05 08:25:28 +00:00
firedcto@gmail.com 325f53eee9 first commit
2024-06-08 16:41:13 +08:00

97 lines
3.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build Windows Executable
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*'
jobs:
build:
name: Build exe with PyInstaller
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
name: Checkout code
with:
fetch-depth: 0 # Important: fetch all history for all tags and branches
- name: Get Changes between Tags
id: changes
uses: simbo/changes-between-tags-action@v1
with:
validate-tag: false
- name: Get tag name
id: tagName
uses: olegtarasov/get-tag@v2.1.3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Use the version of Python you need
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller # Add other dependencies if needed
pip install -r requirements.txt
- name: Build Executable
run: |
echo "tag: ${{ steps.changes.outputs.tag }}"
echo "changes: ${{ steps.changes.outputs.changes }}"
echo ${{ github.sha }} > Release.txt
(Get-Content config.py) -replace 'version = "v\d+\.\d+\.\d+"', 'version = "${{ steps.tagName.outputs.tag }}"' | Set-Content config.py
pyinstaller main.spec
python -m ok.update.gen_md5 .\dist\bundle
mv dist/bundle ok-baijing
7z a -t7z -r "ok-baijing-release-${{ steps.tagName.outputs.tag }}.7z" "ok-baijing"
rm -r dist
rm -r ok-baijing
pyinstaller main_debug.spec
python -m ok.update.gen_md5 .\dist\bundle
mv dist/bundle ok-baijing
7z a -t7z -r "ok-baijing-debug-${{ steps.tagName.outputs.tag }}.7z" "ok-baijing"
shell: pwsh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
下载release.7z文件然后解压缩后运行, 如果需要查找问题上传更多日志才需要下载debug版本
最好使用模拟器运行安卓版可以挂后台稳定。PC版游戏可能兼容性较差无法挂后台。
更新内容:
${{ steps.changes.outputs.changes }}
draft: false
prerelease: true
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-baijing-release-${{ steps.tagName.outputs.tag }}.7z
asset_name: ok-baijing-release-${{ steps.tagName.outputs.tag }}.7z
asset_content_type: application/zip
- name: upload-win-debug
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-baijing-debug-${{ steps.tagName.outputs.tag }}.7z
asset_name: ok-baijing-debug-${{ steps.tagName.outputs.tag }}.7z
asset_content_type: application/zip