-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple validation for android release notes
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |