Skip to content

Commit f781909

Browse files
[CI][CD] Update pipelines to v1.4.0.0
1 parent ba47895 commit f781909

6 files changed

Lines changed: 365 additions & 124 deletions

File tree

.github/workflows/appRelease.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# MIT License
2+
#
3+
# Copyright (c) 2021 Vilius Sutkus <ViliusSutkus89@gmail.com>
4+
#
5+
# https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests
6+
# .github/workflows/appRelease.yml - v1.3.0
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a copy
9+
# of this software and associated documentation files (the "Software"), to deal
10+
# in the Software without restriction, including without limitation the rights
11+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
# copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included in all
16+
# copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
# SOFTWARE.
25+
26+
name: appRelease
27+
on: workflow_dispatch
28+
29+
permissions:
30+
actions: none
31+
checks: none
32+
contents: none
33+
deployments: none
34+
issues: none
35+
packages: none
36+
pull-requests: none
37+
repository-projects: none
38+
security-events: none
39+
statuses: none
40+
41+
jobs:
42+
buildApplication:
43+
environment: SampleAppKeystore
44+
runs-on: ubuntu-20.04
45+
outputs:
46+
# in case there's a commit between buildSampleApp and releaseApp jobs...
47+
GIT_TAG: ${{ github.event.ref }}
48+
steps:
49+
- uses: actions/checkout@v2
50+
with:
51+
ref: ${{ github.event.ref }}
52+
53+
- uses: actions/setup-java@v2
54+
with:
55+
distribution: zulu
56+
java-version: 11
57+
- uses: android-actions/setup-android@v2
58+
59+
- id: decodeAppKeystore
60+
run: |
61+
echo "${{ env.APP_SIGNING_KEYFILE_BASE64 }}" | base64 --decode - > "$HOME/com.viliussutkus89.pdf2htmlex.application.jks"
62+
echo "::set-output name=APP_SIGNING_KEYFILE::$HOME/com.viliussutkus89.pdf2htmlex.application.jks"
63+
env:
64+
APP_SIGNING_KEYFILE_BASE64: ${{ secrets.APP_SIGNING_KEYFILE_BASE64 }}
65+
66+
- run: ./gradlew build lintRelease
67+
working-directory: application
68+
env:
69+
APP_SIGNING_KEYFILE: ${{ steps.decodeAppKeystore.outputs.APP_SIGNING_KEYFILE }}
70+
APP_SIGNING_PASS: ${{ secrets.APP_SIGNING_PASS }}
71+
APP_SIGNING_ALIAS: ${{ secrets.APP_SIGNING_ALIAS }}
72+
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: APKs
76+
path: application/app/build/outputs/apk/**/*.apk
77+
78+
- run: mv application/app/build/reports/lint-results-release.html application-lint-report.html
79+
- uses: actions/upload-artifact@v2
80+
with:
81+
name: application-lint-report.html
82+
path: application-lint-report.html
83+
84+
releaseApp:
85+
needs: buildApplication
86+
permissions:
87+
# Permission needed to create the GitHub release.
88+
contents: write
89+
runs-on: ubuntu-20.04
90+
steps:
91+
- uses: actions/checkout@v2
92+
with:
93+
# A branch is required for post release version increment commit
94+
ref: ${{ needs.buildSampleApp.outputs.GIT_TAG }}
95+
96+
- uses: actions/download-artifact@v2
97+
with:
98+
path: artifacts
99+
100+
- run: ./ci-scripts/getVersion --ci
101+
id: version
102+
103+
- name: Create GitHub Release
104+
uses: ncipollo/release-action@v1
105+
with:
106+
token: ${{ secrets.GITHUB_TOKEN }}
107+
tag: "appRelease-v${{ steps.version.outputs.appVersion }}"
108+
name: "[AppRelease] ${{ github.event.repository.name }} v${{ steps.version.outputs.appVersion }}"
109+
artifacts: "artifacts/APKs/**/*.apk,artifacts/application-lint-report.html/application-lint-report.html"
110+
111+
- run: ./ci-scripts/incrementVersion --application
112+
id: postReleaseVersionIncrement
113+
114+
- uses: stefanzweifel/git-auto-commit-action@v4
115+
with:
116+
commit_message: "Post release app version increment to ${{ steps.postReleaseVersionIncrement.outputs.newAppVersion }} (from ${{ steps.postReleaseVersionIncrement.outputs.oldAppVersion }})"
117+
file_pattern: ${{ steps.postReleaseVersionIncrement.outputs.files }}
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2021 Vilius Sutkus <ViliusSutkus89@gmail.com>
44
#
55
# https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests
6-
# .github/workflows/release.yml - v1.2.0
6+
# .github/workflows/fullRelease.yml - v1.3.0
77
#
88
# Permission is hereby granted, free of charge, to any person obtaining a copy
99
# of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@
2323
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2424
# SOFTWARE.
2525

26-
name: release
26+
name: fullRelease
2727
on:
2828
workflow_dispatch:
2929
inputs:
@@ -75,9 +75,6 @@ jobs:
7575
- uses: ViliusSutkus89/WaitForURLsToBeAvailable@v1
7676
with:
7777
URLs: ${{ needs.releaseSonatype.outputs.ARTIFACTS }}
78-
# First attempt to promote pdf2htmlEX-Android didn't go through in 30 minutes
79-
# Raise the timeout to TenMinuteWait + tryCount
80-
tryCount: 60
8178

8279
- run: ./ci-scripts/updateDownstreamVersion
8380
id: updateDownstreamVersion
@@ -126,23 +123,23 @@ jobs:
126123
java-version: 11
127124
- uses: android-actions/setup-android@v2
128125

129-
- id: decodeSampleAppKeystore
126+
- id: decodeAppKeystore
130127
run: |
131-
echo "${{ env.APP_SIGNING_KEYFILE_BASE64 }}" | base64 --decode - > "$HOME/com.viliussutkus89.pdf2htmlex.sampleapp.jks"
132-
echo "::set-output name=APP_SIGNING_KEYFILE::$HOME/com.viliussutkus89.pdf2htmlex.sampleapp.jks"
128+
echo "${{ env.APP_SIGNING_KEYFILE_BASE64 }}" | base64 --decode - > "$HOME/com.viliussutkus89.pdf2htmlex.application.jks"
129+
echo "::set-output name=APP_SIGNING_KEYFILE::$HOME/com.viliussutkus89.pdf2htmlex.application.jks"
133130
env:
134131
APP_SIGNING_KEYFILE_BASE64: ${{ secrets.APP_SIGNING_KEYFILE_BASE64 }}
135132

136133
- run: ./gradlew build lintRelease
137134
working-directory: application
138135
env:
139-
APP_SIGNING_KEYFILE: ${{ steps.decodeSampleAppKeystore.outputs.APP_SIGNING_KEYFILE }}
136+
APP_SIGNING_KEYFILE: ${{ steps.decodeAppKeystore.outputs.APP_SIGNING_KEYFILE }}
140137
APP_SIGNING_PASS: ${{ secrets.APP_SIGNING_PASS }}
141138
APP_SIGNING_ALIAS: ${{ secrets.APP_SIGNING_ALIAS }}
142139

143140
- run: mv application/app/build/reports/lint-results-release.html application-lint-report.html
144141

145-
- name: Attach sample application to GitHub Release
142+
- name: Attach application to GitHub Release
146143
uses: ncipollo/release-action@v1
147144
with:
148145
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/privilegedBuild.yml

Lines changed: 61 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2021 Vilius Sutkus <ViliusSutkus89@gmail.com>
44
#
55
# https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests
6-
# .github/workflows/privilegedBuild.yml - v1.2.0
6+
# .github/workflows/privilegedBuild.yml - v1.4.0
77
#
88
# Permission is hereby granted, free of charge, to any person obtaining a copy
99
# of this software and associated documentation files (the "Software"), to deal
@@ -52,6 +52,7 @@ permissions:
5252

5353
jobs:
5454
buildDependencies:
55+
if: "!contains(github.event.head_commit.message, '[SkipCI]') && !contains(github.event.head_commit.message, '[AppOnly]')"
5556
runs-on: ubuntu-20.04
5657
strategy:
5758
fail-fast: false
@@ -203,37 +204,6 @@ jobs:
203204
path: maven-local.tar
204205
if-no-files-found: error
205206

206-
buildApplicationStaging:
207-
needs: buildLibrary
208-
runs-on: ubuntu-20.04
209-
steps:
210-
- uses: actions/checkout@v2
211-
- uses: actions/setup-java@v2
212-
with:
213-
distribution: zulu
214-
java-version: 11
215-
- uses: android-actions/setup-android@v2
216-
217-
- name: Prepare application for staging repository
218-
run: ./ci-scripts/prepareSampleAppForStagingRepository application app --output=build/application-staging --repository=${{ needs.buildLibrary.outputs.STAGING_REPO_URL }}
219-
220-
- name: Build and lint application from staging library
221-
run: ./gradlew build lintRelease
222-
working-directory: build/application-staging
223-
224-
- uses: actions/upload-artifact@v2
225-
with:
226-
name: application-staging-apks
227-
path: build/application-staging/app/build/outputs/apk/**/*.apk
228-
if-no-files-found: error
229-
230-
- run: mv build/application-staging/app/build/reports/lint-results-release.html application-staging-lint-report.html
231-
- uses: actions/upload-artifact@v2
232-
with:
233-
name: application-staging-lint-report.html
234-
path: application-staging-lint-report.html
235-
if-no-files-found: error
236-
237207
runInstrumentedTests:
238208
needs: buildLibrary
239209
# Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator
@@ -284,3 +254,62 @@ jobs:
284254
name: instrumentedTestsReport-${{ matrix.api-level }}-${{ matrix.arch }}.tar
285255
path: instrumentedTestsReport-${{ matrix.api-level }}-${{ matrix.arch }}.tar
286256
if-no-files-found: error
257+
258+
buildApplicationAgainstUnReleasedLibrary:
259+
needs: buildLibrary
260+
runs-on: ubuntu-20.04
261+
steps:
262+
- uses: actions/checkout@v2
263+
- uses: actions/setup-java@v2
264+
with:
265+
distribution: zulu
266+
java-version: 11
267+
- uses: android-actions/setup-android@v2
268+
269+
- name: Prepare application for staging repository
270+
run: ./ci-scripts/prepareSampleAppForStagingRepository application app --output=build/application-staging --repository=${{ needs.buildLibrary.outputs.STAGING_REPO_URL }}
271+
272+
- name: Build and lint application from staging library
273+
run: ./gradlew build lintRelease
274+
working-directory: build/application-staging
275+
276+
- uses: actions/upload-artifact@v2
277+
with:
278+
name: application-staging-apks
279+
path: build/application-staging/app/build/outputs/apk/**/*.apk
280+
if-no-files-found: error
281+
282+
- run: mv build/application-staging/app/build/reports/lint-results-release.html application-staging-lint-report.html
283+
- uses: actions/upload-artifact@v2
284+
with:
285+
name: application-staging-lint-report.html
286+
path: application-staging-lint-report.html
287+
if-no-files-found: error
288+
289+
buildApplicationAgainstReleasedLibrary:
290+
if: "!contains(github.event.head_commit.message, '[SkipCI]') && contains(github.event.head_commit.message, '[AppOnly]')"
291+
runs-on: ubuntu-20.04
292+
steps:
293+
- uses: actions/checkout@v2
294+
- uses: actions/setup-java@v2
295+
with:
296+
distribution: zulu
297+
java-version: 11
298+
- uses: android-actions/setup-android@v2
299+
300+
- name: Build and lint application
301+
run: ./gradlew build lintRelease
302+
working-directory: application
303+
304+
- uses: actions/upload-artifact@v2
305+
with:
306+
name: application-staging-apks
307+
path: build/application-staging/app/build/outputs/apk/**/*.apk
308+
if-no-files-found: error
309+
310+
- run: mv application/app/build/reports/lint-results-release.html application-lint-report.html
311+
- uses: actions/upload-artifact@v2
312+
with:
313+
name: application-lint-report.html
314+
path: application-lint-report.html
315+
if-no-files-found: error

0 commit comments

Comments
 (0)