MonarcAppFO/.github/workflows/releases.yml

105 lines
2.5 KiB
YAML
Raw Normal View History

2022-05-30 14:55:16 +02:00
name: MonarcAppFO releases
on:
push:
branches: [ 'ci-releases' ]
tags: [ 'v*.*', 'v*.*.*', 'v*.*.*-*' ]
pull_request:
branches: [ 'master' ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ "16.x" ]
php-version: [ "7.4" ]
steps:
- uses: actions/checkout@v2
2022-05-30 15:15:09 +02:00
- name: install deps
run: apt install -y gettext
2022-05-30 14:55:16 +02:00
# PHP
2022-05-30 15:07:47 +02:00
- name: Setup PHP
uses: shivammathur/setup-php@v2
2022-05-30 14:55:16 +02:00
with:
2022-05-30 15:07:47 +02:00
php-version: ${{ matrix.php-version }}
tools: composer:v2.3
extensions: bcmath
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-suggest
2022-05-30 14:55:16 +02:00
- name: Symlink Monarc modules
run: |
mkdir -p module/Monarc
ln -s ../../vendor/monarc/core module/Monarc/Core
ln -s ../../vendor/monarc/frontoffice module/Monarc/FrontOffice
# javascript
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Prepare node_modules
run: |
mkdir -p node_modules
# ng_anr
- name: Clone ng_anr
uses: actions/checkout@v2
with:
repository: monarc-project/ng-anr
path: node_modules/ng_anr
- name: checkout latest tag
run: |
2022-05-30 15:09:45 +02:00
git fetch --tags
2022-05-30 14:55:16 +02:00
git checkout "$(git describe --tags $(git rev-list --tags --max-count=1))"
working-directory: node_modules/ng_anr
- name: Install ng_anr
2022-05-30 15:11:51 +02:00
# no package-lock.json in ng_anr
2022-05-30 14:55:16 +02:00
run: |
2022-05-30 15:11:51 +02:00
npm install
2022-05-30 14:55:16 +02:00
working-directory: node_modules/ng_anr
# ng_client
- name: Clone ng_client
uses: actions/checkout@v2
with:
repository: monarc-project/ng-client
path: node_modules/ng_client
- name: checkout latest tag
run: |
2022-05-30 15:09:45 +02:00
git fetch --tags
2022-05-30 14:55:16 +02:00
git checkout "$(git describe --tags $(git rev-list --tags --max-count=1))"
working-directory: node_modules/ng_client
- name: Install ng_client
2022-05-30 15:11:51 +02:00
# this one has a package-lock.json
2022-05-30 14:55:16 +02:00
run: |
npm ci
working-directory: node_modules/ng_client
# rest of javascript deps
- name: Install grunt
run: npm install -g grunt-cli
- name: Install dependencies
run: npm install
# final "cleanup"
- name: post job
run: |
2022-05-30 15:15:09 +02:00
bash -xe ./scripts/link_modules_resources.sh
bash -xe ./scripts/compile_translations.sh