MonarcAppFO/.github/workflows/releases.yml

109 lines
2.9 KiB
YAML
Raw Normal View History

2022-05-30 14:55:16 +02:00
name: MonarcAppFO releases
on:
push:
branches: [ 'master' ]
2022-05-30 14:55:16 +02:00
tags: [ 'v*.*', 'v*.*.*', 'v*.*.*-*' ]
pull_request:
branches: [ 'master' ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ "16.x" ]
php-version: [ "8.1" ]
2022-05-30 14:55:16 +02:00
steps:
- uses: actions/checkout@v2
2022-05-30 15:15:09 +02:00
- name: install deps
2022-05-30 15:16:00 +02:00
run: sudo apt-get update && sudo apt install -y gettext
2022-05-30 15:15:09 +02:00
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 --no-dev --ignore-platform-req=php
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 }}
2022-10-10 16:24:02 +02:00
- 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
2022-10-10 16:24:02 +02:00
uses: actions/checkout@v3
with:
repository: monarc-project/ng-anr
2022-10-10 16:24:02 +02:00
ref: ${{ steps.ng_anr_lasttag.outputs.tag }}
path: './node_modules/ng_anr'
2022-10-10 16:24:02 +02:00
- uses: oprypin/find-latest-tag@v1
with:
repository: monarc-project/ng-client
2022-10-10 16:24:02 +02:00
releases-only: true
id: ng_client_lasttag
- run: echo "ng-client is at version ${{ steps.ng_client_lasttag.outputs.tag }}"
- name: Install ng-client
2022-10-10 16:24:02 +02:00
uses: actions/checkout@v3
with:
repository: monarc-project/ng-client
2022-10-10 16:24:02 +02:00
ref: ${{ steps.ng_client_lasttag.outputs.tag }}
path: './node_modules/ng_client'
2022-05-30 16:28:04 +02:00
- name: Install ng-client dependencies
run: |
cd node_modules/ng_client
npm ci
2022-05-30 16:28:04 +02:00
2022-05-30 14:55:16 +02:00
# final "cleanup"
- name: post job
run: |
2022-05-30 16:28:04 +02:00
bash -ex ./scripts/link_modules_resources.sh
bash -ex ./scripts/compile_translations.sh
2022-05-30 15:31:37 +02:00
# 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-30 15:31:37 +02:00
- name: create artifact archive
run: |
2022-05-30 15:33:53 +02:00
tar --exclude .git --exclude .github -zcf '../${{ steps.repository.outputs.pathref }}.tar.gz' .
2022-05-30 15:31:37 +02:00
- name: release
uses: softprops/action-gh-release@v1
with:
files: |
2022-05-30 15:33:53 +02:00
../${{ steps.repository.outputs.pathref }}.tar.gz
2022-05-30 15:31:37 +02:00
fail_on_unmatched_files: true
if: startsWith(github.ref, 'refs/tags/')