支持油壶 #388
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 Windows Executable | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build exe with launcher | |
runs-on: windows-latest | |
env: | |
PYTHONIOENCODING: 'UTF-8' | |
strategy: | |
matrix: | |
python-version: [ 3.12 ] | |
steps: | |
- name: Configure git | |
run: | | |
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
git config --global user.email "[email protected]" | |
git config --global user.name "ok-oldking" | |
echo "action_state=yellow" >> $env:GITHUB_ENV | |
echo "${{ env.action_state }}" | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set UTF-8 encoding | |
run: | | |
set PYTHONIOENCODING=utf-8 | |
set PYTHONLEGACYWINDOWSSTDIO=utf-8 | |
echo PYTHONIOENCODING=utf-8 >> $GITHUB_ENV | |
- name: Get Changes between Tags | |
id: changes | |
uses: simbo/changes-between-tags-action@v1 | |
with: | |
include-hashes: false | |
validate-tag: true | |
- name: Get tag name | |
id: tagName | |
uses: olegtarasov/[email protected] | |
- 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: | | |
Get-ChildItem -Path ".\tests\*.py" | ForEach-Object { | |
Write-Host "Running tests in $($_.FullName)" | |
python -m unittest $_.FullName | |
} | |
- 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 | |
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse | |
7z a -t7z -r "ok-ww-${{ 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: | |
body: | | |
ok-ww-CPU-full (AMD or other GPUs) | |
Updates: | |
${{ steps.changes.outputs.changes }} | |
draft: false | |
prerelease: true | |
files: | | |
ok-ww-${{ 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 deploy.txt --tag ${{ steps.tagName.outputs.tag }} | |
- 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 deploy.txt --tag ${{ steps.tagName.outputs.tag }} | |