Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): Add a worflow to check if translationtool.phar is build #363

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/translationtool-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build


on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

name: translationtool.phar

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up php 8.0
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
coverage: none

- name: Build translationtool.phar
working-directory: translations/translationtool/
run: make translationtool.phar

- name: Upload translationtool
uses: actions/upload-artifact@v2
with:
name: translationtool.phar
path: translations/translationtool/translationtool.phar

- name: Check build changes
run: |
git status --porcelain translations/translationtool/
bash -c "[[ ! \"`git status --porcelain translations/translationtool/translationtool.phar`\" ]] || exit 1"
16 changes: 13 additions & 3 deletions translations/translationtool/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
.PHONY: translationtool.phar

translationtool.phar: install-composer-deps
translationtool.phar: clean install-composer-deps
php -d phar.readonly=off vendor/bin/phar-composer build src
chmod +x translationtool.phar

install-composer-deps: composer.phar
php composer.phar install
php composer.phar install -d src
rm src/vendor/gettext/gettext/CHANGELOG.md
rm src/vendor/gettext/gettext/composer.json
rm src/vendor/gettext/gettext/CONTRIBUTING.md
rm src/vendor/gettext/gettext/LICENSE
rm src/vendor/gettext/gettext/phpcs.xml
rm src/vendor/gettext/gettext/README.md
rm src/vendor/gettext/languages/composer.json
rm src/vendor/gettext/languages/LICENSE
rm src/vendor/gettext/languages/UNICODE-LICENSE.txt

composer.phar:
curl -sS https://getcomposer.org/installer | php

clean:
rm -f translationtool.phar composer.lock src/composer.lock
rm -rf vendor src/vendor
rm -f translationtool.phar
rm -f composer.phar
rm -rf vendor src/vendor
Binary file modified translations/translationtool/translationtool.phar
Binary file not shown.