@@ -11,32 +11,18 @@ concurrency:
1111 cancel-in-progress : true
1212
1313jobs :
14- build :
15- name : build kernel and system
14+ build-kernel :
15+ name : build kernel
1616 runs-on : namespace-profile-arm64-8x16-2004-caching
17- timeout-minutes : 60
17+ timeout-minutes : 40
18+ outputs :
19+ kernel-ref : ${{ steps.kernel-submodule.outputs.ref }}
1820 steps :
1921 - uses : actions/checkout@v4
2022 with :
2123 lfs : true
2224 submodules : true
2325
24- - name : Get commit message
25- run : |
26- {
27- echo 'LAST_COMMIT_MESSAGE<<EOF'
28- if [ "${{ github.event_name }}" == "push" ]; then
29- echo "${{ github.event.head_commit.message }}"
30- elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
31- COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.sha }}|")
32- echo "$(curl -s "$COMMIT_URL" | jq -r '.commit.message')"
33- elif [ "${{ github.event_name }}" == "pull_request" ]; then
34- PR_COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.event.pull_request.head.sha }}|")
35- echo "$(curl -s "$PR_COMMIT_URL" | jq -r '.commit.message')"
36- fi
37- echo EOF
38- } | tee -a $GITHUB_ENV
39-
4026 - name : Get kernel submodule ref
4127 id : kernel-submodule
4228 run : echo "ref=$(git ls-tree HEAD | awk '$4 == "agnos-kernel-sdm845"' | awk '{print $3}')" | tee -a $GITHUB_OUTPUT
5036 - name : Build kernel
5137 run : ./build_kernel.sh
5238
39+ - name : Upload kernel artifact
40+ uses : actions/upload-artifact@v4
41+ with :
42+ name : kernel-boot-img
43+ path : output/boot.img
44+ retention-days : 1
45+
46+ build-system :
47+ name : build system
48+ runs-on : namespace-profile-arm64-8x16-2004-caching
49+ timeout-minutes : 40
50+ steps :
51+ - uses : actions/checkout@v4
52+ with :
53+ lfs : true
54+ submodules : true
55+
5356 - name : Update VERSION
5457 if : github.event_name == 'pull_request'
5558 run : |
6063 GIT_HASH : ${{ github.event.pull_request.head.sha }}
6164 run : ./build_system.sh
6265
66+ - name : Upload system artifact
67+ uses : actions/upload-artifact@v4
68+ with :
69+ name : system-img
70+ path : output/system.img
71+ retention-days : 1
72+
73+ - name : Upload build directory for statistics
74+ uses : actions/upload-artifact@v4
75+ with :
76+ name : build-dir
77+ path : build/system.img
78+ retention-days : 1
79+
80+ - name : Upload VERSION file
81+ uses : actions/upload-artifact@v4
82+ with :
83+ name : version-file
84+ path : VERSION
85+ retention-days : 1
86+
87+ package :
88+ name : package and upload
89+ needs : [build-kernel, build-system]
90+ runs-on : namespace-profile-arm64-8x16-2004-caching
91+ timeout-minutes : 20
92+ steps :
93+ - uses : actions/checkout@v4
94+ with :
95+ lfs : true
96+ submodules : true
97+
98+ - name : Get commit message
99+ run : |
100+ {
101+ echo 'LAST_COMMIT_MESSAGE<<EOF'
102+ if [ "${{ github.event_name }}" == "push" ]; then
103+ echo "${{ github.event.head_commit.message }}"
104+ elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
105+ COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.sha }}|")
106+ echo "$(curl -s "$COMMIT_URL" | jq -r '.commit.message')"
107+ elif [ "${{ github.event_name }}" == "pull_request" ]; then
108+ PR_COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.event.pull_request.head.sha }}|")
109+ echo "$(curl -s "$PR_COMMIT_URL" | jq -r '.commit.message')"
110+ fi
111+ echo EOF
112+ } | tee -a $GITHUB_ENV
113+
114+ - name : Create output and build directories
115+ run : mkdir -p output build build/agnos-rootfs
116+
117+ - name : Download kernel artifact
118+ uses : actions/download-artifact@v4
119+ with :
120+ name : kernel-boot-img
121+ path : output
122+
123+ - name : Download system artifact
124+ uses : actions/download-artifact@v4
125+ with :
126+ name : system-img
127+ path : output
128+
129+ - name : Download build directory
130+ uses : actions/download-artifact@v4
131+ with :
132+ name : build-dir
133+ path : build
134+
135+ - name : Download VERSION file
136+ uses : actions/download-artifact@v4
137+ with :
138+ name : version-file
139+ path : .
140+
63141 - name : Statistics
64142 id : stats
65143 run : |
0 commit comments