0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-04-24 16:35:23 +00:00
2024-11-27 21:22:21 +08:00

109 lines
4.0 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 launcher
runs-on: windows-latest
steps:
- name: Configure git
run: |
git config --global user.email "ok-oldking@users.noreply.github.com"
git config --global user.name "ok-oldking"
- name: Checkout source repository
uses: actions/checkout@v4
with:
token: ${{ secrets.OK_GH }}
fetch-depth: 0
- 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.12' # Use the version of Python you need
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Copy ok-script lib
run: |
python -m ok.update.copy_ok_folder
- name: Rename .py files to .pyx
run: |
Get-ChildItem -Path .\src -Recurse -Filter *.py -Exclude '__init__.py' | ForEach-Object { Rename-Item $_.FullName -NewName ($_.FullName -replace '\.py$', '.pyx') }
- name: build cython
run: |
python setup.py build_ext --inplace
Get-ChildItem -Path .\src -Recurse -Filter *.pyx | ForEach-Object { Remove-Item $_.FullName }
Get-ChildItem -Path .\src -Recurse -Filter *.cpp | ForEach-Object { Remove-Item $_.FullName }
- name: Run tests
run: |
python -m ok.test.RunTests
- name: Build Executable
run: |
echo "tag: ${{ steps.changes.outputs.tag }}"
echo "changes: ${{ steps.changes.outputs.changes }}"
python -m ok.update.package_launcher ${{ steps.tagName.outputs.tag }} deploy.txt
python -m ok.update.package_full_with_profile ${{ steps.tagName.outputs.tag }} 1
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse
7z a -t7z -r "ok-ww-CPU-full-${{ steps.tagName.outputs.tag }}.7z" "ok-ww"
Remove-Item -Path "ok-ww" -Recurse -Force
python -m ok.update.package_full_with_profile ${{ steps.tagName.outputs.tag }} 0
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse
7z a -t7z -r "ok-ww-Nvidia-GPU-full-${{ steps.tagName.outputs.tag }}.7z" "ok-ww"
Remove-Item -Path "ok-ww" -Recurse -Force
shell: pwsh
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
ok-ww-Nvidia-GPU-full (Nvidia GPU >=RTX2000 with latest driver)
ok-ww-CPU-full (AMD or other GPUs)
Updates
${{ steps.changes.outputs.changes }}
draft: false
prerelease: true
files: |
ok-ww-CPU-full-${{ steps.tagName.outputs.tag }}.7z
ok-ww-Nvidia-GPU-full-${{ steps.tagName.outputs.tag }}.7z
- name: push to ok-ww-update
run: |
python -m ok.update.push_repos --repos https://ok-oldking:${{ secrets.OK_GH }}@github.com/ok-oldking/ok-ww-update --files src ok config.py launcher.json launcher.py main.py ok-ww.exe main.py main_debug.py main_gpu.py main_gpu_debug.py assets i18n icon.png requirements.txt
- name: push to coding
run: |
python -m ok.update.push_repos --repos https://${{ secrets.CODING_USERNAME }}:${{ secrets.CODING_PASSWORD }}@e.coding.net/g-frfh1513/ok-wuthering-waves/ok-wuthering-waves.git --files src ok config.py launcher.json launcher.py main.py ok-ww.exe main.py main_debug.py main_gpu.py main_gpu_debug.py assets i18n icon.png requirements.txt