88 TARBALL_CACHE_KEY : " tarballs-key-1"
99
1010jobs :
11- tarballCacher :
12- if : false
13- runs-on : ubuntu-18.04
14- steps :
15- - uses : actions/checkout@v1
16-
17- - name : Cache tarballs
18- uses : actions/cache@v1
19- with :
20- key : ${{ env.TARBALL_CACHE_KEY }}
21- path : dependency-builder/src/main/cpp/tarballs
22-
23- - run : ./dodownloadtarballs --serial
24-
25- debug :
26- # needs: tarballCacher
11+ build :
2712 runs-on : ubuntu-18.04
2813 strategy :
2914 matrix :
3015 abi : [ x86, x86_64, armeabi-v7a, arm64-v8a ]
16+ buildType : [ Debug, Release ]
3117 steps :
3218 - uses : actions/checkout@v1
3319 - uses : actions/setup-java@v1
@@ -53,81 +39,55 @@ jobs:
5339 - run : ./dodownloadtarballs --serial
5440
5541 - name : Build pdf2htmlEX-Android
56- run : ./gradlew assembleDebug -PdisablePreDex -Pabi=${{ matrix.abi }}
57-
58- release :
59- # needs: tarballCacher
60- if : github.ref == 'refs/heads/master'
61- runs-on : ubuntu-18.04
62- strategy :
63- matrix :
64- abi : [ x86, x86_64, armeabi-v7a, arm64-v8a ]
65- steps :
66- - uses : actions/checkout@v1
67- - uses : actions/setup-java@v1
68- with :
69- java-version : 1.8
70-
71- - name : Cache android-sdk.zip
72- uses : actions/cache@v1
73- with :
74- key : android-sdk.zip-${{ env.ANDROID_SDK_TOOLS }}
75- path : android-sdk
76-
77- - run : .github/installAndroidTools.sh
78-
79- - run : .github/installBuildDependencies.sh
80-
81- - name : Cache tarballs
82- uses : actions/cache@v1
83- with :
84- key : ${{ env.TARBALL_CACHE_KEY }}
85- path : dependency-builder/src/main/cpp/tarballs
86-
87- - run : ./dodownloadtarballs --serial
88-
89- - name : Build pdf2htmlEX-Android
90- run : ./gradlew assembleRelease -PdisablePreDex -Pabi=${{ matrix.abi }}
42+ run : ./gradlew assemble${{ matrix.buildType }} -PdisablePreDex -Pabi=${{ matrix.abi }}
9143
9244 - name : Gather licenses
93- if : matrix.abi == 'armeabi-v7a'
45+ if : matrix.abi == 'armeabi-v7a' && matrix.buildType == 'Release'
9446 run : ./gradlew dependency-builder:gatherLicenses -PdisablePreDex -Pabi=${{ matrix.abi }}
9547
9648 - name : Artifact gathered licenses
97- if : matrix.abi == 'armeabi-v7a'
49+ if : matrix.abi == 'armeabi-v7a' && matrix.buildType == 'Release'
9850 uses : actions/upload-artifact@v1
9951 with :
100- name : licenses-${{ matrix.abi }}
52+ name : licenses
10153 path : dependency-builder/build/licenses.xml
10254
10355 - name : Prepare built dependencies for artifacting
56+ if : matrix.buildType == 'Release'
10457 run : |
10558 mkdir --parents pdeps/bin
10659 mv dependency-builder/build/installed/MinSizeRel/${{ matrix.abi }}/bin/pkg-config pdeps/bin/
10760 mv dependency-builder/build/installed/MinSizeRel/${{ matrix.abi }}/include pdeps/
10861 mv dependency-builder/build/installed/MinSizeRel/${{ matrix.abi }}/lib pdeps/
10962 mv dependency-builder/build/installed/MinSizeRel/${{ matrix.abi }}/share/pkgconfig pdeps/share/
11063
64+ - name : Prepare built dependencies for artifacting
65+ if : matrix.buildType == 'Debug'
66+ run : |
67+ mkdir --parents pdeps/bin
68+ mv dependency-builder/build/installed/Debug/${{ matrix.abi }}/bin/pkg-config pdeps/bin/
69+ mv dependency-builder/build/installed/Debug/${{ matrix.abi }}/include pdeps/
70+ mv dependency-builder/build/installed/Debug/${{ matrix.abi }}/lib pdeps/
71+ mv dependency-builder/build/installed/Debug/${{ matrix.abi }}/share/pkgconfig pdeps/share/
72+
11173 - name : Artifact built dependencies
11274 uses : actions/upload-artifact@v1
11375 with :
114- name : dependencies-${{ matrix.abi }}
76+ name : dependencies-${{ matrix.buildType }}-${{ matrix. abi }}
11577 path : pdeps
11678
11779 - name : Artifact assets (from pdf2htmlEX and poppler)
118- if : matrix.abi == 'armeabi-v7a'
80+ if : matrix.abi == 'armeabi-v7a' && matrix.buildType == 'Release'
11981 uses : actions/upload-artifact@v1
12082 with :
12183 name : assets
12284 path : dependency-builder/build/assets
12385
124- releaseAllABIs :
125- needs : release
126- if : github.ref == 'refs/heads/master'
86+ buildAllABIs :
87+ needs : build
12788 runs-on : ubuntu-18.04
12889 steps :
12990 - uses : actions/checkout@v1
130-
13191 - uses : actions/setup-java@v1
13292 with :
13393 java-version : 1.8
@@ -148,34 +108,62 @@ jobs:
148108
149109 - run : ./dodownloadtarballs --serial
150110
151- - name : Download artifacted dependencies - x86
111+ - name : Download artifacted dependencies - x86 - release
152112 uses : actions/download-artifact@v1
153113 with :
154- name : dependencies-x86
114+ name : dependencies-Release- x86
155115 path : dependency-builder/build/installed/MinSizeRel/x86
156116 - run : chmod +x dependency-builder/build/installed/MinSizeRel/x86/bin/pkg-config
157117
158- - name : Download artifacted dependencies - x86_64
118+ - name : Download artifacted dependencies - x86_64 - release
159119 uses : actions/download-artifact@v1
160120 with :
161- name : dependencies-x86_64
121+ name : dependencies-Release- x86_64
162122 path : dependency-builder/build/installed/MinSizeRel/x86_64
163123 - run : chmod +x dependency-builder/build/installed/MinSizeRel/x86_64/bin/pkg-config
164124
165- - name : Download artifacted dependencies - armeabi-v7a
125+ - name : Download artifacted dependencies - armeabi-v7a - release
166126 uses : actions/download-artifact@v1
167127 with :
168- name : dependencies-armeabi-v7a
128+ name : dependencies-Release- armeabi-v7a
169129 path : dependency-builder/build/installed/MinSizeRel/armeabi-v7a
170130 - run : chmod +x dependency-builder/build/installed/MinSizeRel/armeabi-v7a/bin/pkg-config
171131
172- - name : Download artifacted dependencies - arm64-v8a
132+ - name : Download artifacted dependencies - arm64-v8a - release
173133 uses : actions/download-artifact@v1
174134 with :
175- name : dependencies-arm64-v8a
135+ name : dependencies-Release- arm64-v8a
176136 path : dependency-builder/build/installed/MinSizeRel/arm64-v8a
177137 - run : chmod +x dependency-builder/build/installed/MinSizeRel/arm64-v8a/bin/pkg-config
178138
139+ - name : Download artifacted dependencies - x86 - debug
140+ uses : actions/download-artifact@v1
141+ with :
142+ name : dependencies-Debug-x86
143+ path : dependency-builder/build/installed/Debug/x86
144+ - run : chmod +x dependency-builder/build/installed/Debug/x86/bin/pkg-config
145+
146+ - name : Download artifacted dependencies - x86_64 - debug
147+ uses : actions/download-artifact@v1
148+ with :
149+ name : dependencies-Debug-x86_64
150+ path : dependency-builder/build/installed/Debug/x86_64
151+ - run : chmod +x dependency-builder/build/installed/Debug/x86_64/bin/pkg-config
152+
153+ - name : Download artifacted dependencies - armeabi-v7a - debug
154+ uses : actions/download-artifact@v1
155+ with :
156+ name : dependencies-Debug-armeabi-v7a
157+ path : dependency-builder/build/installed/Debug/armeabi-v7a
158+ - run : chmod +x dependency-builder/build/installed/Debug/armeabi-v7a/bin/pkg-config
159+
160+ - name : Download artifacted dependencies - arm64-v8a - debug
161+ uses : actions/download-artifact@v1
162+ with :
163+ name : dependencies-Debug-arm64-v8a
164+ path : dependency-builder/build/installed/Debug/arm64-v8a
165+ - run : chmod +x dependency-builder/build/installed/Debug/arm64-v8a/bin/pkg-config
166+
179167 - name : Download artifacted assets
180168 uses : actions/download-artifact@v1
181169 with :
@@ -185,11 +173,11 @@ jobs:
185173 - name : Download artifacted licenses
186174 uses : actions/download-artifact@v1
187175 with :
188- name : licenses-armeabi-v7a
176+ name : licenses
189177 path : dependency-builder/build/
190178
191179 - name : Build pdf2htmlEX-Android
192- run : ./gradlew assembleRelease -PdisablePreDex
180+ run : ./gradlew build -PdisablePreDex
193181
194182 - name : Publish to maven local
195183 run : ./gradlew publishToMavenLocal
@@ -213,7 +201,7 @@ jobs:
213201 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
214202 with :
215203 tag_name : v${{ steps.get_version.outputs.version }}
216- release_name : " pdf2htmlEX-Android v${{ steps.get_version.outputs.version }} - ${{ github.event.commits[0].message }}"
204+ release_name : " pdf2htmlEX-Android v${{ steps.get_version.outputs.version }} - ${{ github.event.commits[0].message }} - ${{ github.ref }} "
217205 draft : true
218206 prerelease : false
219207
@@ -227,7 +215,7 @@ jobs:
227215 asset_name : licenses.xml
228216 asset_content_type : text/xml
229217
230- - name : Upload aar
218+ - name : Upload Release aar
231219 uses : actions/upload-release-asset@v1.0.1
232220 env :
233221 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -237,6 +225,16 @@ jobs:
237225 asset_name : pdf2htmlex-android-release.aar
238226 asset_content_type : application/zip
239227
228+ - name : Upload Debug aar
229+ uses : actions/upload-release-asset@v1.0.1
230+ env :
231+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
232+ with :
233+ upload_url : ${{ steps.create_release.outputs.upload_url }}
234+ asset_path : ./pdf2htmlEX/build/outputs/aar/pdf2htmlex-android-debug.aar
235+ asset_name : pdf2htmlex-android-release.aar
236+ asset_content_type : application/zip
237+
240238 - name : Generate javadoc
241239 run : ./gradlew pdf2htmlEX:javadocJar
242240
0 commit comments