forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.81 KB
/
jh-translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: JH Translations
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
branches:
- dev
- dev-jethub
- master
- master-jethub
paths:
- "**strings.json"
env:
DEFAULT_PYTHON: "3.12"
jobs:
upload:
name: Upload
if: github.repository_owner == 'jethub-homeassistant'
runs-on: ${{ vars.RUNNER }}
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Prepare Translations
run: |
python3 -m script.jhtranslations upload
- name: Get translated resources from current HA core dev
run: |
VERSION=$(curl -s https://version.home-assistant.io/dev.json | jq -r '.homeassistant."qemuarm-64"')
docker create --name temp-core ghcr.io/home-assistant/aarch64-homeassistant:$VERSION
docker cp temp-core:"/usr/src/homeassistant/build/translations-download/" build/translations-download/
docker rm temp-core
- name: Download Translations from upstream
run: |
VERSION=$(curl -s https://version.home-assistant.io/beta.json | jq -r '.homeassistant."qemuarm-64"')
docker create --name temp-core ghcr.io/home-assistant/aarch64-homeassistant:$VERSION
docker cp temp-core:"/usr/src/homeassistant/homeassistant" ./
docker rm temp-core
- name: Archive translations
shell: bash
run: find ./homeassistant/components/*/translations -name "*.json" | tar zcvf translations.tar.gz -T -
- name: Upload Translations
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: push -s -t -a