2024-05-11 21:51:29 +08:00
|
|
|
name: Build gen_emu_config script (Windows)
|
2023-12-16 13:20:05 +08:00
|
|
|
|
|
|
|
on:
|
2024-05-11 21:51:29 +08:00
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
2023-12-17 07:58:52 +08:00
|
|
|
workflow_dispatch:
|
2023-12-20 21:07:01 +08:00
|
|
|
# allows manual trigger
|
2023-12-16 13:20:05 +08:00
|
|
|
|
|
|
|
permissions:
|
2023-12-17 07:58:52 +08:00
|
|
|
contents: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}"
|
2023-12-28 08:15:39 +08:00
|
|
|
SCRIPT_BASE_DIR: "tools/generate_emu_config"
|
2024-05-11 21:51:29 +08:00
|
|
|
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/win"
|
2023-12-16 13:20:05 +08:00
|
|
|
|
2024-05-11 21:52:52 +08:00
|
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
|
2023-12-16 13:20:05 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Python 3.10
|
2024-04-15 03:09:32 +08:00
|
|
|
uses: actions/setup-python@v5
|
2023-12-16 13:20:05 +08:00
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
2024-05-11 22:24:12 +08:00
|
|
|
### on Windows Git will auto change line ending to CRLF, not preferable
|
|
|
|
- name: Ensure LF line ending
|
|
|
|
shell: cmd
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
git config --local core.autocrlf false
|
|
|
|
git config --system core.autocrlf false
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
|
2023-12-16 13:25:21 +08:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-01-01 01:53:11 +08:00
|
|
|
## extra helpers/tools, these are not built inside the deps build dir
|
2024-01-01 01:54:03 +08:00
|
|
|
- name: Clone third-party deps (build/win)
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: 'third-party/build/win'
|
|
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
|
|
|
|
|
2024-05-11 22:17:02 +08:00
|
|
|
# env
|
|
|
|
- name: Install env
|
2023-12-16 13:20:05 +08:00
|
|
|
shell: cmd
|
2023-12-26 08:14:37 +08:00
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
2023-12-16 15:55:36 +08:00
|
|
|
run: recreate_venv_win.bat
|
2023-12-16 13:20:05 +08:00
|
|
|
|
2024-01-01 01:53:11 +08:00
|
|
|
# build
|
2023-12-16 13:20:05 +08:00
|
|
|
- name: Rebuild
|
|
|
|
shell: cmd
|
2023-12-26 08:14:37 +08:00
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
2023-12-16 15:55:36 +08:00
|
|
|
run: rebuild_win.bat
|
2023-12-16 13:20:05 +08:00
|
|
|
|
2024-01-01 01:53:11 +08:00
|
|
|
# upload artifact
|
2023-12-17 07:58:52 +08:00
|
|
|
- name: Upload build package
|
2023-12-16 13:20:05 +08:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2023-12-17 07:58:52 +08:00
|
|
|
name: "${{ env.ARTIFACT_NAME }}"
|
2023-12-28 08:15:39 +08:00
|
|
|
path: "${{ env.PACKAGE_BASE_DIR }}/"
|
2023-12-16 13:20:05 +08:00
|
|
|
if-no-files-found: 'error'
|
|
|
|
compression-level: 9
|
2023-12-16 23:35:20 +08:00
|
|
|
retention-days: 1
|