diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..bc69d82 --- /dev/null +++ b/.github/workflows/android.yml @@ -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