2024-05-11 16:51:29 +03:00
|
|
|
name: Build gen_emu_config script (Windows)
|
2023-12-16 07:20:05 +02:00
|
|
|
|
|
|
|
on:
|
2024-05-11 16:51:29 +03:00
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
2023-12-17 01:58:52 +02:00
|
|
|
workflow_dispatch:
|
2023-12-20 15:07:01 +02:00
|
|
|
# allows manual trigger
|
2023-12-16 07:20:05 +02:00
|
|
|
|
|
|
|
permissions:
|
2023-12-17 01:58:52 +02:00
|
|
|
contents: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}"
|
2023-12-28 02:15:39 +02:00
|
|
|
SCRIPT_BASE_DIR: "tools/generate_emu_config"
|
2024-05-11 16:51:29 +03:00
|
|
|
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/win"
|
2023-12-16 07:20:05 +02:00
|
|
|
|
2024-05-11 16:52:52 +03:00
|
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
|
2023-12-16 07:20:05 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
2024-06-16 17:02:45 +03:00
|
|
|
- name: Set up Python
|
2024-04-14 21:09:32 +02:00
|
|
|
uses: actions/setup-python@v5
|
2023-12-16 07:20:05 +02:00
|
|
|
with:
|
2024-06-16 17:02:45 +03:00
|
|
|
python-version: "3.12"
|
2023-12-16 07:20:05 +02:00
|
|
|
|
2024-05-11 17:24:12 +03: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 07:25:21 +02:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2023-12-31 19:53:11 +02:00
|
|
|
## extra helpers/tools, these are not built inside the deps build dir
|
2023-12-31 19:54:03 +02: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 17:17:02 +03:00
|
|
|
# env
|
|
|
|
- name: Install env
|
2023-12-16 07:20:05 +02:00
|
|
|
shell: cmd
|
2023-12-26 02:14:37 +02:00
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
2023-12-16 09:55:36 +02:00
|
|
|
run: recreate_venv_win.bat
|
2023-12-16 07:20:05 +02:00
|
|
|
|
2023-12-31 19:53:11 +02:00
|
|
|
# build
|
2023-12-16 07:20:05 +02:00
|
|
|
- name: Rebuild
|
|
|
|
shell: cmd
|
2023-12-26 02:14:37 +02:00
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
2023-12-16 09:55:36 +02:00
|
|
|
run: rebuild_win.bat
|
2023-12-16 07:20:05 +02:00
|
|
|
|
2023-12-31 19:53:11 +02:00
|
|
|
# upload artifact
|
2023-12-17 01:58:52 +02:00
|
|
|
- name: Upload build package
|
2023-12-16 07:20:05 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2023-12-17 01:58:52 +02:00
|
|
|
name: "${{ env.ARTIFACT_NAME }}"
|
2023-12-28 02:15:39 +02:00
|
|
|
path: "${{ env.PACKAGE_BASE_DIR }}/"
|
2023-12-16 07:20:05 +02:00
|
|
|
if-no-files-found: 'error'
|
|
|
|
compression-level: 9
|
2023-12-16 17:35:20 +02:00
|
|
|
retention-days: 1
|