-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (59 loc) · 2.28 KB
/
package-build.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Mautic Language Packer
run-name: Action performed by ${{ github.actor }}
on:
schedule:
- cron: '0 0 * * *'
env:
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
TRANSIFEX_ORGANISATION: ${{ secrets.TRANSIFEX_ORGANISATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
jobs:
build:
runs-on: ubuntu-latest
container:
image: php:8.1
steps:
- name: Install git
run: apt update && apt install -y git
- name: Install PHP zip extension
run: apt-get update && apt-get install -y libzip-dev && docker-php-ext-install zip
- name: Set GitHub workspace as safe directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout code
uses: actions/checkout@v3
with:
token: '${{ secrets.NEW_GITHUB_TOKEN }}'
- name: Install composer
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- name: Install dependencies
run: |
apt-get update && apt-get install -y git jq ssh unzip zip
mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
composer install
- name: Build language packages
run: bin/console mautic:language:packer --skip-languages=en
- name: Update build timestamp in last_build file
run: |
echo "Last language packages build: $(date)" > last_build
git config user.name "Automated build"
git config user.email "action@github.com"
git add -f last_build
git commit -m "update build timestamp in last_build file"
git push origin HEAD:master
- name: Checkout language-packs to PACKS dir
uses: actions/checkout@v3
with:
repository: 'mautic/language-packs'
ref: 'master'
token: '${{ secrets.NEW_GITHUB_TOKEN }}'
path: 'PACKS'
- name: Push packages to language-packs
run: |
cp -R packages/*/* PACKS/
cd PACKS
jq -s '{"languages":.}' *.json > manifest.json
git config user.name "Automated build"
git config user.email "action@github.com"
git add .
git commit -m "automatic language build"
git push origin HEAD:master