Skip to content

update getter action #295

update getter action

update getter action #295

Workflow file for this run

name: Merge
'on':
push:
branches:
- master
jobs:
flatpak:
name: flatpak
runs-on: ubuntu-latest
container:
image: 'ghcr.io/flathub-infra/flatpak-github-actions:gnome-48'
options: '--privileged'
steps:
- uses: actions/checkout@v5
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: planify.Devel.flatpak
manifest-path: build-aux/io.github.alainm23.planify.Devel.json
cache-key: 'flatpak-builder-${{ github.sha }}'
gettext:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install gettext
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Pull latest changes
run: |
git config --local user.name "Planify Bot"
git config --local user.email "[email protected]"
git fetch origin master
git rebase origin/master || true
- name: Update POTFILES and translations
run: |
# Regenerate POTFILES
cat > po/POTFILES << 'EOF'
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
EOF
find core -name "*.vala" | sort >> po/POTFILES
echo >> po/POTFILES
find src -name "*.vala" | sort >> po/POTFILES
echo >> po/POTFILES
find quick-add -name "*.vala" | sort >> po/POTFILES
echo >> po/POTFILES
echo "data/resources/ui/shortcuts.ui" >> po/POTFILES
# Update translations preserving metadata
python3 scripts/update_translations.py
- name: Check for real changes
id: check_changes
run: |
# Exclude metadata-only changes
if git diff --ignore-matching-lines='^"POT-Creation-Date:' \
--ignore-matching-lines='^"PO-Revision-Date:' \
--ignore-matching-lines='^"Report-Msgid-Bugs-To:' \
--quiet po/; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Resolve conflicts if any
run: |
if [ -f po/io.github.alainm23.planify.pot ]; then
git add po/io.github.alainm23.planify.pot
fi
git rebase --continue || true
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git add po/
git diff --staged --quiet || git commit -m "Update translations"
git push origin master
- name: Notify Weblate of changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
curl -X POST "https://hosted.weblate.org/api/components/planner/io-github-alainm23-planify/repository/" \
-H "Authorization: Token ${{ secrets.WEBLATE_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"operation": "pull"}'