mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-31 04:44:16 +08:00
90b403fb3d
+ add steps: package + release to add packaged build to release when pushing on tag + support building on prefixed branch name with wildcard + support event trigger on tag + support event trigger on workflow dispatch for manual trigger
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
name: Generate emu config script (Windows)
|
|
|
|
on:
|
|
push:
|
|
branches: [
|
|
"ci-build-gen-win*",
|
|
"ci-build-all"
|
|
]
|
|
tags:
|
|
- release*
|
|
pull_request:
|
|
branches: [ "dev" ]
|
|
workflow_dispatch:
|
|
# nothing
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}"
|
|
ARTIFACT_ROOT_PATH: "scripts/bin/win"
|
|
PACKAGE_ROOT_PATH: "scripts/bin/package"
|
|
|
|
# Expected format {owner}/{repo}.
|
|
DEPS_REPO: 'otavepto/gbe_fork'
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Checkout branch
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Clone third-party deps (deps/win)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: "${{env.DEPS_REPO}}"
|
|
ref: 'third-party/deps/win'
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
|
|
|
|
- name: Install dependencies
|
|
shell: cmd
|
|
working-directory: ${{ github.workspace }}/scripts
|
|
run: recreate_venv_win.bat
|
|
|
|
- name: Rebuild
|
|
shell: cmd
|
|
working-directory: ${{ github.workspace }}/scripts
|
|
run: rebuild_win.bat
|
|
|
|
- name: Package build
|
|
shell: cmd
|
|
working-directory: ${{ github.workspace }}/scripts
|
|
run: package_win.bat
|
|
|
|
- name: Upload build package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "${{ env.ARTIFACT_NAME }}"
|
|
path: "${{ env.PACKAGE_ROOT_PATH }}/win/"
|
|
if-no-files-found: 'error'
|
|
compression-level: 9
|
|
retention-days: 1
|
|
|
|
- name: Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: "${{ env.PACKAGE_ROOT_PATH }}/**/*"
|
|
|