|
| 1 | +### |
| 2 | +# SPDX-License-Identifier: AGPL-3.0 |
| 3 | +# |
| 4 | +# Author: Bernd Rederlechner <bernd.rederlechner@t-systems.com |
| 5 | +# |
| 6 | +# user_oidc is (so far) the only app where we add php packages |
| 7 | +# to Nextcloud standard. We add these commandline based in build |
| 8 | +# to avoid continuous merge conflicts due to "composer.lock" |
| 9 | +# merge problems |
| 10 | + |
| 11 | +name: MCLOUD custom user_oidc dependencies |
| 12 | + |
| 13 | + |
| 14 | +on: |
| 15 | + workflow_call: |
| 16 | + inputs: |
| 17 | + assembly: |
| 18 | + description: name of the customisation assembly branch |
| 19 | + required: true |
| 20 | + type: string |
| 21 | + |
| 22 | +jobs: |
| 23 | + build-custom: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + env: |
| 26 | + BUILD_USER: ${{ github.actor }} |
| 27 | + BUILD_EMAIL: ${{ github.actor }}@users.noreply.github.com |
| 28 | + BUILD_TOKEN: ${{ secrets.BUILD_TOKEN || secrets.GITHUB_TOKEN }} |
| 29 | + PHP_VERSION: ${{ vars.PHP_VERSION || '8.1' }} |
| 30 | + steps: |
| 31 | + - name: Fetch custom assembly |
| 32 | + id: checkout_custom |
| 33 | + uses: actions/checkout@v3 |
| 34 | + env: |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + with: |
| 37 | + repository: ${{ github.repository }} |
| 38 | + ref: ${{ inputs.assembly }} |
| 39 | + fetch-depth: 0 |
| 40 | + token: ${{ env.BUILD_TOKEN }} |
| 41 | + |
| 42 | + - name: Prepare GIT modifications |
| 43 | + id: prepare_git |
| 44 | + run: | |
| 45 | + # set user in case commits are needed |
| 46 | + git config user.name $BUILD_USER |
| 47 | + git config user.email $BUILD_EMAIL |
| 48 | +
|
| 49 | + # install php dependencies |
| 50 | + - name: Set up php ${{ env.PHP_VERSION }} |
| 51 | + uses: shivammathur/setup-php@v2 |
| 52 | + with: |
| 53 | + php-version: ${{ env.PHP_VERSION }} |
| 54 | + coverage: none |
| 55 | + |
| 56 | + - name: Check composer.json |
| 57 | + id: check_composer |
| 58 | + uses: andstor/file-existence-action@v1 |
| 59 | + with: |
| 60 | + files: "./composer.json" |
| 61 | + |
| 62 | + - name: Install composer JWT dependencies |
| 63 | + if: steps.check_composer.outputs.files_exists == 'true' |
| 64 | + run: | |
| 65 | + composer require web-token/jwt-core:^2.0 \ |
| 66 | + web-token/jwt-encryption:^2.2 \ |
| 67 | + web-token/jwt-signature:^2.2 \ |
| 68 | + web-token/jwt-encryption-algorithm-aescbc:^2.2 \ |
| 69 | + web-token/jwt-encryption-algorithm-ecdh-es:^2.2 \ |
| 70 | + web-token/jwt-encryption-algorithm-rsa:^2.2 \ |
| 71 | + web-token/jwt-encryption-algorithm-pbes2:^2.2 \ |
| 72 | + web-token/jwt-signature-algorithm-hmac:^2.2 \ |
| 73 | + web-token/jwt-signature-algorithm-rsa:^2.2 \ |
| 74 | + web-token/jwt-util-ecc:^2.2 |
| 75 | +
|
| 76 | + - name: Commit push composer.json/.lock '${{ env.CUSTOM_BRANCH }}' |
| 77 | + id: pushcomposerdep |
| 78 | + run: | |
| 79 | + git commit -m "Add jwt-token composer library dependencies" composer.json composer.lock |
| 80 | + git push origin $CUSTOM_BRANCH |
| 81 | + |
0 commit comments