Skip to content

Test Build And Commit #26

Test Build And Commit

Test Build And Commit #26

name: Test Build And Commit
on:
workflow_dispatch: # manually trigger
permissions:
contents: write
jobs:
test_sub_flow:
uses: ./.github/workflows/test.yml
build_sub_flow:
uses: ./.github/workflows/build.yml
push_to_repo:
runs-on: macos-latest
needs:
- test_sub_flow
- build_sub_flow
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Clear Output Folders
run: |
rm -rf bin/tools/win64
rm -rf bin/tools/linux32
rm -rf bin/tools/linux64
rm -rf bin/tools/mac
rm -rf dist/dynamic_lib/include
rm -rf dist/dynamic_lib/android
rm -rf dist/dynamic_lib/ios
rm -rf dist/dynamic_lib/linux32
rm -rf dist/dynamic_lib/linux64
rm -rf dist/dynamic_lib/mac
rm -rf dist/dynamic_lib/win64
rm -rf dist/static_lib/include
rm -rf dist/static_lib/linux32
rm -rf dist/static_lib/linux64
rm -rf dist/static_lib/mac
rm -rf dist/static_lib/win64
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Unzip Artifacts
run: |
ls -R artifacts/
mkdir -p dist/static_lib/win64
mkdir -p dist/dynamic_lib/win64
mkdir -p bin/tools/win64/
mkdir -p dist/dynamic_lib/android/
mkdir -p dist/static_lib/linux32/
mkdir -p dist/dynamic_lib/linux32/
mkdir -p bin/tools/linux32/
mkdir -p dist/static_lib/linux64/
mkdir -p dist/dynamic_lib/linux64/
mkdir -p bin/tools/linux64/
mkdir -p dist/static_lib/mac/
mkdir -p dist/dynamic_lib/mac/
mkdir -p bin/tools/mac/
mkdir -p dist/dynamic_lib/ios/
cp -vr artifacts/win64_static_artifact/* dist/static_lib/win64
cp -vr artifacts/win64_dynamic_artifact/* dist/dynamic_lib/win64
cp -vr artifacts/win64_tools_artifact/* bin/tools/win64/
cp -vr artifacts/win64_android_artifact/* dist/dynamic_lib/android/
cp -vr artifacts/linux32_static_artifact/* dist/static_lib/
cp -vr artifacts/linux32_dynamic_artifact/* dist/dynamic_lib/
cp -vr artifacts/linux32_tools_artifact/* bin/tools/linux32/
cp -vr artifacts/linux64_static_artifact/* dist/static_lib/
cp -vr artifacts/linux64_dynamic_artifact/* dist/dynamic_lib/
cp -vr artifacts/linux64_tools_artifact/* bin/tools/linux64/
cp -vr artifacts/mac_static_artifact/* dist/static_lib/mac/
cp -vr artifacts/mac_dynamic_artifact/* dist/dynamic_lib/mac/
cp -vr artifacts/mac_tools_artifact/* bin/tools/mac/
cp -vr artifacts/ios_dynamic_artifact/* dist/dynamic_lib/ios/
- name: Combine and Commit Build Artifacts
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add bin/tools/
git add dist/
ACTION_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
git commit -m "Github Auto CI - Action URL: $ACTION_URL"
echo "Git Log:"
git log -1 --stat
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Tencent/BqLog.git HEAD:$BRANCH_NAME