Skip to content

Commit 4832d4e

Browse files
committed
Add files to ci/cd
1 parent 8df8bc3 commit 4832d4e

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)