This repository was archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
64 lines (54 loc) · 1.67 KB
/
dependency-update.yml
File metadata and controls
64 lines (54 loc) · 1.67 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
name: CI for testing and merging Dependabot updates
on:
pull_request:
branches: [master]
permissions:
pull-requests: write
contents: write
jobs:
updateversion:
name: updateversion
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: checkout
uses: actions/checkout@v2
- name: increment last version digit
run: |
old=$(grep -P "(?<=VERSION_NAME=).*" gradle.properties)
lastnumber=$(echo $old | grep -Po "\d*$")
new=$(echo $old | grep -Po ".+?(?=$lastnumber)")
new+=$((lastnumber+1))
sed -i "s/${old}/${new}/" gradle.properties
- name: create commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated version incerment
file_pattern: gradle.properties
build:
name: build
needs: updateversion
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: java setup and gradle caching
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: grant execute permission for gradlew
run: chmod +x gradlew
- name: assemble release
run: ./gradlew -p ./yanndroid/oneui assembleRelease
merge:
name: merge
needs: build
runs-on: ubuntu-latest
steps:
- name: merge dependabot pull_reuqest
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}