Skip to content

Commit 102ec51

Browse files
committed
Merge #5 Customisation automation
2 parents 40884e2 + ef7330e commit 102ec51

File tree

3 files changed

+221
-0
lines changed

3 files changed

+221
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
###
2+
# SPDX-License-Identifier: AGPL-3.0
3+
#
4+
# Author: Bernd rederlechner <bernd.rederlechner@t-systems.com>
5+
#
6+
# Builds a stable release package based on a release assembly
7+
# customisation-<version>-<increment>
8+
#
9+
# As soon as a package is deployed to production, the tag and the branch
10+
# MUST STAY FOR 2 years and not deleted.
11+
#
12+
# Release packages, tags and customisation branches not delivered to production should
13+
# be deleted asap a newer release is available.
14+
#
15+
16+
name: MCLOUD custom app release
17+
18+
on:
19+
workflow_dispatch:
20+
inputs:
21+
increment:
22+
description: 'Release increment'
23+
required: true
24+
type: number
25+
branch:
26+
type: choice
27+
description: Branch to build a package from
28+
options:
29+
- main
30+
- stable25
31+
- stable26
32+
- stable27
33+
default: main
34+
35+
jobs:
36+
check-custom:
37+
uses: nextmcloud/.github/.github/workflows/nmc-app-precond.yml@master
38+
with:
39+
versionbranch: ${{ inputs.branch }}
40+
increment: ${{ inputs.increment }}
41+
secrets: inherit
42+
assemble-custom:
43+
uses: nextmcloud/.github/.github/workflows/nmc-custom-assembly.yml@master
44+
needs: check-custom
45+
with:
46+
trunk: 'main'
47+
stable: ${{ inputs.branch }}
48+
result: ${{ format('customisation-{0}-{1}', inputs.branch, inputs.increment ) }}
49+
secrets: inherit
50+
51+
composerdep:
52+
strategy:
53+
fail-fast: false
54+
uses: ./.github/workflows/nmc-custom-oidc-composer.yml
55+
needs: assemble-custom
56+
with:
57+
assembly: ${{ format('customisation-{0}-{1}', inputs.branch, inputs.increment) }}
58+
secrets: inherit
59+
60+
build-custom:
61+
uses: nextmcloud/.github/.github/workflows/nmc-custom-app-build.yml@master
62+
needs: [ check-custom, composerdep ]
63+
with:
64+
appname: ${{ needs.check-custom.outputs.appname }}
65+
assembly: ${{ format('customisation-{0}-{1}', inputs.branch , inputs.increment ) }}
66+
tag: ${{ needs.check-custom.outputs.tag }}
67+
prerelease: ${{ inputs.branch == 'main' && true || false }}
68+
secrets: inherit
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
###
2+
# SPDX-License-Identifier: AGPL-3.0
3+
#
4+
# Author: Bernd rederlechner <bernd.rederlechner@t-systems.com>
5+
#
6+
# Assemble a customisation for trunk (no backports) and stable
7+
# (backport xor trunk)
8+
#
9+
# It creates review (user-specific) customisations branches
10+
# - customisation-<user>-<trunk>
11+
# - customisation-<user>-<stable>
12+
13+
name: MCLOUD custom app versions
14+
15+
###
16+
# The customisation-* branches are always reassembled if a customisation branch
17+
# is updated or included into a custom PR
18+
on:
19+
workflow_dispatch:
20+
pull_request:
21+
types:
22+
- opened
23+
- reopened
24+
- synchronize
25+
branches:
26+
- master
27+
- main
28+
- trunk
29+
- nmcstable/**
30+
# - stable/**
31+
32+
jobs:
33+
34+
assemble:
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
custombase: [ "main" ]
39+
uses: nextmcloud/.github/.github/workflows/nmc-custom-assembly.yml@master
40+
with:
41+
trunk: "main"
42+
stable: ${{ matrix.custombase }}
43+
result: ${{ format('customisation-{0}-{1}', github.actor, matrix.custombase) }}
44+
secrets: inherit
45+
46+
composerdep:
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
custombase: [ "main" ]
51+
uses: ./.github/workflows/nmc-custom-oidc-composer.yml
52+
needs: assemble
53+
with:
54+
assembly: ${{ format('customisation-{0}-{1}', github.actor, matrix.custombase) }}
55+
secrets: inherit
56+
57+
phpunit:
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
phpversion: ['8.0', '8.1']
62+
database: ['mysql']
63+
custombase: [ "main" ]
64+
uses: nextmcloud/.github/.github/workflows/nmc-custom-app-phpunit.yml@master
65+
needs: composerdep
66+
with:
67+
assembly: ${{ format('customisation-{0}-{1}', github.actor, matrix.custombase) }}
68+
appname: 'user_oidc'
69+
server-branch: ${{ matrix.custombase }}
70+
phpversion: ${{ matrix.phpversion }}
71+
database: ${{ matrix.database }}
72+
secrets: inherit
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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

Comments
 (0)