Skip to content

Commit

Permalink
Add simple validation for android release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Nov 18, 2024
1 parent 729a5f9 commit 6d2c259
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---

on:
pull_request:
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: Checkout render-notes.py
uses: actions/checkout@v4
with:
repository: thunderbird/thunderbird-android
sparse-checkout: |
scripts/render-notes.py
scripts/templates/changelog_master.xml
scripts/templates/changelog.txt
scripts/templates/changelog_long.txt
sparse-checkout-cone-mode: false
path: render

- 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
echo "### net.thunderbird.android.beta" | 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 ../render/scripts/render-notes.py -p net.thunderbird.android.beta ${RELEASE_NUMBER}b${BETA_NUMBER} -r . | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
echo "### com.fsck.k9" | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
python ../render/scripts/render-notes.py -p com.fsck.k9 ${RELEASE_NUMBER}b${BETA_NUMBER} -r . | 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
echo "### net.thunderbird.android" | 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 ../render/scripts/render-notes.py -p net.thunderbird.android.beta ${RELEASE_NUMBER} -r . | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
echo "### com.fsck.k9" | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
python ../render/scripts/render-notes.py -p com.fsck.k9 ${RELEASE_NUMBER} -r . | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
done

0 comments on commit 6d2c259

Please sign in to comment.