88 lines
2.3 KiB
YAML
Raw Normal View History

2024-04-26 09:10:23 +08:00
name: build
2024-04-26 08:43:34 +08:00
on:
push:
2024-11-06 06:46:35 +08:00
paths: [ '.github/workflows/build.yml','py/**']
2024-04-26 08:43:34 +08:00
pull_request:
2024-11-06 06:46:35 +08:00
paths: [ '.github/workflows/build.yml','py/**']
jobs:
2024-11-06 06:46:35 +08:00
hook:
runs-on: windows-latest
strategy:
matrix:
bits: [32, 64]
permissions:
id-token: write
attestations: write
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- run: python cpp/LunaHook/build.py build English ${{matrix.bits}}
- uses: actions/upload-artifact@v4
with:
name: hook_${{matrix.bits}}
path: cpp/LunaHook/builds/Release_English
2024-11-02 19:55:32 +08:00
pyrt:
runs-on: windows-latest
2024-04-26 17:18:10 +08:00
strategy:
matrix:
2024-11-02 19:55:32 +08:00
architecture: [x86, x64]
steps:
2024-11-02 19:55:32 +08:00
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
2024-06-25 17:53:01 +08:00
python-version: '3.7.9'
2024-04-26 17:18:10 +08:00
architecture: ${{ matrix.architecture }}
2024-05-01 17:40:57 +08:00
2024-11-06 06:46:35 +08:00
- run: python py/build.py pyrt ${{ matrix.architecture }} 3.7.9
2024-11-02 19:55:32 +08:00
- uses: actions/upload-artifact@v4
2024-05-01 22:45:59 +08:00
with:
2024-11-02 19:55:32 +08:00
name: pyrt_${{ matrix.architecture }}
2024-11-06 06:46:35 +08:00
path: py/pyrt
2024-11-02 19:55:32 +08:00
build_cpp:
runs-on: windows-latest
strategy:
matrix:
architecture: [x86, x64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
2024-11-06 06:46:35 +08:00
- run: python py/build.py cpp ${{ matrix.architecture }}
2024-11-02 19:55:32 +08:00
- uses: actions/upload-artifact@v4
with:
name: cpp_${{ matrix.architecture }}
2024-11-06 06:46:35 +08:00
path: cpp/builds
2024-05-01 22:45:59 +08:00
2024-11-02 19:55:32 +08:00
release:
runs-on: windows-latest
2024-11-06 06:46:35 +08:00
needs: [pyrt,build_cpp,hook]
2024-11-02 19:55:32 +08:00
strategy:
matrix:
include:
- architecture: x86
fname: LunaTranslator_x86
- architecture: x64
fname: LunaTranslator
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: build
2024-11-06 06:46:35 +08:00
- run: python py/build.py merge ${{ matrix.architecture }}
2024-04-26 17:18:10 +08:00
- uses: actions/upload-artifact@v4
with:
2024-04-26 17:18:10 +08:00
name: ${{ matrix.fname }}
2024-11-06 06:46:35 +08:00
path: py/build/${{matrix.fname}}.zip