2024-05-11 22:17:02 +08:00
|
|
|
name: Build migrate_gse script (Windows)
|
2024-04-20 11:15:11 +08:00
|
|
|
|
|
|
|
on:
|
2024-05-11 22:17:02 +08:00
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
2024-04-20 11:15:11 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
# allows manual trigger
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
ARTIFACT_NAME: "migrate_gse-win-${{ github.sha }}"
|
|
|
|
SCRIPT_BASE_DIR: "tools/migrate_gse"
|
2024-05-11 22:17:02 +08:00
|
|
|
PACKAGE_BASE_DIR: "tools/migrate_gse/bin/win"
|
2024-04-20 11:15:11 +08:00
|
|
|
|
|
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Python 3.10
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
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
|
|
|
|
|
2024-04-20 11:15:11 +08:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
## extra helpers/tools, these are not built inside the deps build dir
|
|
|
|
- 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
|
2024-04-20 11:15:11 +08:00
|
|
|
shell: cmd
|
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
|
|
|
run: recreate_venv_win.bat
|
|
|
|
|
|
|
|
# build
|
|
|
|
- name: Rebuild
|
|
|
|
shell: cmd
|
|
|
|
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
|
|
|
|
run: rebuild_win.bat
|
|
|
|
|
|
|
|
# upload artifact
|
|
|
|
- name: Upload build package
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "${{ env.ARTIFACT_NAME }}"
|
|
|
|
path: "${{ env.PACKAGE_BASE_DIR }}/"
|
|
|
|
if-no-files-found: 'error'
|
|
|
|
compression-level: 9
|
|
|
|
retention-days: 1
|