Action performed by escopecz #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |