1
0

chore: use new github action build layout

This commit is contained in:
2026-02-03 15:49:47 +08:00
parent b06bd587f6
commit 90fe7ddcaf
15 changed files with 49 additions and 46 deletions

View File

@@ -1,3 +1,4 @@
# GitHub Scripts # GitHub Scripts
These scripts should be executed at the root directory of each project respectively. These script files should be only used by GitHub Action.
These script files should be executed at the root directory of each project respectively.

View File

@@ -1,10 +1,6 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
YYCCommonplace_ROOT="${YYCCommonplace_ROOT:?YYCCommonplace_ROOT must be set}"
STB_ROOT="${STB_ROOT:?STB_ROOT must be set}"
ZLIB_ROOT="${ZLIB_ROOT:?ZLIB_ROOT must be set}"
# Create build directory and enter it # Create build directory and enter it
mkdir bin mkdir bin
cd bin cd bin

View File

@@ -1,10 +1,6 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
YYCCommonplace_ROOT="${YYCCommonplace_ROOT:?YYCCommonplace_ROOT must be set}"
STB_ROOT="${STB_ROOT:?STB_ROOT must be set}"
ZLIB_ROOT="${ZLIB_ROOT:?ZLIB_ROOT must be set}"
# Create build directory and enter it # Create build directory and enter it
mkdir bin mkdir bin
cd bin cd bin

View File

@@ -1,2 +1,2 @@
# Just directly record self as root directory # Just directly record self as root directory
set STB_ROOT=$(pwd) export STB_ROOT=$(pwd)

View File

@@ -1,2 +1,2 @@
# Just directly record self as root directory # Just directly record self as root directory
set STB_ROOT=$(pwd) export STB_ROOT=$(pwd)

View File

@@ -17,7 +17,7 @@ cd ..
# Record install directory # Record install directory
cd install cd install
set YYCCommonplace_ROOT=$(pwd) export YYCCommonplace_ROOT=$(pwd)
cd .. cd ..
# Back to root directory # Back to root directory

View File

@@ -17,7 +17,7 @@ cd ..
# Record install directory # Record install directory
cd install cd install
set YYCCommonplace_ROOT=$(pwd) export YYCCommonplace_ROOT=$(pwd)
cd .. cd ..
# Back to root directory # Back to root directory

View File

@@ -7,7 +7,7 @@ mkdir install
# Record install directory first because build step require it # Record install directory first because build step require it
cd install cd install
set ZLIB_ROOT=$(pwd) export ZLIB_ROOT=$(pwd)
cd .. cd ..
# Build in Release mode # Build in Release mode

View File

@@ -7,7 +7,7 @@ mkdir install
# Record install directory first because build step require it # Record install directory first because build step require it
cd install cd install
set ZLIB_ROOT=$(pwd) export ZLIB_ROOT=$(pwd)
cd .. cd ..
# Build in Release mode # Build in Release mode

View File

@@ -24,8 +24,7 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/YYCCommonplace cd extern/YYCCommonplace
chmod +x ../../.github/scripts/yycc-linux.sh source ../../.github/scripts/yycc/linux.sh
source ../../.github/scripts/yycc-linux.sh
echo "YYCCommonplace_ROOT=$YYCCommonplace_ROOT" >> "$GITHUB_ENV" echo "YYCCommonplace_ROOT=$YYCCommonplace_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Fetch ZLIB - name: Fetch ZLIB
@@ -38,8 +37,7 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/zlib cd extern/zlib
chmod +x ../../.github/scripts/zlib-linux.sh source ../../.github/scripts/zlib/linux.sh
source ../../.github/scripts/zlib-linux.sh
echo "ZLIB_ROOT=$ZLIB_ROOT" >> "$GITHUB_ENV" echo "ZLIB_ROOT=$ZLIB_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Fetch STB - name: Fetch STB
@@ -52,18 +50,22 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/stb cd extern/stb
chmod +x ../../.github/scripts/stb-linux.sh source ../../.github/scripts/stb/linux.sh
source ../../.github/scripts/stb-linux.sh
echo "STB_ROOT=$STB_ROOT" >> "$GITHUB_ENV" echo "STB_ROOT=$STB_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Build LibCmo - name: Build LibCmo
shell: bash shell: bash
run: | run: |
chmod +x ./.github/scripts/linux.sh source ./.github/scripts/linux.sh
./.github/scripts/linux.sh
- name: Upload Built Artifact - name: Upload Built Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: LibCmo-linux-build name: LibCmo-linux-build
path: bin/install/* path: bin/install/*
retention-days: 30 retention-days: 30
- name: Upload Built ependencies
uses: actions/upload-artifact@v4
with:
name: LibCmo-linux-dep
path: extern/zlib/install/*
retention-days: 30

View File

@@ -19,8 +19,7 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/YYCCommonplace cd extern/YYCCommonplace
chmod +x ../../.github/scripts/yycc-macos.sh source ../../.github/scripts/yycc/macos.sh
source ../../.github/scripts/yycc-macos.sh
echo "YYCCommonplace_ROOT=$YYCCommonplace_ROOT" >> "$GITHUB_ENV" echo "YYCCommonplace_ROOT=$YYCCommonplace_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Fetch ZLIB - name: Fetch ZLIB
@@ -33,8 +32,7 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/zlib cd extern/zlib
chmod +x ../../.github/scripts/zlib-macos.sh source ../../.github/scripts/zlib/macos.sh
source ../../.github/scripts/zlib-macos.sh
echo "ZLIB_ROOT=$ZLIB_ROOT" >> "$GITHUB_ENV" echo "ZLIB_ROOT=$ZLIB_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Fetch STB - name: Fetch STB
@@ -47,18 +45,22 @@ jobs:
shell: bash shell: bash
run: | run: |
cd extern/stb cd extern/stb
chmod +x ../../.github/scripts/stb-macos.sh source ../../.github/scripts/stb/macos.sh
source ../../.github/scripts/stb-macos.sh
echo "STB_ROOT=$STB_ROOT" >> "$GITHUB_ENV" echo "STB_ROOT=$STB_ROOT" >> "$GITHUB_ENV"
cd ../.. cd ../..
- name: Build LibCmo - name: Build LibCmo
shell: bash shell: bash
run: | run: |
chmod +x ./.github/scripts/macos.sh source ./.github/scripts/macos.sh
./.github/scripts/macos.sh
- name: Upload Built Artifact - name: Upload Built Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: LibCmo-macos-build name: LibCmo-macos-build
path: bin/install/* path: bin/install/*
retention-days: 30 retention-days: 30
- name: Upload Built ependencies
uses: actions/upload-artifact@v4
with:
name: LibCmo-linux-dep
path: extern/zlib/install/*
retention-days: 30

View File

@@ -25,10 +25,10 @@ jobs:
- name: Build YYCCommonplace - name: Build YYCCommonplace
shell: cmd shell: cmd
run: | run: |
cd extern/YYCCommonplace CD extern\YYCCommonplace
call ..\..\.github\scripts\yycc-windows.bat CALL ..\..\.github\scripts\yycc\windows.bat
echo set YYCCommonplace_ROOT=%YYCCommonplace_ROOT% > ../envs.bat ECHO SET YYCCommonplace_ROOT=%YYCCommonplace_ROOT% > ..\envs.bat
cd ../.. CD ..\..
- name: Fetch ZLIB - name: Fetch ZLIB
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -38,10 +38,10 @@ jobs:
- name: Build ZLIB - name: Build ZLIB
shell: cmd shell: cmd
run: | run: |
cd extern/zlib CD extern/zlib
..\..\.github\scripts\zlib-windows.bat ..\..\.github\scripts\zlib\windows.bat
echo set ZLIB_ROOT=%ZLIB_ROOT% >> ../envs.bat ECHO SET ZLIB_ROOT=%ZLIB_ROOT% >> ..\envs.bat
cd ../.. CD ..\..
- name: Fetch STB - name: Fetch STB
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -51,10 +51,10 @@ jobs:
- name: Build STB - name: Build STB
shell: cmd shell: cmd
run: | run: |
cd extern/stb CD extern/stb
..\..\.github\scripts\stb-windows.bat ..\..\.github\scripts\stb\windows.bat
echo set STB_ROOT=%STB_ROOT% >> ../envs.bat ECHO SET STB_ROOT=%STB_ROOT% >> ..\envs.bat
cd ../.. CD ..\..
- name: Build LibCmo - name: Build LibCmo
shell: cmd shell: cmd
run: | run: |
@@ -64,13 +64,19 @@ jobs:
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
call %VCVARS% ${{ matrix.msvc_arch }} call %VCVARS% ${{ matrix.msvc_arch }}
:: Extract saved environment variables :: Extract saved environment variables
call .\extern\envs.bat CALL .\extern\envs.bat
:: Build Project :: Build Project
.\.github\scripts\windows.bat CALL .\.github\scripts\windows.bat
- name: Upload Built Artifact - name: Upload Built Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: LibCmo-windows-build name: LibCmo-windows-build
path: bin/install/* path: bin/install/*
retention-days: 30 retention-days: 30
- name: Upload Built Dependencies
uses: actions/upload-artifact@v4
with:
name: LibCmo-windows-dep
path: extern/zlib/install/*
retention-days: 30