-
-
Notifications
You must be signed in to change notification settings - Fork 67
159 lines (135 loc) · 6.07 KB
/
build.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Author: Kang Lin<[email protected]>
# workflow syntax: https://docs.github.com/actions/writing-workflows/workflow-syntax-for-github-actions
name: build
env:
artifact_path: artifact_path
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RabbitRemoteControl_VERSION: v0.0.30
RabbitRemoteControl_VERSION_PRE: v0.0.29
on:
push:
pull_request:
jobs:
ubuntu:
uses: ./.github/workflows/ubuntu.yml
appimage:
uses: ./.github/workflows/appimage.yml
msvc:
uses: ./.github/workflows/msvc.yml
mingw:
if: true
uses: ./.github/workflows/mingw.yml
macos:
uses: ./.github/workflows/macos.yml
android:
uses: ./.github/workflows/android.yml
secrets: inherit
doxygen:
uses: ./.github/workflows/doxygen.yml
secrets: inherit
deploy:
#if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs: [ubuntu, appimage, msvc, doxygen, android, macos]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: false
- name: Download ubuntu
uses: actions/download-artifact@v4
with:
name: ${{ needs.ubuntu.outputs.name }}
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download msvc
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.msvc.outputs.name }}_*
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download mingw
if: false
uses: actions/download-artifact@v4
with:
name: ${{ needs.mingw.outputs.name }}
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download macos
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.macos.outputs.name }}_*
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download android
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.android.outputs.name }}_*
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download doxygen
uses: actions/download-artifact@v4
with:
name: ${{ needs.doxygen.outputs.name }}
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Download appimage
uses: actions/download-artifact@v4
with:
name: ${{ needs.appimage.outputs.name }}
path: ${{ env.artifact_path }}
merge-multiple: true
- name: Process configure file
run: |
git clone https://github.com/KangLin/RabbitCommon.git
./RabbitCommon/Install/MergeJsonFile.sh \
"${{ github.workspace }}/update.json" \
"${{ env.artifact_path }}" "${{ env.artifact_path }}/version.json"
rm ${{ env.artifact_path }}/*.json
- name: Make Note.md file for include change log file
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo "[:us: Change log](https://github.com/KangLin/RabbitRemoteControl/blob/${{env.RabbitRemoteControl_VERSION}}/ChangeLog.md)" > ${{github.workspace}}/Note.md
echo "[:cn: 修改日志](https://github.com/KangLin/RabbitRemoteControl/blob/${{env.RabbitRemoteControl_VERSION}}/ChangeLog_zh_CN.md)" >> ${{github.workspace}}/Note.md
echo "" >> ${{github.workspace}}/Note.md
echo "Full Change: [${{env.RabbitRemoteControl_VERSION_PRE}}...${{env.RabbitRemoteControl_VERSION}}](https://github.com/KangLin/RabbitRemoteControl/compare/${{env.RabbitRemoteControl_VERSION_PRE}}...${{env.RabbitRemoteControl_VERSION}})" >> ${{github.workspace}}/Note.md
- name: Make Note.md file for include chanag
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
echo "**This release is for development and testing purposes only!**" >> ${{github.workspace}}/Note.md
echo "Commit: [${{github.sha}}](https://github.com/KangLin/RabbitRemoteControl/commit/${{github.sha}})" >> ${{github.workspace}}/Note.md
- name: Make Note.md file for include artifact md5sum
run: |
echo "" >> ${{github.workspace}}/Note.md
echo "File checksum:" >> ${{github.workspace}}/Note.md
echo "|File|Checksum(md5)|" >> ${{github.workspace}}/Note.md
echo "| :- | :- |" >> ${{github.workspace}}/Note.md
cd ${{ env.artifact_path }}
for file in *
do
echo "$file"
if [ -f $file ]; then
if [ "${file##*.}" != "xml" ] && [ "${file##*.}" != "json" ]; then
md5sum $file > ${file}.md5sum
awk '{print "|", $2, "|", $1, "|"}' ${file}.md5sum >> ${{github.workspace}}/Note.md
fi
else
rm -fr $file
fi
done
# See: [访问有关工作流运行的上下文信息](https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context)
- name: Upload To Github Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Note.md
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json
- name: clean test tag
if: ${{ startsWith(github.ref, 'refs/heads/master') }}
continue-on-error: true
run: |
gh release delete test_${{ github.ref_name }} -y --cleanup-tag
- name: Upload test tag To Github Release
if: ${{ startsWith(github.ref, 'refs/heads/master') }}
run: |
gh release create test_${{ github.ref_name }} --prerelease --latest=false --title "Recently developed build - ${{ github.ref_name }}" --notes-file ${{github.workspace}}/Note.md
gh release upload test_${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json --clobber