mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
workflow adjustments to reduce commits
This commit is contained in:
51
.github/workflows/compile-mo.yml
vendored
51
.github/workflows/compile-mo.yml
vendored
@@ -1,51 +0,0 @@
|
||||
name: Compile .mo files from changed .po files
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# paths:
|
||||
# - '**/*.po'
|
||||
# branches:
|
||||
# - 'dev'
|
||||
|
||||
jobs:
|
||||
compile_mo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wavelog/wavelog
|
||||
ref: dev
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up gettext
|
||||
run: sudo apt-get install -y gettext
|
||||
|
||||
- name: Compile .mo files from changed .po files
|
||||
run: |
|
||||
set -e
|
||||
changed_po_files=$(git diff --name-only HEAD~1 HEAD | grep '\.po$' || true)
|
||||
if [ -n "$changed_po_files" ]; then
|
||||
for po in $changed_po_files; do
|
||||
mo="${po%.po}.mo"
|
||||
msgfmt -vv -o "$mo" "$po"
|
||||
echo "Compiled $po to $mo"
|
||||
done
|
||||
else
|
||||
echo "No .po files changed"
|
||||
fi
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git add $(git ls-files --modified | grep '\.mo$')
|
||||
git commit -m "Compiled .mo files (manually triggered)"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
24
.github/workflows/translation.yml
vendored
24
.github/workflows/translation.yml
vendored
@@ -20,18 +20,28 @@ jobs:
|
||||
- name: Set up gettext
|
||||
run: sudo apt-get install -y gettext
|
||||
|
||||
- name: Run the po generator script
|
||||
run: bash po_gen.sh
|
||||
|
||||
- name: Run the po generator script for the installer component aswell
|
||||
run: bash install/po_gen_installer.sh
|
||||
- name: Run all po_gen scripts
|
||||
run: |
|
||||
./po_gen.sh
|
||||
./install/po_gen_installer.sh
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git add .
|
||||
git commit -m "Run po_gen.sh script to update translation files"
|
||||
git commit -m "po/mo updates"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Command Weblate to perform a pull
|
||||
env:
|
||||
WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }}
|
||||
WEBLATE_URL: ${{ secrets.WEBLATE_URL }}
|
||||
run: |
|
||||
sleep 2
|
||||
curl --silent \
|
||||
-d operation=pull \
|
||||
-H "Authorization: Token $WEBLATE_TOKEN" \
|
||||
$WEBLATE_URL
|
||||
5
install/po_gen_installer.sh
Executable file → Normal file
5
install/po_gen_installer.sh
Executable file → Normal file
@@ -35,6 +35,11 @@ POT_COPYRIGHT_TEXT="Copyright (c) $YEAR Wavelog by DF2ET, DJ7NT, HB9HIL and LA8A
|
||||
POT_LICENCE_TEXT="This file is distributed under the MIT licence."
|
||||
FOLDERS="install"
|
||||
|
||||
echo "####################################################"
|
||||
echo " "
|
||||
echo "Performing the PO Generator Script for the Installer"
|
||||
echo " "
|
||||
|
||||
# Find all PHP files and create a list in a temporary file
|
||||
find $FOLDERS -name "*.php" > PHPFILESLIST
|
||||
|
||||
|
||||
5
po_gen.sh
Executable file → Normal file
5
po_gen.sh
Executable file → Normal file
@@ -35,6 +35,11 @@ POT_COPYRIGHT_TEXT="Copyright (c) $YEAR Wavelog by DF2ET, DJ7NT, HB9HIL and LA8A
|
||||
POT_LICENCE_TEXT="This file is distributed under the MIT licence."
|
||||
FOLDERS="application assets src system"
|
||||
|
||||
echo "####################################################"
|
||||
echo " "
|
||||
echo "Performing the PO Generator Script for the Main Code"
|
||||
echo " "
|
||||
|
||||
# Find all PHP files and create a list in a temporary file
|
||||
find $FOLDERS -name "*.php" > PHPFILESLIST
|
||||
|
||||
|
||||
Reference in New Issue
Block a user