forked from friendica/friendica-addons
commit
8441e698ce
23
.drone.yml
23
.drone.yml
|
@ -19,21 +19,16 @@ steps:
|
||||||
- name: clone friendica addon
|
- name: clone friendica addon
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone $DRONE_REMOTE_URL addon
|
- git clone $DRONE_REPO_LINK addon
|
||||||
- git checkout $DRONE_COMMIT_REF
|
- cd addon/
|
||||||
- name: Run default Xgettext
|
- git checkout $DRONE_COMMIT_BRANCH
|
||||||
|
- git fetch origin $DRONE_COMMIT_REF
|
||||||
|
- git merge $DRONE_COMMIT_SHA
|
||||||
|
- name: Run Xgettext for addons
|
||||||
image: friendicaci/transifex
|
image: friendicaci/transifex
|
||||||
commands:
|
commands:
|
||||||
- export CHANGED_FILES=($(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2))
|
- /xgettext-addon.sh
|
||||||
- export FIND_RESULT=$(printf "%s\n" "$CHANGED_FILES[@]" | sed '/^\./d' | cut -d "/" -f1 | uniq)
|
|
||||||
- for addon in $FIND_RESULT; do ./bin/run_xgettext.sh --addon $addon; done
|
|
||||||
- name: Check update necessary
|
- name: Check update necessary
|
||||||
image: alpine/git
|
image: friendicaci/transifex
|
||||||
commands:
|
commands:
|
||||||
- cd addon/
|
- /check-addons.sh
|
||||||
- if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then
|
|
||||||
echo "::error file=messages.po::messages.po is out of date"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Nothing to update"
|
|
||||||
fi
|
|
||||||
|
|
48
.github/workflows/transifex.yml
vendored
48
.github/workflows/transifex.yml
vendored
|
@ -1,48 +0,0 @@
|
||||||
name: Transifex
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
messages:
|
|
||||||
name: Check messages.po changes
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Install gettext
|
|
||||||
run: sudo apt-get install gettext
|
|
||||||
|
|
||||||
- name: Checkout Friendica Base
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: 'friendica/friendica'
|
|
||||||
ref: ${{ github.base_ref }}
|
|
||||||
|
|
||||||
- name: Checkout current Friendica Addons
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: 'addon'
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changes
|
|
||||||
uses: jitterbit/get-changed-files@v1
|
|
||||||
|
|
||||||
- name: Run Xgettext for each changed addon
|
|
||||||
run: |
|
|
||||||
addon_files=(${{ steps.changes.outputs.all }})
|
|
||||||
find_result=$(printf "%s\n" "${addon_files[@]}" | sed '/^\./d' | cut -d "/" -f1 | uniq)
|
|
||||||
for addon in $find_result
|
|
||||||
do
|
|
||||||
./bin/run_xgettext.sh --addon $addon
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Check if messages.po needs an update
|
|
||||||
run: |
|
|
||||||
echo "::group::Check messages.po"
|
|
||||||
# Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date"
|
|
||||||
cd addon/
|
|
||||||
if [[ $(git diff -U0 "**/messages.po" | awk '!/index|diff|\-\-\-|\+\+\+|@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\+#|\-#/{print }' | wc -l) > 0 ]]; then
|
|
||||||
echo "::error file=messages.po::messages.po is out of date"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Nothing to update"
|
|
||||||
fi
|
|
||||||
echo "::endgroup::"
|
|
||||||
shell: bash
|
|
Loading…
Reference in a new issue