@@ -2,6 +2,12 @@ name: Translate and Build Package
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ debug_enabled :
7
+ type : boolean
8
+ description : ' With TMATE'
9
+ required : false
10
+ default : false
5
11
6
12
push :
7
13
branches : [ "*" ]
10
16
build :
11
17
runs-on : ubuntu-latest
12
18
steps :
13
- - uses : actions/checkout@v3
19
+ - uses : actions/checkout@v4
20
+ - name : If Template exit
21
+ shell : bash
22
+ run : |
23
+ cancel () {
24
+ echo "Pacote de template, não precisa traduzir e compilar"
25
+ echo "SAINDO...."
26
+ curl -s -H "Authorization: token ${{ github.token }}" \
27
+ -X POST "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
28
+ sleep infinity
29
+ }
30
+ if [ -n "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
31
+ cancel
32
+ fi
33
+
14
34
- name : Install Translator Dependencies
15
35
shell : bash
16
36
run : |
@@ -22,15 +42,23 @@ jobs:
22
42
# Install attranslator
23
43
sudo npm install --location=global attranslate
24
44
45
+ # # Tmate ##
46
+ - name : Setup TMATE Session
47
+ uses : mxschmitt/action-tmate@v3
48
+ if : ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
49
+
25
50
- name : Translate Package
26
- shell : bash -O extglob {0}
51
+ shell : bash # -O extglob {0}
27
52
env :
28
53
AZURE_KEY : ${{ secrets.AZURE_KEY }}
54
+ OPENAI_KEY : ${{ secrets.OPENAI_KEY }}
29
55
run : |
30
56
cd ..
31
57
git clone https://github.com/biglinux/big-auto-translator.git
32
58
mv big-auto-translator/gettext_po_generator_github.sh .
59
+ sudo cp -f big-auto-translator/openai-translate.js /usr/local/lib/node_modules/attranslate/dist/services/openai-translate.js
33
60
gitfolder=$(echo ${{ github.repository }} | rev | cut -d "/" -f1 | rev)
61
+ # export OriginalLang=pt-BR
34
62
bash gettext_po_generator_github.sh $gitfolder
35
63
36
64
- name : Update github
49
77
- name : Send Hooks BigLinux Build Package
50
78
shell : bash
51
79
run : |
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/dispatches
80
+ if [ -z "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then
81
+ 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
82
+ 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
83
+ fi
0 commit comments