MonarcAppBO/.github/workflows/releases.yml

108 lines
3.0 KiB
YAML
Raw Normal View History

2022-05-31 09:58:42 +02:00
name: MonarcAppBO releases
on:
push:
branches: [ 'master' ]
2022-05-31 09:58:42 +02:00
tags: [ 'v*.*', 'v*.*.*', 'v*.*.*-*' ]
pull_request:
branches: [ 'master' ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ "16.x" ]
2023-03-09 15:05:40 +01:00
php-version: [ "8.1" ]
2022-05-31 09:58:42 +02:00
steps:
- uses: actions/checkout@v2
- name: install deps
run: sudo apt-get update && sudo apt install -y gettext
# PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
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
2023-03-24 09:57:16 +01:00
run: composer ins --prefer-dist --no-progress --no-suggest --no-dev --ignore-platform-req=php
2022-05-31 09:58:42 +02:00
- name: Symlink Monarc modules
2023-03-09 15:05:40 +01:00
run: |
2022-05-31 09:58:42 +02:00
mkdir -p module/Monarc
ln -s ../../vendor/monarc/core module/Monarc/Core
ln -s ../../vendor/monarc/backoffice module/Monarc/BackOffice
# javascript
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: oprypin/find-latest-tag@v1
with:
repository: monarc-project/ng-anr
releases-only: true
id: ng_anr_lasttag
- run: echo "ng-anr is at version ${{ steps.ng_anr_lasttag.outputs.tag }}"
- name: Install ng-anr
uses: actions/checkout@v3
with:
repository: monarc-project/ng-anr
ref: ${{ steps.ng_anr_lasttag.outputs.tag }}
path: './node_modules/ng_anr'
2022-05-31 09:58:42 +02:00
- uses: oprypin/find-latest-tag@v1
with:
repository: monarc-project/ng-backoffice
releases-only: true
id: ng_backoffice_lasttag
- run: echo "ng-backoffice is at version ${{ steps.ng_backoffice_lasttag.outputs.tag }}"
- name: Install ng-backoffice
uses: actions/checkout@v3
with:
repository: monarc-project/ng-backoffice
ref: ${{ steps.ng_backoffice_lasttag.outputs.tag }}
path: './node_modules/ng_backoffice'
2022-05-31 09:58:42 +02:00
- name: Install ng-backoffice dependencies
2022-05-31 09:58:42 +02:00
run: |
cd node_modules/ng_backoffice
npm ci
2022-05-31 09:58:42 +02:00
# final "cleanup"
- name: post job
run: |
bash -ex ./scripts/link_modules_resources.sh
bash -ex ./scripts/compile_translations.sh
# prepare release
- name: Get repository name
id: repository
run: echo "::set-output name=pathref::$(echo '${{ github.repository }}' | cut -d'/' -f2)-$(echo '${{ github.ref_name }}' | sed 's/[^[:alnum:]\.-]/_/g')"
2022-05-31 09:58:42 +02:00
- name: create artifact archive
run: |
tar --exclude .git --exclude .github -zcf '../${{ steps.repository.outputs.pathref }}.tar.gz' .
- name: release
uses: softprops/action-gh-release@v1
with:
files: |
../${{ steps.repository.outputs.pathref }}.tar.gz
fail_on_unmatched_files: true
if: startsWith(github.ref, 'refs/tags/')