-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (49 loc) · 1.79 KB
/
android.yml
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
---
on:
workflow_dispatch: # Enables manual trigger
pull_request:
paths:
- 'android_beta/*.yml'
- 'android_release/*.yml'
push:
paths:
- 'android_beta/*.yml'
- 'android_release/*.yml'
jobs:
render_notes:
name: Render notes
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
with:
fetch-depth: 0
path: notes
- name: Python requirements
run: |
pip install requests pyyaml jinja2
- name: Render Notes
shell: bash
working-directory: notes
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
BETA_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_beta || true )
for file in $BETA_FILES
do
echo "## $file" | tee -a $GITHUB_STEP_SUMMARY
BETA_NUMBER=$(yq '.release.groups | length' $file)
RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
python ./tools/android_notes_length.py ${RELEASE_NUMBER}b${BETA_NUMBER} | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
done
RELEASE_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_release || true )
for file in $RELEASE_FILES
do
echo "## $file" | tee -a $GITHUB_STEP_SUMMARY
RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
python ./tools/android_notes_length.py ${RELEASE_NUMBER} | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
done