Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple validation for android release notes #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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