scripts for gen_emu_config_tool

This commit is contained in:
otavepto 2024-05-11 16:51:29 +03:00
parent 470003f926
commit d14a726d75
7 changed files with 104 additions and 78 deletions

View File

@ -36,7 +36,7 @@ jobs:
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions for repo folder
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
run: sudo chmod -R 777 "${{ github.workspace }}"

View File

@ -105,7 +105,7 @@ jobs:
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions for repo folder
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
run: sudo chmod -R 777 "${{ github.workspace }}"

View File

@ -50,7 +50,7 @@ jobs:
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions for repo folder
- name: Give all permissions to repo folder
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}

View File

@ -1,20 +1,8 @@
name: Generate emu config script (Linux)
name: Build gen_emu_config script (Linux)
on:
push:
branches: [
"ci-build-gen-linux*",
"ci-build-all"
]
tags:
- release*
pull_request:
branches: [ "dev" ]
paths:
- '!**/*.md'
- 'tools/generate_emu_config/**'
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger
@ -24,7 +12,7 @@ permissions:
env:
ARTIFACT_NAME: "generate_emu_config-linux-${{ github.sha }}"
SCRIPT_BASE_DIR: "tools/generate_emu_config"
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/package/linux"
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/linux"
jobs:
build:
@ -36,13 +24,13 @@ jobs:
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions for repo folder
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
run: sudo chmod -R 777 "${{ github.workspace }}"
# deps
- name: Install dependencies
# env
- name: Install env
shell: bash
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 77 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh
@ -51,13 +39,7 @@ jobs:
- name: Rebuild
shell: bash
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 77 rebuild_linux.sh && sudo ./rebuild_linux.sh
# package
- name: Package build
shell: bash
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 77 package_linux.sh && sudo ./package_linux.sh
run: sudo chmod 77 rebuild_linux.sh && ./rebuild_linux.sh
# upload artifact
- name: Upload build package
@ -68,11 +50,3 @@ jobs:
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
# release tag
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: "${{ env.PACKAGE_BASE_DIR }}/**/*"

View File

@ -1,20 +1,8 @@
name: Generate emu config script (Windows)
name: Build gen_emu_config script (Windows)
on:
push:
branches: [
"ci-build-gen-win*",
"ci-build-all"
]
tags:
- release*
pull_request:
branches: [ "dev" ]
paths:
- '!**/*.md'
- 'tools/generate_emu_config/**'
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger
@ -24,10 +12,7 @@ permissions:
env:
ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}"
SCRIPT_BASE_DIR: "tools/generate_emu_config"
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/package/win"
THIRD_PARTY_BASE_DIR: 'third-party'
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/win"
jobs:
build:
@ -67,12 +52,6 @@ jobs:
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: rebuild_win.bat
# package
- name: Package build
shell: cmd
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: package_win.bat
# upload artifact
- name: Upload build package
uses: actions/upload-artifact@v4
@ -82,11 +61,3 @@ jobs:
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
# release tag
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: "${{ env.PACKAGE_BASE_DIR }}/**/*"

View File

@ -0,0 +1,22 @@
name: Emu pull request
on:
pull_request:
branches: [ "dev" ]
paths:
- '!**/*.md'
- 'tools/generate_emu_config/**'
permissions:
contents: write
jobs:
script-win:
name: Gen emu config win
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-win.yml
script-linux:
name: Gen emu config linux
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-linux.yml

View File

@ -12,7 +12,6 @@ permissions:
contents: write
env:
PACKAGE_BASE_DIR: "build/package/win"
THIRD_PARTY_BASE_DIR: 'third-party'
jobs:
@ -21,6 +20,10 @@ jobs:
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-build-all-win.yml
gen_emu_script-win:
name: Gen emu config win
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-win.yml
emu-win-prep:
needs: [ emu-win-all ]
@ -37,21 +40,21 @@ jobs:
# we need branch because it has package scripts
- name: Checkout branch
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
## donwload artifacts
- name: Download emu build artifacts (Win)
uses: actions/download-artifact@v4
with:
# name: "emu-win-release"
path: build/prep
pattern: emu-*
merge-multiple: true
- name: Extract all build artifacts (Win)
@ -70,8 +73,8 @@ jobs:
- name: Upload build package (release)
uses: actions/upload-artifact@v4
with:
name: "build-win-release-${{ github.sha }}"
path: "${{ env.PACKAGE_BASE_DIR }}/release/"
name: "build-win-release"
path: "build/package/win/release/"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
@ -86,12 +89,68 @@ jobs:
- name: Upload build package (debug)
uses: actions/upload-artifact@v4
with:
name: "build-win-debug-${{ github.sha }}"
path: "${{ env.PACKAGE_BASE_DIR }}/debug/"
name: "build-win-debug"
path: "build/package/win/debug/"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
gen_emu_script-win-prep:
needs: [ gen_emu_script-win ]
runs-on: windows-2022
steps:
# 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
# we need branch because it has package scripts
- name: Checkout branch
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
## donwload artifacts
- name: Download gen_emu_script build artifacts (Win)
uses: actions/download-artifact@v4
with:
# name: "emu-win-release"
path: build/prep
pattern: generate_emu_config-*
merge-multiple: true
- name: Extract all build artifacts (Win)
shell: cmd
working-directory: ${{ github.workspace }}
run: |
"${{env.THIRD_PARTY_BASE_DIR}}\deps\win\7za\7za.exe" x "build\prep\*.zip" -aos -o"tools\generate_emu_config\bin\win"
### package
- name: Package generate_emu_config
shell: cmd
working-directory: "tools/generate_emu_config"
run: package_win.bat
### upload artifact/package to github Actions
- name: Upload generate_emu_config package (release)
uses: actions/upload-artifact@v4
with:
name: "generate_emu_config-win"
path: "generate_emu_config/bin/package/"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
# ### release (debug + release modes)
# - name: Release
# uses: softprops/action-gh-release@v1