Skip to content

Commit cc4c6e4

Browse files
Pull Weblate Changes Before Updating Translations (#686)
Co-authored-by: Russell Keith-Magee <[email protected]>
1 parent f0a9983 commit cc4c6e4

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ jobs:
4141
lektor plugins reinstall
4242
sudo apt update -y
4343
sudo apt install -y --no-install-recommends gettext
44+
- name: Configure Weblate
45+
env:
46+
WEBLATE_API_TOKEN: ${{ secrets.WEBLATE_API_TOKEN }}
47+
run: |
48+
mkdir -p ~/.config && cat <<EOF > ~/.config/weblate
49+
[weblate]
50+
url = https://hosted.weblate.org/api/
51+
key = $WEBLATE_API_TOKEN
52+
translation = weblate/application
53+
EOF
54+
- name: Lock Weblate and Sync
55+
run: |
56+
wlc commit
57+
wlc lock
58+
wlc push
59+
git pull origin
60+
4461
- name: Build site
4562
run: |
4663
lektor build --no-prune
@@ -64,6 +81,15 @@ jobs:
6481
git commit -m "Update translations to $(git rev-parse --short HEAD)."
6582
git push origin
6683
84+
- name: Ensure Weblate has current updates
85+
if: steps.updated.outputs.updated == 'true'
86+
run: |
87+
wlc pull
88+
89+
- name: Unlock Weblate
90+
run: |
91+
wlc unlock
92+
6793
- name: Publish site
6894
env:
6995
LEKTOR_DEPLOY_USERNAME: brutusthebee

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ requests==2.32.4
2323
text-unidecode==1.3
2424
urllib3==2.5.0
2525
watchdog==6.0.0
26+
wlc==1.15

0 commit comments

Comments
 (0)