This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed
Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI for testing and merging Dependabot updates
2+
3+ on :
4+ pull_request :
5+ branches : [master]
6+
7+ permissions :
8+ pull-requests : write
9+ contents : write
10+
11+ jobs :
12+ updateversion :
13+ name : updateversion
14+ runs-on : ubuntu-latest
15+ if : github.actor == 'dependabot[bot]'
16+ steps :
17+ - name : checkout
18+ uses : actions/checkout@v2
19+
20+ - name : increment last version digit
21+ run : |
22+ old=$(grep -P "(?<=VERSION_NAME=).*" gradle.properties")
23+ lastnumber=$(echo $old | grep -Po "\d*$")
24+ new=$(echo $old | grep -Po ".+?(?=$lastnumber)")
25+ new+=$((lastnumber+1))
26+ sed -i "s/${old}/${new}/" gradle.properties
27+
28+ - name : create commit
29+ uses : stefanzweifel/git-auto-commit-action@v4
30+ with :
31+ commit_message : Automated version incerment
32+ file_pattern : gradle.properties
33+
34+ build :
35+ name : build
36+ needs : updateversion
37+ runs-on : ubuntu-latest
38+ steps :
39+ - name : checkout
40+ uses : actions/checkout@v2
41+
42+ - name : java setup and gradle caching
43+ uses : actions/setup-java@v2
44+ with :
45+ distribution : " zulu"
46+ java-version : " 11"
47+ cache : " gradle"
48+
49+ - name : grant execute permission for gradlew
50+ run : chmod +x gradlew
51+
52+ - name : assemble release
53+ run : ./gradlew -p ./yanndroid/oneui assembleRelease
54+
55+ merge :
56+ name : merge
57+ needs : build
58+ runs-on : ubuntu-latest
59+ steps :
60+ - name : merge dependabot pull_reuqest
61+ run : gh pr merge --auto --merge "$PR_URL"
62+ env :
63+ PR_URL : ${{github.event.pull_request.html_url}}
64+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
You can’t perform that action at this time.
0 commit comments