Skip to content

Commit 783cd07

Browse files
committed
Add traslation
1 parent 53af789 commit 783cd07

File tree

2 files changed

+56
-22
lines changed

2 files changed

+56
-22
lines changed

.github/workflows/build-package.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Translate and Build Package
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches: [ "*" ]
8+
paths-ignore:
9+
- COPYING
10+
- README.md
11+
- LICENSE
12+
- '.github/workflows/**'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Install Translator Dependencies
20+
shell: bash
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install \
24+
git \
25+
gettext \
26+
npm
27+
# Install attranslator
28+
sudo npm install --location=global attranslate
29+
30+
- name: Translate Package
31+
shell: bash -O extglob {0}
32+
env:
33+
AZURE_KEY: ${{ secrets.AZURE_KEY }}
34+
run: |
35+
cd ..
36+
git clone https://github.com/biglinux/big-auto-translator.git
37+
mv big-auto-translator/gettext_po_generator_github.sh .
38+
gitfolder=$(echo ${{ github.repository }} | rev | cut -d "/" -f1 | rev)
39+
bash gettext_po_generator_github.sh $gitfolder
40+
41+
- name: Update github
42+
run: |
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
if [ -n "$(git commit -m "translate $(date +%y-%m-%d_%H:%M)" -a | grep "nothing to commit")" ];then exit 0; fi
46+
47+
- name: Push changes
48+
uses: ad-m/github-push-action@master
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
branch: ${{ github.ref }}
52+
53+
- name: Send Hooks BigLinux Build Package
54+
shell: bash
55+
run: |
56+
curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches

0 commit comments

Comments
 (0)