-
Notifications
You must be signed in to change notification settings - Fork 21
97 lines (83 loc) · 3.43 KB
/
test_build_commit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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