-
-
Notifications
You must be signed in to change notification settings - Fork 2
127 lines (112 loc) · 4.53 KB
/
appRelease.yml
File metadata and controls
127 lines (112 loc) · 4.53 KB
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
# MIT License
#
# Copyright (c) 2021 - 2022 ViliusSutkus89.com
#
# https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests
# .github/workflows/appRelease.yml - v2.1.0
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: appRelease
on: workflow_dispatch
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
buildSampleApp:
environment: SampleAppKeystore
runs-on: ubuntu-20.04
outputs:
# in case there's a commit between buildSampleApp and releaseApp jobs...
GIT_TAG: ${{ github.event.ref }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- uses: android-actions/setup-android@v2
- id: decodeSampleAppKeystore
run: |
echo "${{ env.APP_SIGNING_KEYFILE_BASE64 }}" | base64 --decode - > "$HOME/com.viliussutkus89.samplelib.sampleapp.jks"
echo "::set-output name=APP_SIGNING_KEYFILE::$HOME/com.viliussutkus89.samplelib.sampleapp.jks"
env:
APP_SIGNING_KEYFILE_BASE64: ${{ secrets.APP_SIGNING_KEYFILE_BASE64 }}
- run: ./gradlew build lintRelease
working-directory: sampleapp
env:
APP_SIGNING_KEYFILE: ${{ steps.decodeSampleAppKeystore.outputs.APP_SIGNING_KEYFILE }}
APP_SIGNING_PASS: ${{ secrets.APP_SIGNING_PASS }}
APP_SIGNING_ALIAS: ${{ secrets.APP_SIGNING_ALIAS }}
- uses: actions/upload-artifact@v3
with:
name: APKs
path: sampleapp/app/build/outputs/apk/**/*.apk
- run: mv sampleapp/app/build/reports/lint-results-release.html sampleapp-lint-report.html
- uses: actions/upload-artifact@v3
with:
name: sampleapp-lint-report.html
path: sampleapp-lint-report.html
releaseApp:
needs: buildSampleApp
permissions:
# Permission needed to create the GitHub release.
contents: write
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# A branch is required for post release version increment commit
ref: ${{ needs.buildSampleApp.outputs.GIT_TAG }}
- uses: actions/download-artifact@v3
with:
path: artifacts
- run: ./ci-scripts/getVersion --ci
id: version
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: "v${{ steps.version.outputs.appVersion }}-AppRelease"
name: "[AppRelease] ${{ github.event.repository.name }} v${{ steps.version.outputs.appVersion }}"
artifacts: "artifacts/APKs/**/*.apk,artifacts/sampleapp-lint-report.html/sampleapp-lint-report.html"
postReleaseAppVersionIncrement:
needs: releaseApp
permissions:
contents: write
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
- run: ./ci-scripts/incrementVersion --application
id: postReleaseVersionIncrement
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Post release app version increment to ${{ steps.postReleaseVersionIncrement.outputs.newAppVersion }} (from ${{ steps.postReleaseVersionIncrement.outputs.oldAppVersion }})"
file_pattern: ${{ steps.postReleaseVersionIncrement.outputs.files }}