mirror of https://github.com/axmolengine/axmol.git
Update thirdparty libs
- llhttp: 8.1.1 --> 9.0.0 - xxhash: 0.8.1 --> 0.8.2 - yaml-cpp: 0.7.0 --> 0.8.0
This commit is contained in:
parent
433f459787
commit
65ebdafbbe
|
@ -4,9 +4,9 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
# Inputs the workflow accepts.
|
# Inputs the workflow accepts.
|
||||||
inputs:
|
inputs:
|
||||||
buildware_rel_tag:
|
build1k_rel_tag:
|
||||||
# actions run ID
|
# actions run ID
|
||||||
description: 'Please input buildware release tag, such as v41'
|
description: 'Please input build1k release tag, such as v57'
|
||||||
# Default value if no value is explicitly provided
|
# Default value if no value is explicitly provided
|
||||||
default: ''
|
default: ''
|
||||||
# Input has to be provided for the workflow to run
|
# Input has to be provided for the workflow to run
|
||||||
|
@ -34,7 +34,7 @@ jobs:
|
||||||
- name: Update prebuilts
|
- name: Update prebuilts
|
||||||
# Some projects don't allow in-source building, so create a separate build directory
|
# Some projects don't allow in-source building, so create a separate build directory
|
||||||
# We'll use this as our working directory for all subsequent commands
|
# We'll use this as our working directory for all subsequent commands
|
||||||
run: pwsh tools/ci/update-prebuilts.ps1 ${{ github.event.inputs.buildware_rel_tag }}
|
run: pwsh tools/ci/update-prebuilts.ps1 ${{ github.event.inputs.build1k_rel_tag }}
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
if: ${{ env.AX_PREBUILTS_NO_UPDATE != 'true' }}
|
if: ${{ env.AX_PREBUILTS_NO_UPDATE != 'true' }}
|
||||||
|
@ -43,13 +43,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.AX_BOT_TOKEN }}
|
token: ${{ secrets.AX_BOT_TOKEN }}
|
||||||
push-to-fork: axmol-bot/axmol
|
push-to-fork: axmol-bot/axmol
|
||||||
commit-message: Update thirdparty prebuilts to ${{ github.event.inputs.buildware_rel_tag }}
|
commit-message: Update thirdparty prebuilts to ${{ github.event.inputs.build1k_rel_tag }}
|
||||||
committer: 'GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>'
|
committer: 'GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>'
|
||||||
author: 'axmol-bot <axmol-bot@users.noreply.github.com>'
|
author: 'axmol-bot <axmol-bot@users.noreply.github.com>'
|
||||||
signoff: false
|
signoff: false
|
||||||
branch: buildware_dist_${{ github.event.inputs.buildware_rel_tag }}
|
branch: buildware_dist_${{ github.event.inputs.build1k_rel_tag }}
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
title: 'Update thirdparty prebuilts to ${{ github.event.inputs.buildware_rel_tag }}'
|
title: 'Update thirdparty prebuilts to ${{ github.event.inputs.build1k_rel_tag }}'
|
||||||
body: |
|
body: |
|
||||||
RT
|
RT
|
||||||
- Auto-generated by [create-pull-request][1]
|
- Auto-generated by [create-pull-request][1]
|
||||||
|
|
|
@ -62,6 +62,8 @@ static int register_all_packages()
|
||||||
|
|
||||||
bool AppDelegate::applicationDidFinishLaunching()
|
bool AppDelegate::applicationDidFinishLaunching()
|
||||||
{
|
{
|
||||||
|
auto md4Val = utils::computeDigest("hello world", "md4");
|
||||||
|
|
||||||
// initialize director
|
// initialize director
|
||||||
auto director = Director::getInstance();
|
auto director = Director::getInstance();
|
||||||
auto glView = director->getOpenGLView();
|
auto glView = director->getOpenGLView();
|
||||||
|
|
|
@ -4,29 +4,48 @@ echo "VER=$VER"
|
||||||
$AX_ROOT=(Resolve-Path "$PSScriptRoot/../..").Path
|
$AX_ROOT=(Resolve-Path "$PSScriptRoot/../..").Path
|
||||||
echo "AX_ROOT=$AX_ROOT"
|
echo "AX_ROOT=$AX_ROOT"
|
||||||
|
|
||||||
function update_lib
|
$pwsh_ver = $PSVersionTable.PSVersion.ToString()
|
||||||
{
|
|
||||||
$lib_name=$args[0]
|
function mkdirs([string]$path) {
|
||||||
$lib_folder=$args[1]
|
if (!(Test-Path $path -PathType Container)) {
|
||||||
echo "lib_name=$lib_name"
|
New-Item $path -ItemType Directory 1>$null
|
||||||
$lib_dir="./thirdparty/$lib_folder$lib_name"
|
|
||||||
$prebuilt_dir="$lib_dir/prebuilt"
|
|
||||||
$inc_dir="$lib_dir/include"
|
|
||||||
|
|
||||||
echo "Updating lib files for ${lib_dir} from ./tmp/buildware_dist_$VER/$lib_name ..."
|
|
||||||
rm -rf $prebuilt_dir
|
|
||||||
cp -r ./tmp/buildware_dist_$VER/$lib_name/prebuilt $lib_dir/
|
|
||||||
|
|
||||||
if ( Test-Path "./tmp/buildware_dist_$VER/$lib_name/include" -PathType Container ) {
|
|
||||||
echo "Update inc files for ${lib_dir}"
|
|
||||||
rm -rf $inc_dir
|
|
||||||
cp -r ./tmp/buildware_dist_$VER/$lib_name/include $lib_dir/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# start updating
|
function download_file($url, $out, $force = $false) {
|
||||||
|
if(Test-Path $out -PathType Leaf) {
|
||||||
|
if (!$force) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Remove-Item $out
|
||||||
|
}
|
||||||
|
Write-Host "Downloading $url to $out ..."
|
||||||
|
if ($pwsh_ver -ge '7.0') {
|
||||||
|
curl -L $url -o $out
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile $out
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function download_and_expand($url, $out, $dest) {
|
||||||
|
download_file $url $out
|
||||||
|
if($out.EndsWith('.zip')) {
|
||||||
|
Expand-Archive -Path $out -DestinationPath $dest
|
||||||
|
} elseif($out.EndsWith('.tar.gz')) {
|
||||||
|
if (!$dest.EndsWith('/')) {
|
||||||
|
mkdirs $dest
|
||||||
|
}
|
||||||
|
tar xvf "$out" -C $dest
|
||||||
|
} elseif($out.EndsWith('.sh')) {
|
||||||
|
chmod 'u+x' "$out"
|
||||||
|
mkdirs $dest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# download version manifest
|
||||||
cd $AX_ROOT
|
cd $AX_ROOT
|
||||||
mkdir -p ./tmp
|
mkdirs ./tmp
|
||||||
|
|
||||||
# ensure yaml parser module
|
# ensure yaml parser module
|
||||||
if ($null -eq (Get-Module -ListAvailable -Name powershell-yaml)) {
|
if ($null -eq (Get-Module -ListAvailable -Name powershell-yaml)) {
|
||||||
|
@ -34,54 +53,72 @@ if ($null -eq (Get-Module -ListAvailable -Name powershell-yaml)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# check upstream prebuilts version
|
# check upstream prebuilts version
|
||||||
if (!(Test-Path ./tmp/verlist.yml -PathType Leaf)) {
|
download_file "https://github.com/axmolengine/buildware/releases/download/$VER/verlist.yml" "./tmp/verlist.yml" $true
|
||||||
curl -L https://github.com/axmolengine/buildware/releases/download/$VER/verlist.yml -o ./tmp/verlist.yml
|
|
||||||
}
|
|
||||||
|
|
||||||
$newVerList = ConvertFrom-Yaml -Yaml (Get-Content './tmp/verlist.yml' -raw)
|
$newVerList = ConvertFrom-Yaml -Yaml (Get-Content './tmp/verlist.yml' -raw)
|
||||||
$myVerList = ConvertFrom-Yaml -Yaml (Get-Content './thirdparty/prebuilts.yml' -raw)
|
if ($newVerList.GetType() -eq [string]) {
|
||||||
|
throw "Download version manifest file verlist.yml fail"
|
||||||
$needUpdate = $false;
|
|
||||||
foreach ($item in $myVerList.GetEnumerator() )
|
|
||||||
{
|
|
||||||
if ($item.Value -ne $newVerList[$item.Name]) {
|
|
||||||
$needUpdate = $true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$myVerList = ConvertFrom-Yaml -Yaml (Get-Content './thirdparty/prebuilts.yml' -raw)
|
||||||
|
$updateCount = 0
|
||||||
|
|
||||||
if ($needUpdate) {
|
function update_lib
|
||||||
echo "Updating libs ..."
|
{
|
||||||
|
$lib_name=$args[0]
|
||||||
|
$lib_folder=$args[1]
|
||||||
|
echo "lib_name=$lib_name"
|
||||||
|
|
||||||
# download buildware_dist_xxx.zip
|
$myVer = $myVerList[$lib_name]
|
||||||
if ( ! (Test-Path "./tmp/buildware_dist_$VER" -PathType Container) ) {
|
if ($newVerList[$lib_name] -eq $myVer) {
|
||||||
wget -O ./tmp/buildware_dist_$VER.zip https://github.com/axmolengine/buildware/releases/download/$VER/buildware_dist_$VER.zip
|
Write-Host "No update for lib: $lib_name, version: $myVer, skip it"
|
||||||
unzip ./tmp/buildware_dist_$VER.zip -d ./tmp/
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# update libs
|
$lib_dir="./thirdparty/$lib_folder$lib_name"
|
||||||
update_lib angle
|
$prebuilt_dir="$lib_dir/prebuilt"
|
||||||
update_lib curl
|
$inc_dir="$lib_dir/include"
|
||||||
update_lib "jpeg-turbo"
|
|
||||||
update_lib openssl
|
echo "Updating lib files for ${lib_dir} from ./tmp/package_$VER/$lib_name ..."
|
||||||
update_lib zlib
|
|
||||||
update_lib luajit lua/
|
|
||||||
|
|
||||||
# update README.md
|
download_and_expand "https://github.com/axmolengine/build1k/releases/$VER/$lib_name.zip" "./tmp/package_$VER/$lib_name.zip" "./tmp/package_$VER"
|
||||||
$content = $(Get-Content -Path ./thirdparty/README.md.in -raw)
|
|
||||||
foreach ($item in $newVerList.GetEnumerator() )
|
rm -rf $prebuilt_dir
|
||||||
{
|
cp -r ./tmp/package_$VER/$lib_name/prebuilt $lib_dir/
|
||||||
$key = ([Regex]::Replace($item.Name, '-', '_')).ToUpper()
|
|
||||||
$key = "${key}_VERSION"
|
if ( Test-Path "./tmp/package_$VER/$lib_name/include" -PathType Container ) {
|
||||||
$content = $content -replace "\$\{$key\}",$item.Value
|
echo "Update inc files for ${lib_dir}"
|
||||||
|
rm -rf $inc_dir
|
||||||
|
cp -r ./tmp/package_$VER/$lib_name/include $lib_dir/
|
||||||
}
|
}
|
||||||
Set-Content -Path ./thirdparty/README.md -Value "$content"
|
|
||||||
Copy-Item -Path './tmp/verlist.yml' './thirdparty/prebuilts.yml' -Force
|
++$updateCount
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
echo "Updating libs ..."
|
||||||
|
|
||||||
|
$libs_list = @('angle', 'curl', 'jpeg-turbo', 'openssl', 'zlib')
|
||||||
|
|
||||||
|
# update libs
|
||||||
|
foreach($lib_name in $libs_list) {
|
||||||
|
update_lib $lib_name
|
||||||
|
}
|
||||||
|
|
||||||
|
update_lib luajit lua/
|
||||||
|
|
||||||
|
# update README.md
|
||||||
|
$content = $(Get-Content -Path ./thirdparty/README.md.in -raw)
|
||||||
|
foreach ($item in $newVerList.GetEnumerator() )
|
||||||
|
{
|
||||||
|
$key = ([Regex]::Replace($item.Name, '-', '_')).ToUpper()
|
||||||
|
$key = "${key}_VERSION"
|
||||||
|
$content = $content -replace "\$\{$key\}",$item.Value
|
||||||
|
}
|
||||||
|
Set-Content -Path ./thirdparty/README.md -Value "$content"
|
||||||
|
Copy-Item -Path './tmp/verlist.yml' './thirdparty/prebuilts.yml' -Force
|
||||||
|
|
||||||
|
if ($updateCount -eq 0) {
|
||||||
echo "No any lib need update."
|
echo "No any lib need update."
|
||||||
if ("$env.RUNNER_OS" -ne "") {
|
if ("$env.RUNNER_OS" -ne "") {
|
||||||
echo "AX_PREBUILTS_NO_UPDATE=true" >> $GITHUB_ENV
|
echo "AX_PREBUILTS_NO_UPDATE=true" >> $GITHUB_ENV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue