From d0e3b10c0191f3f02b8876f14a1d25f59b63b71d Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 13 May 2026 09:44:01 +0545 Subject: [PATCH 01/30] ci: automate upgrade testing Signed-off-by: nabim777 --- .github/scripts/self-hosted-app-store.sh | 89 ++++++++++ .github/workflows/appstore.yml | 201 +++++++++++++++++++++++ 2 files changed, 290 insertions(+) create mode 100644 .github/scripts/self-hosted-app-store.sh create mode 100644 .github/workflows/appstore.yml diff --git a/.github/scripts/self-hosted-app-store.sh b/.github/scripts/self-hosted-app-store.sh new file mode 100644 index 000000000..c5280e4d0 --- /dev/null +++ b/.github/scripts/self-hosted-app-store.sh @@ -0,0 +1,89 @@ +# SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. +# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH +# SPDX-License-Identifier: AGPL-3.0-only +#!/usr/bin/env bash + +# This bash script is to register and publish the apps in self-hosted appstore. +# To run this script the self-hosted appstore instances must be up and running + +set -e + +# helper functions +log_error() { + echo -e "\e[31m$1\e[0m" +} + +log_info() { + echo -e "\e[37m$1\e[0m" +} + +log_success() { + echo -e "\e[32m$1\e[0m" +} + +if [ -z "$APP_ID" ] || [ -z "$APP_VERSION" ]; then + log_error "One or more required environment variables are missing: APP_ID, APP_VERSION" + exit 1 +fi + +registerApps() { + app_name=$1 + + register_app=$(curl -s -o /dev/null -w "%{http_code}" -X POST -uadmin:admin \ + http://localhost:8000/api/v1/apps \ + -H "Content-Type: application/json" \ + -d "{ + \"certificate\": \"${CERTIFICATE}\", + \"signature\": \"${SIGNATURE}\" + }") + if [[ ${register_app} == 201 ]]; then + log_success "\"${app_name}\" has been registered successfully!" + elif [[ ${register_app} == 204 ]]; then + log_info "\"${app_name}\" has been updated!" + elif [[ ${register_app} == 400 ]]; then + log_error "\"${app_name}\" contains invalid characters, the signature!" + exit 1 + else + log_error "Failed to register \"${app_name}\"" + exit 1 + fi +} + +publishApps() { + app_name=$1 + app_version=$2 + + register_app=$(curl -s -o /dev/null -w "%{http_code}" -X POST -uadmin:admin \ + http://localhost:8000/api/v1/apps/releases \ + -H "Content-Type: application/json" \ + -d "{ + \"download\":\"${DOWNLOAD_URL}\", + \"signature\": \"${SIGNATURE}\" + }") + if [[ ${register_app} == 200 ]]; then + log_success "\"${app_name} ${app_version}\" has been updated successfully!" + elif [[ ${register_app} == 201 ]]; then + log_success "\"${app_name} ${app_version}\" has been published successfully!" + else + log_error "Failed to publish \"${app_name} ${app_version}\"" + exit 1 + fi +} + +if [[ $APP_ID == "integration_openproject" ]]; then + # public certificate of the integration app for testing + CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" + DOWNLOAD_URL="https://github.com/nextcloud/$APP_ID/releases/download/v$APP_VERSION/$APP_ID-$APP_VERSION.tar.gz" +elif [[ $APP_ID == "groupfolders" ]]; then + # public certificate of the groupfolders app for testing + CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEBzCCAu8CAhBMMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTcwNDI2MTc0NDAwWhcNMjcwODAyMTc0NDAwWjAXMRUwEwYD\r\nVQQDEwxncm91cGZvbGRlcnMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC\r\nAQDa7N4NmUyKgT6Ovo5EXdXV7eBFaCRWKvgnwgpmpYCdSdPpprBaoyKka5FWi2Zo\r\nB2QCDQtmRuZ9RpiAblvLGeIYI1hNd1O6632U5wLtZFa2WsueV8lFGiXIy+r7jK8R\r\nc56tmeclKP4RImk4yydec89bB2\/MmVYaNkNqueckg239C1Nt0GfmmQaTlANvGVAe\r\ndb0+Y+\/YBSHSSE8TDf6n3kFR5RIWspbXv3mwFOaTTxtR+hi01eaPWnGnRz2w1+Wn\r\nXJQVBzLGuQI\/GdYZItbZ5PgVuHMcvIc6elJENiUzqli3y6VbA9posefkPAph75ny\r\nqa+B7RppiE+5d4er8es04azEKjlcmGi6zkosQEikeT01zIiiDjsvsW1gFd5KQ+OX\r\nfUsuL2R8ymX6btj5Ee6lAK7qfCgQfKEIjl5oz48+h46ERe\/NToZsNS\/g5sO5UfG5\r\n+URERPuMteaF6bKMZlHLEVco8RUttocfHGAHuA4PIWgR\/XKLdJ\/c1VsjsvMak90u\r\nfKR6vkGFizGKHQG+2ZXJQuBAih6lQ7Lbd\/v5NWIMiYHZG990EXc6nUmKUcepTl9P\r\n6CfFq4LyX4jEN8KkuLsXk5jMgDf5LjNNvqOXH\/dbynUrjUb+mCMLCq6lvp3SD39m\r\nw1LjNZe6TDsZmPN\/+XoeG88zvidGszy7dVbO2HDcDssnWwIDAQABMA0GCSqGSIb3\r\nDQEBCwUAA4IBAQBqTrXOxSRaqdcBPUfuwWTPs+OzJjJ77DXhQKP3zMMVAadWN1O4\r\naVQ6Q2m6+1YocW4cI1WUiV5JkIXHZk3CZc7GxMmA6E\/STpNfDG+gp1G8ZFkVa7Dr\r\nfYBIvzu1ORvGdLygaiRGDdkc0Rsm49O41T6uKvmuQfBZqosSm4+pMA7MRIyLmi4n\r\nsM5F8ksDKX9dyA3SVufPgb4Qy8Hy85ory4GaPkdDgry3nDK1AU+ZmFyRXo5GfMsG\r\nIGWvIBP52FpCyb\/papXhtLzajVgEY4o0Asv\/E7UFymnOofTrBmZA\/+z3n59\/sZUT\r\nKclsORyDjRlH1yV02PDfgk8Hw2RR5fmaoP3h\r\n-----END CERTIFICATE-----" + DOWNLOAD_URL="https://github.com/nextcloud-releases/$APP_ID/releases/download/v$APP_VERSION/groupfolders-v$APP_VERSION.tar.gz" +else + log_error "Invalid app name: $APP_ID" + log_error "Please set the APP_ID environment variable to either \"integration_openproject\" or \"groupfolders\"" + exit 1 +fi + +registerApps "$APP_ID" +publishApps "$APP_ID" "$APP_VERSION" \ No newline at end of file diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml new file mode 100644 index 000000000..d047ce126 --- /dev/null +++ b/.github/workflows/appstore.yml @@ -0,0 +1,201 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. +# +# SPDX-License-Identifier: CC0-1.0 + +name: Upgrade Testing + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + env: + DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development + services: + + database-mysql: + image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest + env: + MYSQL_ROOT_PASSWORD: 'nextcloud' + MYSQL_PASSWORD: 'nextcloud' + MYSQL_USER: 'nextcloud' + MYSQL_DATABASE: 'nextcloud' + ports: + - 3306:3306 + + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + with: + path: integration_openproject + + - name: Setup NodeJS + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 + with: + node-version: 20 + + - name: Setup npm + run: npm i -g npm + + - name: Setup PHP + uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d + with: + php-version: '8.2' + extensions: mbstring, intl, mysql, gd + ini-values: post_max_size=256M, max_execution_time=180 + coverage: xdebug + tools: php-cs-fixer, phpunit + + - name: Build nextcloud project + # if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }} + # id: build_release + run: | + export DEBIAN_FRONTEND=noninteractive + echo "###### installing nextcloud" + mkdir ~/html + git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable29 ~/html/nextcloud + cd ~/html/nextcloud + git submodule update --init + mkdir -p data + # chown -R www-data:www-data config data apps + php occ maintenance:install \ + --database mysql \ + --database-name nextcloud \ + --database-host 127.0.0.1 \ + --database-user nextcloud \ + --database-pass nextcloud \ + --admin-user admin \ + --admin-pass admin + php occ maintenance:mode --off + sudo php -S localhost:80 -t ~/html/nextcloud & + + - name: Wait for Nextcloud server to be ready + run: | + if ! timeout 5m bash -c ' + until curl -s -f http://localhost/status.php | grep '"'"'"installed":true'"'"'; do + echo "[INFO] Waiting for server to be ready..." + sleep 10 + done + '; then + echo "[ERROR] Server not ready within 5 minutes." + exit 1 + fi + + + - name: Setup System dependencies for appstore + run: | + sudo apt install -y \ + python3-venv \ + python3-wheel \ + libxslt-dev \ + libxml2-dev \ + libz-dev \ + libpq-dev \ + build-essential \ + python3-dev \ + python3-setuptools \ + gettext \ + libssl-dev \ + libffi-dev \ + nodejs \ + yarn + + - name: Checkout appstore + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + with: + repository: nextcloud/appstore + path: appstore + + - name: Install Appstore + run: | + cd appstore + python3 -m venv venv + source venv/bin/activate + pip install poetry==1.8.2 + make dev-setup + python manage.py runserver & + + - name: Check for Appstore + run: | + cd appstore + status=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:8000) + if [ "$status" -eq 200 ]; then + echo "OK" + else + echo "FAILED (status: $status)" + fi + + - name: Register and publish integration_openproject apps + env: + APP_ID: integration_openproject + APP_VERSION: 2.9.2 + SIGNATURE: signature1 + run: | + cd integration_openproject + bash ./.github/scripts/self-hosted-app-store.sh + + - name: Register and publish groupfolders apps + env: + APP_ID: groupfolders + APP_VERSION: 17.0.15 + SIGNATURE: signature1 + run: | + cd integration_openproject + bash ./.github/scripts/self-hosted-app-store.sh + + - name: Configure Nextcloud for testing + run: | + # making the signature verification always pass for testing + # by making the $verified variable true in Installer.php + sed -i.bak 's/$verified = .*/$verified = true;/' /home/runner/html/nextcloud/lib/private/Installer.php || { + echo "::error::Failed to patch Installer.php with sed" + exit 1 + } + cd ~/html/nextcloud + php occ config:system:set appstoreurl --value http://localhost:8000/api/v1 + php occ config:system:set allow_local_remote_servers --value true + php occ app:install integration_openproject + php occ app:install groupfolders + + - name: Register and publish next release of the app + env: + APP_ID: integration_openproject + APP_VERSION: 2.10.0 + SIGNATURE: signature2 + run: | + cd integration_openproject + bash ./.github/scripts/self-hosted-app-store.sh + + - name: upgrade apps + run: | + cd ~/html/nextcloud + # latest data didn't get fetched properly, so we need to clear the appstore cache + echo "" > ~/html/nextcloud/data/appdata_*/appstore/apps.json + php occ app:update --allow-unstable integration_openproject + + - name: API Tests + env: + NEXTCLOUD_BASE_URL: http://localhost + run: | + cd integration_openproject + # build apps + make + # Run API tests + make api-test + # make api-test FEATURE_PATH=tests/acceptance/features/api/capabilities.feature + + # - name: Setup Debug Session + # uses: csexton/debugger-action@master + + # - name: Configure Nextcloud for testing + # run: | + # ls -l + + # cd ~/html/nextcloud + # ls -l + # php occ app:install integration_openproject \ No newline at end of file From 6175abe8be57511c98e07a7ea9330d039c006a66 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 13 May 2026 10:14:11 +0545 Subject: [PATCH 02/30] ci: use the specific branch Signed-off-by: nabim777 --- .github/workflows/appstore.yml | 15 +++++++-------- .github/workflows/ci-workflow.yml | 26 +++++++++++++------------- .github/workflows/reuse.yml | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml index d047ce126..71a850d9e 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/appstore.yml @@ -33,6 +33,8 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: path: integration_openproject + fetch-tags: true + ref: v2.9.2 - name: Setup NodeJS uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 @@ -52,8 +54,6 @@ jobs: tools: php-cs-fixer, phpunit - name: Build nextcloud project - # if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }} - # id: build_release run: | export DEBIAN_FRONTEND=noninteractive echo "###### installing nextcloud" @@ -136,8 +136,8 @@ jobs: APP_VERSION: 2.9.2 SIGNATURE: signature1 run: | - cd integration_openproject - bash ./.github/scripts/self-hosted-app-store.sh + wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh + bash ./self-hosted-app-store.sh - name: Register and publish groupfolders apps env: @@ -145,8 +145,7 @@ jobs: APP_VERSION: 17.0.15 SIGNATURE: signature1 run: | - cd integration_openproject - bash ./.github/scripts/self-hosted-app-store.sh + bash ./self-hosted-app-store.sh - name: Configure Nextcloud for testing run: | @@ -157,6 +156,7 @@ jobs: exit 1 } cd ~/html/nextcloud + php occ config:system:set ratelimit.protection.enabled --value false --type bool php occ config:system:set appstoreurl --value http://localhost:8000/api/v1 php occ config:system:set allow_local_remote_servers --value true php occ app:install integration_openproject @@ -168,8 +168,7 @@ jobs: APP_VERSION: 2.10.0 SIGNATURE: signature2 run: | - cd integration_openproject - bash ./.github/scripts/self-hosted-app-store.sh + bash ./self-hosted-app-store.sh - name: upgrade apps run: | diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 644f63ff7..600b89340 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -2,19 +2,19 @@ # SPDX-License-Identifier: AGPL-3.0-or-later name: CI -on: - push: - branches: - - 'master' - pull_request: - paths-ignore: - - '**.md' - - '**.txt' - - '**.sh' - - 'dev/**' - - 'l10n/**' - - 'img/**' - - 'docker-compose*' +# on: +# push: +# branches: +# - 'master' +# pull_request: +# paths-ignore: +# - '**.md' +# - '**.txt' +# - '**.sh' +# - 'dev/**' +# - 'l10n/**' +# - 'img/**' +# - 'docker-compose*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 949d2aa88..ee13d46a6 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -9,7 +9,7 @@ name: REUSE Compliance Check -on: [pull_request] +# on: [pull_request] permissions: contents: read From 0aea3031626e009274b0b784d248e503effa591f Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 14 May 2026 09:20:33 +0545 Subject: [PATCH 03/30] ci: enabling other apps from officail appstore Signed-off-by: nabim777 --- .github/scripts/self-hosted-app-store.sh | 18 +++--------- .github/workflows/appstore.yml | 35 ++++++++++++++++++------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/scripts/self-hosted-app-store.sh b/.github/scripts/self-hosted-app-store.sh index c5280e4d0..599a6f34c 100644 --- a/.github/scripts/self-hosted-app-store.sh +++ b/.github/scripts/self-hosted-app-store.sh @@ -58,7 +58,7 @@ publishApps() { http://localhost:8000/api/v1/apps/releases \ -H "Content-Type: application/json" \ -d "{ - \"download\":\"${DOWNLOAD_URL}\", + \"download\":\"https://github.com/nextcloud/$APP_ID/releases/download/v$APP_VERSION/$APP_ID-$APP_VERSION.tar.gz\", \"signature\": \"${SIGNATURE}\" }") if [[ ${register_app} == 200 ]]; then @@ -71,19 +71,9 @@ publishApps() { fi } -if [[ $APP_ID == "integration_openproject" ]]; then - # public certificate of the integration app for testing - CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" - DOWNLOAD_URL="https://github.com/nextcloud/$APP_ID/releases/download/v$APP_VERSION/$APP_ID-$APP_VERSION.tar.gz" -elif [[ $APP_ID == "groupfolders" ]]; then - # public certificate of the groupfolders app for testing - CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEBzCCAu8CAhBMMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTcwNDI2MTc0NDAwWhcNMjcwODAyMTc0NDAwWjAXMRUwEwYD\r\nVQQDEwxncm91cGZvbGRlcnMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC\r\nAQDa7N4NmUyKgT6Ovo5EXdXV7eBFaCRWKvgnwgpmpYCdSdPpprBaoyKka5FWi2Zo\r\nB2QCDQtmRuZ9RpiAblvLGeIYI1hNd1O6632U5wLtZFa2WsueV8lFGiXIy+r7jK8R\r\nc56tmeclKP4RImk4yydec89bB2\/MmVYaNkNqueckg239C1Nt0GfmmQaTlANvGVAe\r\ndb0+Y+\/YBSHSSE8TDf6n3kFR5RIWspbXv3mwFOaTTxtR+hi01eaPWnGnRz2w1+Wn\r\nXJQVBzLGuQI\/GdYZItbZ5PgVuHMcvIc6elJENiUzqli3y6VbA9posefkPAph75ny\r\nqa+B7RppiE+5d4er8es04azEKjlcmGi6zkosQEikeT01zIiiDjsvsW1gFd5KQ+OX\r\nfUsuL2R8ymX6btj5Ee6lAK7qfCgQfKEIjl5oz48+h46ERe\/NToZsNS\/g5sO5UfG5\r\n+URERPuMteaF6bKMZlHLEVco8RUttocfHGAHuA4PIWgR\/XKLdJ\/c1VsjsvMak90u\r\nfKR6vkGFizGKHQG+2ZXJQuBAih6lQ7Lbd\/v5NWIMiYHZG990EXc6nUmKUcepTl9P\r\n6CfFq4LyX4jEN8KkuLsXk5jMgDf5LjNNvqOXH\/dbynUrjUb+mCMLCq6lvp3SD39m\r\nw1LjNZe6TDsZmPN\/+XoeG88zvidGszy7dVbO2HDcDssnWwIDAQABMA0GCSqGSIb3\r\nDQEBCwUAA4IBAQBqTrXOxSRaqdcBPUfuwWTPs+OzJjJ77DXhQKP3zMMVAadWN1O4\r\naVQ6Q2m6+1YocW4cI1WUiV5JkIXHZk3CZc7GxMmA6E\/STpNfDG+gp1G8ZFkVa7Dr\r\nfYBIvzu1ORvGdLygaiRGDdkc0Rsm49O41T6uKvmuQfBZqosSm4+pMA7MRIyLmi4n\r\nsM5F8ksDKX9dyA3SVufPgb4Qy8Hy85ory4GaPkdDgry3nDK1AU+ZmFyRXo5GfMsG\r\nIGWvIBP52FpCyb\/papXhtLzajVgEY4o0Asv\/E7UFymnOofTrBmZA\/+z3n59\/sZUT\r\nKclsORyDjRlH1yV02PDfgk8Hw2RR5fmaoP3h\r\n-----END CERTIFICATE-----" - DOWNLOAD_URL="https://github.com/nextcloud-releases/$APP_ID/releases/download/v$APP_VERSION/groupfolders-v$APP_VERSION.tar.gz" -else - log_error "Invalid app name: $APP_ID" - log_error "Please set the APP_ID environment variable to either \"integration_openproject\" or \"groupfolders\"" - exit 1 -fi +# public certificate of the integration app for testing +CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" +SIGNATURE="signature" registerApps "$APP_ID" publishApps "$APP_ID" "$APP_VERSION" \ No newline at end of file diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml index 71a850d9e..d9e11719c 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/appstore.yml @@ -34,8 +34,15 @@ jobs: with: path: integration_openproject fetch-tags: true - ref: v2.9.2 + ref: v2.10.0 + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + with: + repository: nextcloud/activity + ref: stable29 + path: activity + - name: Setup NodeJS uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 with: @@ -139,15 +146,24 @@ jobs: wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh bash ./self-hosted-app-store.sh - - name: Register and publish groupfolders apps - env: - APP_ID: groupfolders - APP_VERSION: 17.0.15 - SIGNATURE: signature1 + # - name: Register and publish groupfolders apps + # env: + # APP_ID: groupfolders + # APP_VERSION: 17.0.15 + # SIGNATURE: signature1 + # run: | + # bash ./self-hosted-app-store.sh + + # - name: Setup Debug Session + # uses: csexton/debugger-action@master + + - name: Enable other apps from official app store run: | - bash ./self-hosted-app-store.sh + cp -R activity ~/html/nextcloud/apps + cd ~/html/nextcloud + php occ app:enable oidc user_oidc groupfolders activity - - name: Configure Nextcloud for testing + - name: Enable integration_openproject app from self-hosted app store run: | # making the signature verification always pass for testing # by making the $verified variable true in Installer.php @@ -155,12 +171,13 @@ jobs: echo "::error::Failed to patch Installer.php with sed" exit 1 } + # latest data didn't get fetched properly, so we need to clear the appstore cache + echo "" > ~/html/nextcloud/data/appdata_*/appstore/apps.json cd ~/html/nextcloud php occ config:system:set ratelimit.protection.enabled --value false --type bool php occ config:system:set appstoreurl --value http://localhost:8000/api/v1 php occ config:system:set allow_local_remote_servers --value true php occ app:install integration_openproject - php occ app:install groupfolders - name: Register and publish next release of the app env: From abf32a27c7bf9b5e04ea86344dec668e8e1d4359 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 14 May 2026 11:56:44 +0545 Subject: [PATCH 04/30] ci: add matrix Signed-off-by: nabim777 --- .github/workflows/appstore.yml | 84 +++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml index d9e11719c..9a605fb8b 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/appstore.yml @@ -9,15 +9,56 @@ name: Upgrade Testing -on: [pull_request] +on: + pull_request: + # workflow_call: + # inputs: + # nextcloud_versions: + # required: false + # type: string + # default: "31 32" + # php_versions: + # required: false + # type: string + # default: "8.2 8.3" + # previous_app_version: + # required: false + # type: string + # default: "2.9.2" + # upgrade_app_version: + # required: false + # type: string + # default: "2.10.0" jobs: - build: + create-matrix: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + - name: Create matrix + id: create-matrix + env: + NEXTCLOUD_VERSIONS: ${{ inputs.nextcloud_versions }} + PHP_VERSIONS: ${{ inputs.php_versions }} + run: | + MATRIX=$(./.github/scripts/generate-matrix.sh) + echo "matrix={\"include\": [$MATRIX]}" >> $GITHUB_OUTPUT + outputs: + matrix: ${{ steps.create-matrix.outputs.matrix }} + + upgrade-test: + name: Upgrade Testing + needs: create-matrix + if: ${{ success() }} + strategy: + matrix: ${{ fromJson(needs.create-matrix.outputs.matrix) }} runs-on: ubuntu-latest + env: DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development services: - database-mysql: image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest env: @@ -34,13 +75,13 @@ jobs: with: path: integration_openproject fetch-tags: true - ref: v2.10.0 + ref: v${{ inputs.upgrade_app_version }} - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: repository: nextcloud/activity - ref: stable29 + ref: stable${{ matrix.nextcloud_version }} path: activity - name: Setup NodeJS @@ -54,7 +95,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d with: - php-version: '8.2' + php-version: ${{ matrix.php_version }} extensions: mbstring, intl, mysql, gd ini-values: post_max_size=256M, max_execution_time=180 coverage: xdebug @@ -65,7 +106,7 @@ jobs: export DEBIAN_FRONTEND=noninteractive echo "###### installing nextcloud" mkdir ~/html - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable29 ~/html/nextcloud + git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable${{ matrix.nextcloud_version }} ~/html/nextcloud cd ~/html/nextcloud git submodule update --init mkdir -p data @@ -140,23 +181,12 @@ jobs: - name: Register and publish integration_openproject apps env: APP_ID: integration_openproject - APP_VERSION: 2.9.2 + APP_VERSION: ${{ inputs.previous_app_version }} SIGNATURE: signature1 run: | wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh bash ./self-hosted-app-store.sh - # - name: Register and publish groupfolders apps - # env: - # APP_ID: groupfolders - # APP_VERSION: 17.0.15 - # SIGNATURE: signature1 - # run: | - # bash ./self-hosted-app-store.sh - - # - name: Setup Debug Session - # uses: csexton/debugger-action@master - - name: Enable other apps from official app store run: | cp -R activity ~/html/nextcloud/apps @@ -182,7 +212,7 @@ jobs: - name: Register and publish next release of the app env: APP_ID: integration_openproject - APP_VERSION: 2.10.0 + APP_VERSION: ${{ inputs.upgrade_app_version }} SIGNATURE: signature2 run: | bash ./self-hosted-app-store.sh @@ -202,16 +232,4 @@ jobs: # build apps make # Run API tests - make api-test - # make api-test FEATURE_PATH=tests/acceptance/features/api/capabilities.feature - - # - name: Setup Debug Session - # uses: csexton/debugger-action@master - - # - name: Configure Nextcloud for testing - # run: | - # ls -l - - # cd ~/html/nextcloud - # ls -l - # php occ app:install integration_openproject \ No newline at end of file + make api-test \ No newline at end of file From 0c0d30636eae8c78cc14f45cb5fe20c1f512a55a Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 14 May 2026 12:45:47 +0545 Subject: [PATCH 05/30] ci: use env Signed-off-by: nabim777 --- .github/workflows/appstore.yml | 39 ++++++++++------------------------ 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml index 9a605fb8b..a73c2ee79 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/appstore.yml @@ -9,26 +9,7 @@ name: Upgrade Testing -on: - pull_request: - # workflow_call: - # inputs: - # nextcloud_versions: - # required: false - # type: string - # default: "31 32" - # php_versions: - # required: false - # type: string - # default: "8.2 8.3" - # previous_app_version: - # required: false - # type: string - # default: "2.9.2" - # upgrade_app_version: - # required: false - # type: string - # default: "2.10.0" +on: [pull_request] jobs: create-matrix: @@ -40,8 +21,8 @@ jobs: - name: Create matrix id: create-matrix env: - NEXTCLOUD_VERSIONS: ${{ inputs.nextcloud_versions }} - PHP_VERSIONS: ${{ inputs.php_versions }} + NEXTCLOUD_VERSIONS: "29 30" + PHP_VERSIONS: "8.2 8.3" run: | MATRIX=$(./.github/scripts/generate-matrix.sh) echo "matrix={\"include\": [$MATRIX]}" >> $GITHUB_OUTPUT @@ -58,6 +39,8 @@ jobs: env: DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development + PREVIOUS_APP_VERSION: 2.9.2 + UPGRADE_APP_VERSION: 2.10.0 services: database-mysql: image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest @@ -75,13 +58,13 @@ jobs: with: path: integration_openproject fetch-tags: true - ref: v${{ inputs.upgrade_app_version }} + ref: v${{ env.UPGRADE_APP_VERSION }} - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: repository: nextcloud/activity - ref: stable${{ matrix.nextcloud_version }} + ref: ${{ matrix.nextcloudVersion }} path: activity - name: Setup NodeJS @@ -95,7 +78,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d with: - php-version: ${{ matrix.php_version }} + php-version: ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }} extensions: mbstring, intl, mysql, gd ini-values: post_max_size=256M, max_execution_time=180 coverage: xdebug @@ -106,7 +89,7 @@ jobs: export DEBIAN_FRONTEND=noninteractive echo "###### installing nextcloud" mkdir ~/html - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable${{ matrix.nextcloud_version }} ~/html/nextcloud + git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloudVersion }} ~/html/nextcloud cd ~/html/nextcloud git submodule update --init mkdir -p data @@ -181,7 +164,7 @@ jobs: - name: Register and publish integration_openproject apps env: APP_ID: integration_openproject - APP_VERSION: ${{ inputs.previous_app_version }} + APP_VERSION: ${{ env.PREVIOUS_APP_VERSION }} SIGNATURE: signature1 run: | wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh @@ -212,7 +195,7 @@ jobs: - name: Register and publish next release of the app env: APP_ID: integration_openproject - APP_VERSION: ${{ inputs.upgrade_app_version }} + APP_VERSION: ${{ env.UPGRADE_APP_VERSION }} SIGNATURE: signature2 run: | bash ./self-hosted-app-store.sh From 94093a42165bb677aeb78cb2cc1e9d47be0e7e8e Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 14 May 2026 13:07:38 +0545 Subject: [PATCH 06/30] ci: remove some env Signed-off-by: nabim777 --- .github/scripts/self-hosted-app-store.sh | 11 +++++------ .github/workflows/appstore.yml | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/scripts/self-hosted-app-store.sh b/.github/scripts/self-hosted-app-store.sh index 599a6f34c..1f6a18474 100644 --- a/.github/scripts/self-hosted-app-store.sh +++ b/.github/scripts/self-hosted-app-store.sh @@ -22,8 +22,8 @@ log_success() { echo -e "\e[32m$1\e[0m" } -if [ -z "$APP_ID" ] || [ -z "$APP_VERSION" ]; then - log_error "One or more required environment variables are missing: APP_ID, APP_VERSION" +if [[ -z "$APP_VERSION" ]]; then + log_error "Environment variables APP_VERSION is missing." exit 1 fi @@ -35,7 +35,7 @@ registerApps() { -H "Content-Type: application/json" \ -d "{ \"certificate\": \"${CERTIFICATE}\", - \"signature\": \"${SIGNATURE}\" + \"signature\": \"signature\" }") if [[ ${register_app} == 201 ]]; then log_success "\"${app_name}\" has been registered successfully!" @@ -59,7 +59,7 @@ publishApps() { -H "Content-Type: application/json" \ -d "{ \"download\":\"https://github.com/nextcloud/$APP_ID/releases/download/v$APP_VERSION/$APP_ID-$APP_VERSION.tar.gz\", - \"signature\": \"${SIGNATURE}\" + \"signature\": \"signature\" }") if [[ ${register_app} == 200 ]]; then log_success "\"${app_name} ${app_version}\" has been updated successfully!" @@ -73,7 +73,6 @@ publishApps() { # public certificate of the integration app for testing CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" -SIGNATURE="signature" - +APP_ID="integration_openproject" registerApps "$APP_ID" publishApps "$APP_ID" "$APP_VERSION" \ No newline at end of file diff --git a/.github/workflows/appstore.yml b/.github/workflows/appstore.yml index a73c2ee79..0abc13c2d 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/appstore.yml @@ -163,9 +163,7 @@ jobs: - name: Register and publish integration_openproject apps env: - APP_ID: integration_openproject APP_VERSION: ${{ env.PREVIOUS_APP_VERSION }} - SIGNATURE: signature1 run: | wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh bash ./self-hosted-app-store.sh @@ -194,9 +192,7 @@ jobs: - name: Register and publish next release of the app env: - APP_ID: integration_openproject APP_VERSION: ${{ env.UPGRADE_APP_VERSION }} - SIGNATURE: signature2 run: | bash ./self-hosted-app-store.sh From 08aef283f218fee897a24f38562116ddbf699366 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 14 May 2026 14:10:00 +0545 Subject: [PATCH 07/30] ci: renaming the workflows Signed-off-by: nabim777 --- .github/workflows/{appstore.yml => upgrade-testing.yml} | 1 - 1 file changed, 1 deletion(-) rename .github/workflows/{appstore.yml => upgrade-testing.yml} (99%) diff --git a/.github/workflows/appstore.yml b/.github/workflows/upgrade-testing.yml similarity index 99% rename from .github/workflows/appstore.yml rename to .github/workflows/upgrade-testing.yml index 0abc13c2d..b61155199 100644 --- a/.github/workflows/appstore.yml +++ b/.github/workflows/upgrade-testing.yml @@ -93,7 +93,6 @@ jobs: cd ~/html/nextcloud git submodule update --init mkdir -p data - # chown -R www-data:www-data config data apps php occ maintenance:install \ --database mysql \ --database-name nextcloud \ From 7cde02fe2463b146db1fe836c3914b619ac5db76 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 15 May 2026 09:30:29 +0545 Subject: [PATCH 08/30] ci: review addresses Signed-off-by: nabim777 --- ...nd-publish-app-to-self-hosted-appstore.sh} | 20 +++++++--------- .github/workflows/upgrade-testing.yml | 23 +++++++------------ 2 files changed, 16 insertions(+), 27 deletions(-) rename .github/scripts/{self-hosted-app-store.sh => register-and-publish-app-to-self-hosted-appstore.sh} (87%) diff --git a/.github/scripts/self-hosted-app-store.sh b/.github/scripts/register-and-publish-app-to-self-hosted-appstore.sh similarity index 87% rename from .github/scripts/self-hosted-app-store.sh rename to .github/scripts/register-and-publish-app-to-self-hosted-appstore.sh index 1f6a18474..4edaede5c 100644 --- a/.github/scripts/self-hosted-app-store.sh +++ b/.github/scripts/register-and-publish-app-to-self-hosted-appstore.sh @@ -1,11 +1,5 @@ -# SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. -# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" -# SPDX-FileCopyrightText: 2023 Nextcloud GmbH +# SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-only -#!/usr/bin/env bash - -# This bash script is to register and publish the apps in self-hosted appstore. -# To run this script the self-hosted appstore instances must be up and running set -e @@ -27,11 +21,16 @@ if [[ -z "$APP_VERSION" ]]; then exit 1 fi +APPSTORE_BASE_URL="${APPSTORE_BASE_URL:-http://localhost:8000}" +# public certificate of the integration app for testing +CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" +APP_ID="integration_openproject" + registerApps() { app_name=$1 register_app=$(curl -s -o /dev/null -w "%{http_code}" -X POST -uadmin:admin \ - http://localhost:8000/api/v1/apps \ + ${APPSTORE_BASE_URL}/api/v1/apps \ -H "Content-Type: application/json" \ -d "{ \"certificate\": \"${CERTIFICATE}\", @@ -55,7 +54,7 @@ publishApps() { app_version=$2 register_app=$(curl -s -o /dev/null -w "%{http_code}" -X POST -uadmin:admin \ - http://localhost:8000/api/v1/apps/releases \ + ${APPSTORE_BASE_URL}/api/v1/apps/releases \ -H "Content-Type: application/json" \ -d "{ \"download\":\"https://github.com/nextcloud/$APP_ID/releases/download/v$APP_VERSION/$APP_ID-$APP_VERSION.tar.gz\", @@ -71,8 +70,5 @@ publishApps() { fi } -# public certificate of the integration app for testing -CERTIFICATE="-----BEGIN CERTIFICATE-----\r\nMIIEEjCCAvoCAhF6MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMjEwMzE4MTMwMTExWhcNMzEwNjI0MTMwMTExWjAiMSAwHgYD\r\nVQQDDBdpbnRlZ3JhdGlvbl9vcGVucHJvamVjdDCCAiIwDQYJKoZIhvcNAQEBBQAD\r\nggIPADCCAgoCggIBALn0ohZShOzR6UJAuN4IErLD5jenUWr83XnKCouC0qeXH6FI\r\nTNGTyOy\/KbDDRIoL1L20xYRl5UKwTbDye10ItUBhNcv72pJ2rDOSJrL84fqMxf00\r\nWdd\/APXJfNNqtgh1QTq9vvim9YCEu7JdeIhZK9ea89RPn47iSj7YijY78mGBfyfm\r\nqpHRYX\/QZAQcwjO2lE9soWUaZlrqu3mxTI218zmaqqcma4x3QakfsZeXZhQSU7D1\r\n6iYG8wy8IaYueJM5OoRRziBXoIfPpwYpEj4RhV1WME9jGhutyrHYg3jAdfvzsFVG\r\ngSVUP2ey1sq3HGZGbzWMBFLDGqfet0lGBIB0HTna1Zvu3ZnuK2uV3MObCmBBbBSs\r\n\/s8hyQTqWEbY2aqVoTBN5lyogwfL6pgZJFvhmtg21oHxBBqqAeQ+TZmWD62WorsX\r\n4F6Ahh1VKkmr5LkVvr2CfME0M1mj9s9gSc7ekXk1oHabH+wwgJV2ZhyezhXgWKgL\r\nUahjSRzkKqp5mbh27sg1kLCx9QNyXxaz8rnAcazGB00JzQlUmXg76cJ0v\/M3qihz\r\nQR5oju\/iMiUYKtqec9LU6wfvmGOOvtl2OFOD3ff69FPS2Km8He4pFWkSqw4DGivE\r\nIJLlgqLGIkWm+uNyocANtYqib52AYwJ\/nFMF6nzOvM1LoxHyJlFmudZRju2jAgMB\r\nAAEwDQYJKoZIhvcNAQELBQADggEBAD8mQtw0p3oh9fyOuyTmalHxoG9rLiV0Q2mz\r\n1T0jonVYN7YqSxS\/yWIQnZQ98x2nU93Be4G9VaLT0NZvRjnem2zemSVvuwp11GeK\r\ne80gJTaJjh8n1Z+gD6GU4C+LjWeiR75sd6Jcqfp3bqL6FGvSzIk3QQOfWuC03aXa\r\nFRleNH6rkMV30sWnXyocatculf7ThHZQMN1c0KuQFrd\/alQh\/+EyjBleLozkeC6G\r\n9IlE9DGRK0NUSvy7W68I7cVhR2ToE8oApdOJ1Cd6TpTYMRtvI2lQ4F7vF++ym0Lw\r\nMIxSI44hNeixh8Yn9rcy\/LqOUgl0niB5hfAiauRwHcOY5wf1hKE=\r\n-----END CERTIFICATE-----" -APP_ID="integration_openproject" registerApps "$APP_ID" publishApps "$APP_ID" "$APP_VERSION" \ No newline at end of file diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index b61155199..0b41fbcbe 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -1,11 +1,5 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. +# SPDX-License-Identifier: AGPL-3.0-or-later name: Upgrade Testing @@ -41,6 +35,7 @@ jobs: DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development PREVIOUS_APP_VERSION: 2.9.2 UPGRADE_APP_VERSION: 2.10.0 + APPSTORE_BASE_URL: http://localhost:8000 services: database-mysql: image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest @@ -81,8 +76,6 @@ jobs: php-version: ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }} extensions: mbstring, intl, mysql, gd ini-values: post_max_size=256M, max_execution_time=180 - coverage: xdebug - tools: php-cs-fixer, phpunit - name: Build nextcloud project run: | @@ -153,7 +146,7 @@ jobs: - name: Check for Appstore run: | cd appstore - status=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:8000) + status=$(curl -o /dev/null -s -w "%{http_code}" "$APPSTORE_BASE_URL") if [ "$status" -eq 200 ]; then echo "OK" else @@ -164,8 +157,8 @@ jobs: env: APP_VERSION: ${{ env.PREVIOUS_APP_VERSION }} run: | - wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh - bash ./self-hosted-app-store.sh + wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/register-and-publish-app-to-self-hosted-appstore.sh + bash ./register-and-publish-app-to-self-hosted-appstore.sh - name: Enable other apps from official app store run: | @@ -185,7 +178,7 @@ jobs: echo "" > ~/html/nextcloud/data/appdata_*/appstore/apps.json cd ~/html/nextcloud php occ config:system:set ratelimit.protection.enabled --value false --type bool - php occ config:system:set appstoreurl --value http://localhost:8000/api/v1 + php occ config:system:set appstoreurl --value "$APPSTORE_BASE_URL/api/v1" php occ config:system:set allow_local_remote_servers --value true php occ app:install integration_openproject @@ -193,7 +186,7 @@ jobs: env: APP_VERSION: ${{ env.UPGRADE_APP_VERSION }} run: | - bash ./self-hosted-app-store.sh + bash ./register-and-publish-app-to-self-hosted-appstore.sh - name: upgrade apps run: | From 42416525daa9af57e8edd26ab3519adf93f6f3c6 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 18 May 2026 09:55:27 +0545 Subject: [PATCH 09/30] ci: use appstore alternatives Signed-off-by: nabim777 --- ...ild-and-release-app-for-upgrade-testing.sh | 204 ++++++++++++++++++ ...and-publish-app-to-self-hosted-appstore.sh | 74 ------- .github/workflows/upgrade-testing.yml | 106 ++------- .../features/bootstrap/FeatureContext.php | 6 + 4 files changed, 232 insertions(+), 158 deletions(-) create mode 100644 .github/scripts/build-and-release-app-for-upgrade-testing.sh delete mode 100644 .github/scripts/register-and-publish-app-to-self-hosted-appstore.sh diff --git a/.github/scripts/build-and-release-app-for-upgrade-testing.sh b/.github/scripts/build-and-release-app-for-upgrade-testing.sh new file mode 100644 index 000000000..7dae1ba3d --- /dev/null +++ b/.github/scripts/build-and-release-app-for-upgrade-testing.sh @@ -0,0 +1,204 @@ +# SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. +# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH +# SPDX-License-Identifier: AGPL-3.0-only +#!/usr/bin/env bash + +# This bash script is to register and publish the apps in self-hosted appstore. +# To run this script the self-hosted appstore instances must be up and running + +set -e + +# helper functions +log_error() { + echo -e "\e[31m$1\e[0m" +} + +log_info() { + echo -e "\e[37m$1\e[0m" +} + +log_success() { + echo -e "\e[32m$1\e[0m" +} + +# env required +# NEXCLOUD_PATH=/home/nabin/www/stable29 # path to nextcloud +# $TAG=2.11.3 # tag that we want to publish +# WORKING_DIRECTORY=/home/nabin/www/fork-integrationOpenproject # current working directory simply done by pwd command + +if [[ -z "$TAG" ]] || [[ -z "$NEXCLOUD_PATH" ]] || [[ -z "$WORKING_DIRECTORY" ]]; then + log_error "Environment variables TAG, NEXCLOUD_PATH, or WORKING_DIRECTORY are missing." + exit 1 +fi + +if [[ ! -d "$WORKING_DIRECTORY/integration_openproject" ]]; then + log_error "integration_openproject directory does not exist." + exit 1 +fi + +# build the apps +cd $WORKING_DIRECTORY +make -C integration_openproject + +mkdir -p publish + +# remove unnecessary app files +log_info "Copying necessary app files to publish directory..." +rsync -a \ +--exclude=server \ +--exclude=dev \ +--exclude=.git \ +--exclude=appinfo/signature.json \ +--exclude='*.swp' \ +--exclude=build \ +--exclude=.gitignore \ +--exclude=.travis.yml \ +--exclude=.scrutinizer.yml \ +--exclude=CONTRIBUTING.md \ +--exclude=composer.phar \ +--exclude=js/node_modules \ +--exclude=node_modules \ +--exclude=src \ +--exclude=translationfiles \ +--exclude='webpack.*' \ +--exclude=stylelint.config.js \ +--exclude=.eslintrc.js \ +--exclude=.github \ +--exclude=.gitlab-ci.yml \ +--exclude=crowdin.yml \ +--exclude=tools \ +--exclude=.tx \ +--exclude=.l10nignore \ +--exclude=l10n/.tx \ +--exclude=l10n/l10n.pl \ +--exclude=l10n/templates \ +--exclude='l10n/*.sh' \ +--exclude='l10n/[a-z][a-z]' \ +--exclude='l10n/[a-z][a-z]_[A-Z][A-Z]' \ +--exclude=l10n/no-php \ +--exclude=makefile \ +--exclude=screenshots \ +--exclude='phpunit*xml' \ +--exclude=tests \ +--exclude=ci \ +--exclude=vendor/bin \ +integration_openproject publish/ + +cd publish + +# update version in info.xml +sed -i "s|.*|$TAG|" "integration_openproject/appinfo/info.xml" + +# https://nextcloudappstore.readthedocs.io/en/latest/developer.html#obtaining-a-certificate +log_info "Generating app.key and app.crt..." +sudo openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ + -keyout app.key \ + -out app.crt \ + -days 3650 \ + -subj "/CN=$APP_ID" \ + -addext "basicConstraints=CA:FALSE" \ + -addext "keyUsage=digitalSignature" \ + -addext "extendedKeyUsage=codeSigning" + +if [[ ! -s app.key || ! -s app.crt ]]; then + log_error "Failed to generate app signing certificate and key. app.key or app.crt not found." + exit 1 +fi + +log_info "Adding the generated certificate to nextcloud's root.crt..." +nextcloud_root_crt="${NEXCLOUD_PATH}/resources/codesigning/root.crt" +if [[ -f ${nextcloud_root_crt} ]]; then + echo "" >> ${nextcloud_root_crt} + cat app.crt >> ${nextcloud_root_crt} +else + log_error "Nextcloud's root.crt not found at ${nextcloud_root_crt}." + exit 1 +fi + +# fix permisions for signing +sudo chown $USER: app.key +sudo chown -R $USER: $APP_ID + +# Sign the app +# need full path for signing +log_info "Signing the app using occ integrity:sign-app command..." +php ${NEXCLOUD_PATH}/occ integrity:sign-app \ + --privateKey=${WORKING_DIRECTORY}/publish/app.key \ + --certificate=${WORKING_DIRECTORY}/publish/app.crt \ + --path=${WORKING_DIRECTORY}/publish/$APP_ID || { log_error "Failed to sign app."; exit 1; } + +# php /home/runner/html/nextcloud/occ integrity:sign-app \ +# --privateKey=/home/runner/work/integration_openproject/integration_openproject/publish/app.key \ +# --certificate=/home/runner/work/integration_openproject/integration_openproject/publish/app.crt \ +# --path=/home/runner/work/integration_openproject/integration_openproject/publish/integration_openproject + +# Archive the app +tar -czf $APP_ID-$TAG.tar.gz $APP_ID +if [[ ! -f $APP_ID-$TAG.tar.gz ]]; then + log_error "Failed to archive the app. Archive file $APP_ID-$TAG.tar.gz not found." + exit 1 +fi +log_success "Archived the app into $APP_ID-$TAG.tar.gz." + +# Sign the archive +sudo openssl dgst -sha512 -sign app.key $APP_ID-$TAG.tar.gz | openssl base64 | tee ${WORKING_DIRECTORY}/publish/sign.txt || { log_error "Failed to sign the archive."; exit 1; } +if [[ ! -s ${WORKING_DIRECTORY}/publish/sign.txt ]]; then + log_error "Failed to sign the archive. Signature file sign.txt is empty or not found." + exit 1 +else + log_success "Signed the app archive successfully." +fi + +log_success "App build and release process has been completed successfully." + +## copy archieve in nextcloud directory to download +cp $APP_ID-$TAG.tar.gz ${NEXCLOUD_PATH}/$APP_ID-$TAG.tar.gz +if [[ -f ${NEXCLOUD_PATH}/$APP_ID-$TAG.tar.gz ]]; then + log_success "App archive has been copied successfully." +else + log_error "Failed to copy app archive to ${NEXCLOUD_PATH}." + exit 1 +fi + +## Prepare apps.json file +if [[ ! -f ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json ]]; then + log_error "Signature file not found at ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json." + exit 1 +fi + +# Convert sign.txt content to one line by removing newlines +signature=$(tr -d '\n' < "${WORKING_DIRECTORY}/publish/sign.txt") +certificate=$(jq '.certificate' ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json) + +cat > apps.json < ~/html/nextcloud/data/appdata_*/appstore/apps.json - cd ~/html/nextcloud - php occ config:system:set ratelimit.protection.enabled --value false --type bool - php occ config:system:set appstoreurl --value "$APPSTORE_BASE_URL/api/v1" - php occ config:system:set allow_local_remote_servers --value true - php occ app:install integration_openproject - - - name: Register and publish next release of the app + - name: Build integration_openproject app for upgrade testing env: - APP_VERSION: ${{ env.UPGRADE_APP_VERSION }} + APP_ID: integration_openproject + NEXCLOUD_PATH: /home/runner/html/nextcloud + WORKING_DIRECTORY: ${{ github.workspace }} run: | - bash ./register-and-publish-app-to-self-hosted-appstore.sh + cd integration_openproject + bash .github/scripts/build-and-release-app-for-upgrade-testing.sh - - name: upgrade apps + - name: Update integration_openproject app run: | - cd ~/html/nextcloud # latest data didn't get fetched properly, so we need to clear the appstore cache echo "" > ~/html/nextcloud/data/appdata_*/appstore/apps.json + cd ~/html/nextcloud + php occ config:system:set ratelimit.protection.enabled --value false --type bool + php occ config:system:set appstoreurl --value "http://localhost" + php occ config:system:set allow_local_remote_servers --value true php occ app:update --allow-unstable integration_openproject + if php occ app:list | grep -q "integration_openproject.*$TAG"; then + echo "App updated successfully to version $TAG" + else + echo "App not updated to version $TAG" + exit 1 + fi - name: API Tests env: NEXTCLOUD_BASE_URL: http://localhost run: | cd integration_openproject - # build apps - make # Run API tests make api-test \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 1c7f59258..103708279 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -270,6 +270,12 @@ private function deleteUserDataFromDocker(string $user): void { echo "'docker' command not found. Skipping user data deletion.\n"; return; } + + // Skip if Nextcloud Docker container does not exist + exec("docker ps --format \"{{.Names}}\"", $output); + if(!in_array('nextcloud', $output)) { + return; + } $firstChar = substr($user, 0, 1); $restChars = substr($user, 1); From 63695bf515093962400bf4d80ad39192c64d6f13 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 18 May 2026 16:54:22 +0545 Subject: [PATCH 10/30] ci: enable activity apps in seperate steps Signed-off-by: nabim777 --- .github/workflows/upgrade-testing.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index af406b5db..dd040929e 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -105,10 +105,16 @@ jobs: fi - name: Enable other apps from official app store + run: | + cd ~/html/nextcloud + php occ app:enable oidc user_oidc groupfolders integration_openproject + + # activity app cannot be installed using occ command + - name: Setup and enable dependent apps run: | cp -R activity ~/html/nextcloud/apps cd ~/html/nextcloud - php occ app:enable oidc user_oidc groupfolders activity integration_openproject + php occ app:enable activity - name: Build integration_openproject app for upgrade testing env: From d14d975365de22943eeab49ab00af4215ebdbbb3 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 19 May 2026 14:41:05 +0545 Subject: [PATCH 11/30] ci: make new tag dynamic Signed-off-by: nabim777 --- ...ild-and-release-app-for-upgrade-testing.sh | 33 +++++++++++-------- .github/workflows/upgrade-testing.yml | 11 +++---- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/scripts/build-and-release-app-for-upgrade-testing.sh b/.github/scripts/build-and-release-app-for-upgrade-testing.sh index 7dae1ba3d..958348ce3 100644 --- a/.github/scripts/build-and-release-app-for-upgrade-testing.sh +++ b/.github/scripts/build-and-release-app-for-upgrade-testing.sh @@ -24,11 +24,10 @@ log_success() { # env required # NEXCLOUD_PATH=/home/nabin/www/stable29 # path to nextcloud -# $TAG=2.11.3 # tag that we want to publish # WORKING_DIRECTORY=/home/nabin/www/fork-integrationOpenproject # current working directory simply done by pwd command -if [[ -z "$TAG" ]] || [[ -z "$NEXCLOUD_PATH" ]] || [[ -z "$WORKING_DIRECTORY" ]]; then - log_error "Environment variables TAG, NEXCLOUD_PATH, or WORKING_DIRECTORY are missing." +if [[ -z "$NEXCLOUD_PATH" ]] || [[ -z "$WORKING_DIRECTORY" ]]; then + log_error "Environment variables NEXCLOUD_PATH or WORKING_DIRECTORY are missing." exit 1 fi @@ -87,8 +86,16 @@ integration_openproject publish/ cd publish +# get current version of integration_openproject and update to new version +current_version=$(php ${NEXCLOUD_PATH}/occ app:list --output=json | jq -r '.enabled.integration_openproject') || { log_error "Failed to get current version of integration_openproject app."; exit 1; } +IFS=. read -r a b c <<< "$current_version" +NEW_TAG="$((a+1)).$b.$c" + +# export NEW_TAG to be used in CI to check if the app version has been updated successfully +export NEW_TAG + # update version in info.xml -sed -i "s|.*|$TAG|" "integration_openproject/appinfo/info.xml" +sed -i "s|.*|$NEW_TAG|" "integration_openproject/appinfo/info.xml" # https://nextcloudappstore.readthedocs.io/en/latest/developer.html#obtaining-a-certificate log_info "Generating app.key and app.crt..." @@ -134,15 +141,15 @@ php ${NEXCLOUD_PATH}/occ integrity:sign-app \ # --path=/home/runner/work/integration_openproject/integration_openproject/publish/integration_openproject # Archive the app -tar -czf $APP_ID-$TAG.tar.gz $APP_ID -if [[ ! -f $APP_ID-$TAG.tar.gz ]]; then - log_error "Failed to archive the app. Archive file $APP_ID-$TAG.tar.gz not found." +tar -czf $APP_ID-$NEW_TAG.tar.gz $APP_ID +if [[ ! -f $APP_ID-$NEW_TAG.tar.gz ]]; then + log_error "Failed to archive the app. Archive file $APP_ID-$NEW_TAG.tar.gz not found." exit 1 fi -log_success "Archived the app into $APP_ID-$TAG.tar.gz." +log_success "Archived the app into $APP_ID-$NEW_TAG.tar.gz." # Sign the archive -sudo openssl dgst -sha512 -sign app.key $APP_ID-$TAG.tar.gz | openssl base64 | tee ${WORKING_DIRECTORY}/publish/sign.txt || { log_error "Failed to sign the archive."; exit 1; } +sudo openssl dgst -sha512 -sign app.key $APP_ID-$NEW_TAG.tar.gz | openssl base64 | tee ${WORKING_DIRECTORY}/publish/sign.txt || { log_error "Failed to sign the archive."; exit 1; } if [[ ! -s ${WORKING_DIRECTORY}/publish/sign.txt ]]; then log_error "Failed to sign the archive. Signature file sign.txt is empty or not found." exit 1 @@ -153,8 +160,8 @@ fi log_success "App build and release process has been completed successfully." ## copy archieve in nextcloud directory to download -cp $APP_ID-$TAG.tar.gz ${NEXCLOUD_PATH}/$APP_ID-$TAG.tar.gz -if [[ -f ${NEXCLOUD_PATH}/$APP_ID-$TAG.tar.gz ]]; then +cp $APP_ID-$NEW_TAG.tar.gz ${NEXCLOUD_PATH}/$APP_ID-$NEW_TAG.tar.gz +if [[ -f ${NEXCLOUD_PATH}/$APP_ID-$NEW_TAG.tar.gz ]]; then log_success "App archive has been copied successfully." else log_error "Failed to copy app archive to ${NEXCLOUD_PATH}." @@ -177,9 +184,9 @@ cat > apps.json < Date: Tue, 19 May 2026 15:28:17 +0545 Subject: [PATCH 12/30] ci: rename bash script file Signed-off-by: nabim777 --- ...for-upgrade-testing.sh => build-upgradable-app.sh} | 11 ++++++----- .github/workflows/upgrade-testing.yml | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) rename .github/scripts/{build-and-release-app-for-upgrade-testing.sh => build-upgradable-app.sh} (95%) diff --git a/.github/scripts/build-and-release-app-for-upgrade-testing.sh b/.github/scripts/build-upgradable-app.sh similarity index 95% rename from .github/scripts/build-and-release-app-for-upgrade-testing.sh rename to .github/scripts/build-upgradable-app.sh index 958348ce3..4b0fddf43 100644 --- a/.github/scripts/build-and-release-app-for-upgrade-testing.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -1,6 +1,4 @@ -# SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. -# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" -# SPDX-FileCopyrightText: 2023 Nextcloud GmbH +# SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-only #!/usr/bin/env bash @@ -36,13 +34,13 @@ if [[ ! -d "$WORKING_DIRECTORY/integration_openproject" ]]; then exit 1 fi -# build the apps +# build the app cd $WORKING_DIRECTORY make -C integration_openproject mkdir -p publish -# remove unnecessary app files +# copy app files to a separate folder log_info "Copying necessary app files to publish directory..." rsync -a \ --exclude=server \ @@ -97,6 +95,9 @@ export NEW_TAG # update version in info.xml sed -i "s|.*|$NEW_TAG|" "integration_openproject/appinfo/info.xml" +##################### +# Signing the app # +##################### # https://nextcloudappstore.readthedocs.io/en/latest/developer.html#obtaining-a-certificate log_info "Generating app.key and app.crt..." sudo openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index c5906a26d..ac2827c1e 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -113,14 +113,14 @@ jobs: cd ~/html/nextcloud php occ app:enable activity - - name: Build integration_openproject app for upgrade testing + - name: Build upgradable integration_openproject app env: APP_ID: integration_openproject NEXCLOUD_PATH: /home/runner/html/nextcloud WORKING_DIRECTORY: ${{ github.workspace }} run: | cd integration_openproject - source .github/scripts/build-and-release-app-for-upgrade-testing.sh + source .github/scripts/build-upgradable-app.sh - name: Update integration_openproject app run: | From a28622d4c8b5877306fad8e4d4fc3bbf029a9729 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 19 May 2026 15:51:21 +0545 Subject: [PATCH 13/30] ci: remove success as not needed Signed-off-by: nabim777 --- .github/workflows/upgrade-testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index ac2827c1e..2d09abf93 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -26,7 +26,6 @@ jobs: upgrade-test: name: Upgrade Testing needs: create-matrix - if: ${{ success() }} strategy: matrix: ${{ fromJson(needs.create-matrix.outputs.matrix) }} runs-on: ubuntu-latest From 0995e710cd1da1fcf682f757751f4e89caa1f6b6 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 19 May 2026 16:57:25 +0545 Subject: [PATCH 14/30] ci: add comment in bash script Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index 4b0fddf43..e76aace11 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -2,8 +2,15 @@ # SPDX-License-Identifier: AGPL-3.0-only #!/usr/bin/env bash -# This bash script is to register and publish the apps in self-hosted appstore. -# To run this script the self-hosted appstore instances must be up and running +# This script is used to build the integration_openproject app for upgrade testing. It performs the following steps: +# 1. Build the app. +# 2. Copy necessary app files to a separate folder named publish. +# 3. Get the current version of the app and update it to a new version by incrementing the major version number. +# 4. Sign the app using openssl and occ integrity:sign-app command. +# 5. Archive the app into a tar.gz file. +# 6. Sign the archive using openssl dgst command. +# 7. Copy the archive to the directory for download. +# Note: Before running this script, ensure that the nextcloud instance is running. set -e @@ -20,22 +27,23 @@ log_success() { echo -e "\e[32m$1\e[0m" } -# env required -# NEXCLOUD_PATH=/home/nabin/www/stable29 # path to nextcloud -# WORKING_DIRECTORY=/home/nabin/www/fork-integrationOpenproject # current working directory simply done by pwd command +# Env required +# NEXCLOUD_PATH # Path to nextcloud where occ command is available. +# WORKING_DIRECTORY # Directory or path where the integration_openproject repo is located. if [[ -z "$NEXCLOUD_PATH" ]] || [[ -z "$WORKING_DIRECTORY" ]]; then log_error "Environment variables NEXCLOUD_PATH or WORKING_DIRECTORY are missing." exit 1 fi +cd $WORKING_DIRECTORY + if [[ ! -d "$WORKING_DIRECTORY/integration_openproject" ]]; then - log_error "integration_openproject directory does not exist." + log_error "integration_openproject directory not found on path $WORKING_DIRECTORY" exit 1 fi -# build the app -cd $WORKING_DIRECTORY +# build the integration_openproject app make -C integration_openproject mkdir -p publish From ab3ee053de68fbf6c5a4e71736e9dbe30b683f01 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 19 May 2026 17:18:25 +0545 Subject: [PATCH 15/30] ci: remove npm install step Signed-off-by: nabim777 --- .github/workflows/upgrade-testing.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index 2d09abf93..11525eb8a 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -58,9 +58,6 @@ jobs: with: node-version: 20 - - name: Setup npm - run: npm i -g npm - - name: Setup PHP uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d with: From e9d18ee39f2c64b4943e41a5bcba52b6fb3b7fa1 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 20 May 2026 09:18:24 +0545 Subject: [PATCH 16/30] ci: updated the action full commit sha with latest one Signed-off-by: nabim777 --- .github/workflows/upgrade-testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index 11525eb8a..74b5ac782 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Create matrix id: create-matrix @@ -42,24 +42,24 @@ jobs: steps: - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: path: integration_openproject - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: repository: nextcloud/activity ref: ${{ matrix.nextcloudVersion }} path: activity - name: Setup NodeJS - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e with: node-version: 20 - name: Setup PHP - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d + uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc with: php-version: ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }} extensions: mbstring, intl, mysql, gd @@ -103,7 +103,7 @@ jobs: php occ app:enable oidc user_oidc groupfolders integration_openproject # activity app cannot be installed using occ command - - name: Setup and enable dependent apps + - name: Enable other apps run: | cp -R activity ~/html/nextcloud/apps cd ~/html/nextcloud From a53a0562933e6ec3ecd5ae75c54ffd952d570d96 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 22 May 2026 12:42:31 +0545 Subject: [PATCH 17/30] ci: use nextcloud as container Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 130 ++++++----------- .github/workflows/upgrade-testing.yml | 182 +++++++++++++++--------- 2 files changed, 161 insertions(+), 151 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index e76aace11..7f0326500 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -9,8 +9,11 @@ # 4. Sign the app using openssl and occ integrity:sign-app command. # 5. Archive the app into a tar.gz file. # 6. Sign the archive using openssl dgst command. -# 7. Copy the archive to the directory for download. -# Note: Before running this script, ensure that the nextcloud instance is running. +# Note: Before running this script, ensure that the nextcloud instance is running and integration_openproject apps need to be build. + +# Required environment variables: +# 1. NEXTCLOUD_PATH (Absolute path to nextcloud where occ command is available, e.g. /var/www/html/build-app-shared) +# 2. INTEGRATION_OPENPROJECT_DIR (Absolute path to the directory containing the integration_openproject repository, e.g. /home/user) set -e @@ -27,25 +30,19 @@ log_success() { echo -e "\e[32m$1\e[0m" } -# Env required -# NEXCLOUD_PATH # Path to nextcloud where occ command is available. -# WORKING_DIRECTORY # Directory or path where the integration_openproject repo is located. - -if [[ -z "$NEXCLOUD_PATH" ]] || [[ -z "$WORKING_DIRECTORY" ]]; then - log_error "Environment variables NEXCLOUD_PATH or WORKING_DIRECTORY are missing." +if [[ -z "$NEXTCLOUD_PATH" ]] || [[ -z "$INTEGRATION_OPENPROJECT_DIR" ]]; then + log_error "Environment variables NEXTCLOUD_PATH or INTEGRATION_OPENPROJECT_DIR are missing." exit 1 fi -cd $WORKING_DIRECTORY +APP_ID=integration_openproject +cd "$INTEGRATION_OPENPROJECT_DIR" -if [[ ! -d "$WORKING_DIRECTORY/integration_openproject" ]]; then - log_error "integration_openproject directory not found on path $WORKING_DIRECTORY" +if [[ ! -d "$INTEGRATION_OPENPROJECT_DIR/$APP_ID" ]]; then + log_error "$APP_ID directory not found on path $INTEGRATION_OPENPROJECT_DIR" exit 1 fi -# build the integration_openproject app -make -C integration_openproject - mkdir -p publish # copy app files to a separate folder @@ -93,12 +90,12 @@ integration_openproject publish/ cd publish # get current version of integration_openproject and update to new version -current_version=$(php ${NEXCLOUD_PATH}/occ app:list --output=json | jq -r '.enabled.integration_openproject') || { log_error "Failed to get current version of integration_openproject app."; exit 1; } +current_version=$(php ${NEXTCLOUD_PATH}/occ app:list --output=json | jq -r '.enabled.integration_openproject') || { log_error "Failed to get current version of integration_openproject app."; exit 1; } IFS=. read -r a b c <<< "$current_version" NEW_TAG="$((a+1)).$b.$c" -# export NEW_TAG to be used in CI to check if the app version has been updated successfully -export NEW_TAG +# Save the new tag to a file for later use in the workflow +echo "$NEW_TAG" > integration_openproject_new_tag.txt # update version in info.xml sed -i "s|.*|$NEW_TAG|" "integration_openproject/appinfo/info.xml" @@ -108,7 +105,7 @@ sed -i "s|.*|$NEW_TAG|" "integration_openp ##################### # https://nextcloudappstore.readthedocs.io/en/latest/developer.html#obtaining-a-certificate log_info "Generating app.key and app.crt..." -sudo openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ +openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ -keyout app.key \ -out app.crt \ -days 3650 \ @@ -123,7 +120,7 @@ if [[ ! -s app.key || ! -s app.crt ]]; then fi log_info "Adding the generated certificate to nextcloud's root.crt..." -nextcloud_root_crt="${NEXCLOUD_PATH}/resources/codesigning/root.crt" +nextcloud_root_crt="${NEXTCLOUD_PATH}/resources/codesigning/root.crt" if [[ -f ${nextcloud_root_crt} ]]; then echo "" >> ${nextcloud_root_crt} cat app.crt >> ${nextcloud_root_crt} @@ -132,22 +129,18 @@ else exit 1 fi -# fix permisions for signing -sudo chown $USER: app.key -sudo chown -R $USER: $APP_ID +# fix permissions for signing +chown www-data app.key +chown www-data app.crt +chown -R www-data integration_openproject # Sign the app # need full path for signing log_info "Signing the app using occ integrity:sign-app command..." -php ${NEXCLOUD_PATH}/occ integrity:sign-app \ - --privateKey=${WORKING_DIRECTORY}/publish/app.key \ - --certificate=${WORKING_DIRECTORY}/publish/app.crt \ - --path=${WORKING_DIRECTORY}/publish/$APP_ID || { log_error "Failed to sign app."; exit 1; } - -# php /home/runner/html/nextcloud/occ integrity:sign-app \ -# --privateKey=/home/runner/work/integration_openproject/integration_openproject/publish/app.key \ -# --certificate=/home/runner/work/integration_openproject/integration_openproject/publish/app.crt \ -# --path=/home/runner/work/integration_openproject/integration_openproject/publish/integration_openproject +php ${NEXTCLOUD_PATH}/occ integrity:sign-app \ + --privateKey=${INTEGRATION_OPENPROJECT_DIR}/publish/app.key \ + --certificate=${INTEGRATION_OPENPROJECT_DIR}/publish/app.crt \ + --path=${INTEGRATION_OPENPROJECT_DIR}/publish/$APP_ID || { log_error "Failed to sign app."; exit 1; } # Archive the app tar -czf $APP_ID-$NEW_TAG.tar.gz $APP_ID @@ -157,64 +150,29 @@ if [[ ! -f $APP_ID-$NEW_TAG.tar.gz ]]; then fi log_success "Archived the app into $APP_ID-$NEW_TAG.tar.gz." -# Sign the archive -sudo openssl dgst -sha512 -sign app.key $APP_ID-$NEW_TAG.tar.gz | openssl base64 | tee ${WORKING_DIRECTORY}/publish/sign.txt || { log_error "Failed to sign the archive."; exit 1; } -if [[ ! -s ${WORKING_DIRECTORY}/publish/sign.txt ]]; then - log_error "Failed to sign the archive. Signature file sign.txt is empty or not found." - exit 1 -else - log_success "Signed the app archive successfully." +##################### +# Sign the archive # +##################### +# Check if openssl exists, otherwise install it +if ! command -v openssl >/dev/null 2>&1; then + echo "OpenSSL not found. Installing..." + apt update && apt install -y openssl || { + echo "Failed to install OpenSSL." + exit 1 + } fi -log_success "App build and release process has been completed successfully." +# Sign the archive using openssl dgst command +log_info "Signing the archive using openssl dgst command..." +openssl dgst -sha512 -sign app.key $APP_ID-$NEW_TAG.tar.gz \ + | openssl base64 \ + | tee ${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt -## copy archieve in nextcloud directory to download -cp $APP_ID-$NEW_TAG.tar.gz ${NEXCLOUD_PATH}/$APP_ID-$NEW_TAG.tar.gz -if [[ -f ${NEXCLOUD_PATH}/$APP_ID-$NEW_TAG.tar.gz ]]; then - log_success "App archive has been copied successfully." -else - log_error "Failed to copy app archive to ${NEXCLOUD_PATH}." - exit 1 -fi - -## Prepare apps.json file -if [[ ! -f ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json ]]; then - log_error "Signature file not found at ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json." +if [[ ! -s ${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt ]]; then + log_error "Failed to sign the archive. Signature file sign.txt is empty or not found." exit 1 +else + log_success "Signed the app archive successfully." fi -# Convert sign.txt content to one line by removing newlines -signature=$(tr -d '\n' < "${WORKING_DIRECTORY}/publish/sign.txt") -certificate=$(jq '.certificate' ${WORKING_DIRECTORY}/publish/integration_openproject/appinfo/signature.json) - -cat > apps.json <> $GITHUB_OUTPUT @@ -26,10 +29,34 @@ jobs: upgrade-test: name: Upgrade Testing needs: create-matrix + runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.create-matrix.outputs.matrix) }} - runs-on: ubuntu-latest + services: + nextcloud: + image: ghcr.io/juliusknorr/nextcloud-dev-php${{ format('{0}{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }}:master + env: + SQL: ${{ matrix.database }} + SERVER_BRANCH: ${{ matrix.nextcloudVersion }} + NEXTCLOUD_AUTOINSTALL: "Yes" + NEXTCLOUD_AUTOINSTALL_APPS: oidc groupfolders user_oidc integration_openproject + NEXTCLOUD_AUTOINSTALL_APPS_WAIT_TIME: 60 + WITH_REDIS: "YES" + ports: + - 80:80 + options: --name=nextcloud + volumes: + - ${{ github.workspace }}/extra-apps:/var/www/html/apps-shared + - ${{ github.workspace }}/build-app:/var/www/html/build-app-shared + + database-pgsql: + image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest + env: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + POSTGRES_DB: nextcloud + database-mysql: image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest env: @@ -37,54 +64,24 @@ jobs: MYSQL_PASSWORD: 'nextcloud' MYSQL_USER: 'nextcloud' MYSQL_DATABASE: 'nextcloud' - ports: - - 3306:3306 + + redis: + image: ghcr.io/nextcloud/continuous-integration-redis:latest + options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: path: integration_openproject - - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - with: - repository: nextcloud/activity - ref: ${{ matrix.nextcloudVersion }} - path: activity - - - name: Setup NodeJS - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e - with: - node-version: 20 - - - name: Setup PHP - uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc + + - name: Setup PHP ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }} + uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d with: php-version: ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }} - extensions: mbstring, intl, mysql, gd - ini-values: post_max_size=256M, max_execution_time=180 - - - name: Build nextcloud project - run: | - export DEBIAN_FRONTEND=noninteractive - echo "###### installing nextcloud" - mkdir ~/html - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloudVersion }} ~/html/nextcloud - cd ~/html/nextcloud - git submodule update --init - mkdir -p data - php occ maintenance:install \ - --database mysql \ - --database-name nextcloud \ - --database-host 127.0.0.1 \ - --database-user nextcloud \ - --database-pass nextcloud \ - --admin-user admin \ - --admin-pass admin - php occ maintenance:mode --off - sudo php -S localhost:80 -t ~/html/nextcloud & - + tools: composer, phpunit + extensions: intl, gd, sqlite3 + - name: Wait for Nextcloud server to be ready run: | if ! timeout 5m bash -c ' @@ -97,37 +94,93 @@ jobs: exit 1 fi - - name: Enable other apps from official app store - run: | - cd ~/html/nextcloud - php occ app:enable oidc user_oidc groupfolders integration_openproject - # activity app cannot be installed using occ command - - name: Enable other apps + - name: Setup activity app run: | - cp -R activity ~/html/nextcloud/apps - cd ~/html/nextcloud - php occ app:enable activity + # fix permissions for folder extra-apps + sudo chown $USER:$USER extra-apps + cd extra-apps + git clone https://github.com/nextcloud/activity.git --depth 1 --branch ${{ matrix.nextcloudVersion }} + # Enable activity apps + if [ "${{matrix.nextcloudVersion}}" == "master" ]; then + # enable app even if it is not compatible with the master branch + docker exec nextcloud /bin/bash -c 'occ a:e -f activity' + else + docker exec nextcloud /bin/bash -c 'occ a:e activity' + fi - name: Build upgradable integration_openproject app + run: | + make -C integration_openproject + # fix permissions for build-app folder + sudo chown -R $USER:$USER build-app + cp -R integration_openproject build-app + # run the build script inside the nextcloud container + docker exec nextcloud /bin/bash -c "\ + cd build-app-shared && \ + INTEGRATION_OPENPROJECT_DIR=/var/www/html/build-app-shared \ + NEXTCLOUD_PATH=/var/www/html \ + source integration_openproject/.github/scripts/build-upgradable-app.sh" + cd build-app/publish + echo "NEW_TAG=$(cat integration_openproject_new_tag.txt)" >> $GITHUB_ENV + + - name: Prepare apps.json file + working-directory: build-app env: APP_ID: integration_openproject - NEXCLOUD_PATH: /home/runner/html/nextcloud - WORKING_DIRECTORY: ${{ github.workspace }} run: | - cd integration_openproject - source .github/scripts/build-upgradable-app.sh + if [[ ! -f publish/${APP_ID}/appinfo/signature.json ]]; then + echo "Signature file not found at publish/${APP_ID}/appinfo/signature.json." + exit 1 + fi + certificate=$(jq '.certificate' "publish/${APP_ID}/appinfo/signature.json") + signature=$(tr -d '\n' < "publish/sign.txt") + + # Create apps.json with the required structure + cat > apps.json < ~/html/nextcloud/data/appdata_*/appstore/apps.json - cd ~/html/nextcloud - php occ config:system:set ratelimit.protection.enabled --value false --type bool - php occ config:system:set appstoreurl --value "http://localhost" - php occ config:system:set allow_local_remote_servers --value true - php occ app:update --allow-unstable integration_openproject - if php occ app:list | grep -q "integration_openproject.*$NEW_TAG"; then + # Start PHP server in Nextcloud container to serve files from publish directory + docker exec nextcloud /bin/bash -c "cd build-app-shared && php -S localhost:8080 -t publish &" + + # Clear appstore cache (force fresh fetch) + docker exec nextcloud /bin/bash -c "echo '' > /var/www/html/data/appdata_*/appstore/apps.json" + + # Disable share rate limit protection + docker exec nextcloud /bin/bash -c "php occ config:system:set ratelimit.protection.enabled --value false --type bool" + + # Configure Nextcloud to allow updates from our custom server and update the app + docker exec nextcloud /bin/bash -c "php occ config:system:set appstoreurl --value 'http://localhost:8080'" + docker exec nextcloud /bin/bash -c "php occ config:system:set allow_local_remote_servers --value true" + + # Update app + docker exec nextcloud /bin/bash -c "php occ app:update --allow-unstable integration_openproject" + + # Verify update + if docker exec nextcloud /bin/bash -c "php occ app:list | grep -q 'integration_openproject.*$NEW_TAG'"; then echo "App updated successfully to version $NEW_TAG" else echo "App not updated to version $NEW_TAG" @@ -135,9 +188,8 @@ jobs: fi - name: API Tests + working-directory: integration_openproject env: NEXTCLOUD_BASE_URL: http://localhost run: | - cd integration_openproject - # Run API tests make api-test \ No newline at end of file From 031c7679c57c859dfd5b5b8db3a41ebbebbdd1d0 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 25 May 2026 12:19:45 +0545 Subject: [PATCH 18/30] ci: rename workflow name Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 11 ++++---- .../{upgrade-testing.yml => app-upgrade.yml} | 12 ++------- .github/workflows/ci-workflow.yml | 26 +++++++++---------- .github/workflows/reuse.yml | 2 +- .../features/bootstrap/FeatureContext.php | 2 +- 5 files changed, 22 insertions(+), 31 deletions(-) rename .github/workflows/{upgrade-testing.yml => app-upgrade.yml} (95%) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index 7f0326500..b32befc94 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -3,12 +3,11 @@ #!/usr/bin/env bash # This script is used to build the integration_openproject app for upgrade testing. It performs the following steps: -# 1. Build the app. -# 2. Copy necessary app files to a separate folder named publish. -# 3. Get the current version of the app and update it to a new version by incrementing the major version number. -# 4. Sign the app using openssl and occ integrity:sign-app command. -# 5. Archive the app into a tar.gz file. -# 6. Sign the archive using openssl dgst command. +# 1. Copy the build files to a separate folder named publish, excluding unnecessary files and directories. +# 2. Get the current version of the app and update it to a new version by incrementing the major version number. +# 3. Sign the app using openssl and occ integrity:sign-app command. +# 4. Archive the app into a tar.gz file. +# 5. Sign the archive using openssl dgst command. # Note: Before running this script, ensure that the nextcloud instance is running and integration_openproject apps need to be build. # Required environment variables: diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/app-upgrade.yml similarity index 95% rename from .github/workflows/upgrade-testing.yml rename to .github/workflows/app-upgrade.yml index 0511d7ee4..dd86343d1 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/app-upgrade.yml @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-or-later -name: Upgrade Testing +name: App Upgrade on: [pull_request] @@ -16,10 +16,9 @@ jobs: id: create-matrix env: NEXTCLOUD_VERSIONS: "31 32" - PHP_VERSIONS: "8.2 8.3" + PHP_VERSIONS: "8.3" DEFAULT_PHP_VERSION: "8.3" DEFAULT_DATABASE: "mysql" - EXTRA_DATABASES: "pgsql" run: | MATRIX=$(./.github/scripts/generate-matrix.sh) echo "matrix={\"include\": [$MATRIX]}" >> $GITHUB_OUTPUT @@ -50,13 +49,6 @@ jobs: - ${{ github.workspace }}/extra-apps:/var/www/html/apps-shared - ${{ github.workspace }}/build-app:/var/www/html/build-app-shared - database-pgsql: - image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: nextcloud - database-mysql: image: ghcr.io/nextcloud/continuous-integration-mariadb-10.5:latest env: diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 600b89340..644f63ff7 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -2,19 +2,19 @@ # SPDX-License-Identifier: AGPL-3.0-or-later name: CI -# on: -# push: -# branches: -# - 'master' -# pull_request: -# paths-ignore: -# - '**.md' -# - '**.txt' -# - '**.sh' -# - 'dev/**' -# - 'l10n/**' -# - 'img/**' -# - 'docker-compose*' +on: + push: + branches: + - 'master' + pull_request: + paths-ignore: + - '**.md' + - '**.txt' + - '**.sh' + - 'dev/**' + - 'l10n/**' + - 'img/**' + - 'docker-compose*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index ee13d46a6..949d2aa88 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -9,7 +9,7 @@ name: REUSE Compliance Check -# on: [pull_request] +on: [pull_request] permissions: contents: read diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 103708279..cbd3ba046 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -273,7 +273,7 @@ private function deleteUserDataFromDocker(string $user): void { // Skip if Nextcloud Docker container does not exist exec("docker ps --format \"{{.Names}}\"", $output); - if(!in_array('nextcloud', $output)) { + if (!in_array('nextcloud', $output)) { return; } From 86edbfdd34de7a7020110f4e38bb64d692ff5c0d Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 25 May 2026 13:09:48 +0545 Subject: [PATCH 19/30] ci: shifting apps.json prepare in script file Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 76 +++++++++++++++++-------- .github/workflows/app-upgrade.yml | 51 +++-------------- 2 files changed, 60 insertions(+), 67 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index b32befc94..976aac661 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -38,7 +38,7 @@ APP_ID=integration_openproject cd "$INTEGRATION_OPENPROJECT_DIR" if [[ ! -d "$INTEGRATION_OPENPROJECT_DIR/$APP_ID" ]]; then - log_error "$APP_ID directory not found on path $INTEGRATION_OPENPROJECT_DIR" + log_error "Folder does not exist: $INTEGRATION_OPENPROJECT_DIR/$APP_ID" exit 1 fi @@ -84,25 +84,33 @@ rsync -a \ --exclude=tests \ --exclude=ci \ --exclude=vendor/bin \ -integration_openproject publish/ +$APP_ID publish/ cd publish # get current version of integration_openproject and update to new version -current_version=$(php ${NEXTCLOUD_PATH}/occ app:list --output=json | jq -r '.enabled.integration_openproject') || { log_error "Failed to get current version of integration_openproject app."; exit 1; } +current_version=$(php ${NEXTCLOUD_PATH}/occ app:list --output=json | jq -r ".enabled.$APP_ID") || { log_error "Failed to get current version of $APP_ID app."; exit 1; } IFS=. read -r a b c <<< "$current_version" -NEW_TAG="$((a+1)).$b.$c" +NEXT_APP_VERSION="$((a+1)).$b.$c" # Save the new tag to a file for later use in the workflow -echo "$NEW_TAG" > integration_openproject_new_tag.txt +echo "$NEXT_APP_VERSION" > "${APP_ID}_new_version.txt" # update version in info.xml -sed -i "s|.*|$NEW_TAG|" "integration_openproject/appinfo/info.xml" +sed -i "s|.*|$NEXT_APP_VERSION|" "integration_openproject/appinfo/info.xml" ##################### # Signing the app # ##################### # https://nextcloudappstore.readthedocs.io/en/latest/developer.html#obtaining-a-certificate +# Check if openssl exists, otherwise install it +if ! command -v openssl >/dev/null 2>&1; then + echo "OpenSSL not found. Installing..." + apt update && apt install -y openssl || { + echo "Failed to install OpenSSL." + exit 1 + } +fi log_info "Generating app.key and app.crt..." openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ -keyout app.key \ @@ -131,7 +139,7 @@ fi # fix permissions for signing chown www-data app.key chown www-data app.crt -chown -R www-data integration_openproject +chown -R www-data $APP_ID # Sign the app # need full path for signing @@ -142,28 +150,18 @@ php ${NEXTCLOUD_PATH}/occ integrity:sign-app \ --path=${INTEGRATION_OPENPROJECT_DIR}/publish/$APP_ID || { log_error "Failed to sign app."; exit 1; } # Archive the app -tar -czf $APP_ID-$NEW_TAG.tar.gz $APP_ID -if [[ ! -f $APP_ID-$NEW_TAG.tar.gz ]]; then - log_error "Failed to archive the app. Archive file $APP_ID-$NEW_TAG.tar.gz not found." +tar -czf $APP_ID-$NEXT_APP_VERSION.tar.gz $APP_ID +if [[ ! -f $APP_ID-$NEXT_APP_VERSION.tar.gz ]]; then + log_error "Failed to archive the app. Archive file $APP_ID-$NEXT_APP_VERSION.tar.gz not found." exit 1 fi -log_success "Archived the app into $APP_ID-$NEW_TAG.tar.gz." +log_success "Archived the app into $APP_ID-$NEXT_APP_VERSION.tar.gz." ##################### # Sign the archive # ##################### -# Check if openssl exists, otherwise install it -if ! command -v openssl >/dev/null 2>&1; then - echo "OpenSSL not found. Installing..." - apt update && apt install -y openssl || { - echo "Failed to install OpenSSL." - exit 1 - } -fi - -# Sign the archive using openssl dgst command log_info "Signing the archive using openssl dgst command..." -openssl dgst -sha512 -sign app.key $APP_ID-$NEW_TAG.tar.gz \ +openssl dgst -sha512 -sign app.key $APP_ID-$NEXT_APP_VERSION.tar.gz \ | openssl base64 \ | tee ${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt @@ -174,4 +172,36 @@ else log_success "Signed the app archive successfully." fi -log_success "App build and release process has been completed successfully." \ No newline at end of file +log_success "App build and release process has been completed successfully." + +# prepare apps.json file +if [[ ! -f ${INTEGRATION_OPENPROJECT_DIR}/publish/${APP_ID}/appinfo/signature.json ]]; then + echo "Signature file not found at ${INTEGRATION_OPENPROJECT_DIR}/publish/${APP_ID}/appinfo/signature.json." + exit 1 +fi +certificate=$(jq '.certificate' "${INTEGRATION_OPENPROJECT_DIR}/publish/${APP_ID}/appinfo/signature.json") +signature=$(tr -d '\n' < "${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt") + +# Create apps.json with the required structure +cat > apps.json <> $GITHUB_ENV - - - name: Prepare apps.json file - working-directory: build-app - env: - APP_ID: integration_openproject - run: | - if [[ ! -f publish/${APP_ID}/appinfo/signature.json ]]; then - echo "Signature file not found at publish/${APP_ID}/appinfo/signature.json." - exit 1 - fi - certificate=$(jq '.certificate' "publish/${APP_ID}/appinfo/signature.json") - signature=$(tr -d '\n' < "publish/sign.txt") - - # Create apps.json with the required structure - cat > apps.json <> $GITHUB_ENV - name: Update integration_openproject app run: | - # Start PHP server in Nextcloud container to serve files from publish directory + # Start local appstore server docker exec nextcloud /bin/bash -c "cd build-app-shared && php -S localhost:8080 -t publish &" - # Clear appstore cache (force fresh fetch) + # Clear appstore cache (force re-fetch) docker exec nextcloud /bin/bash -c "echo '' > /var/www/html/data/appdata_*/appstore/apps.json" # Disable share rate limit protection docker exec nextcloud /bin/bash -c "php occ config:system:set ratelimit.protection.enabled --value false --type bool" - # Configure Nextcloud to allow updates from our custom server and update the app + # Configure local appstore server docker exec nextcloud /bin/bash -c "php occ config:system:set appstoreurl --value 'http://localhost:8080'" docker exec nextcloud /bin/bash -c "php occ config:system:set allow_local_remote_servers --value true" @@ -172,10 +135,10 @@ jobs: docker exec nextcloud /bin/bash -c "php occ app:update --allow-unstable integration_openproject" # Verify update - if docker exec nextcloud /bin/bash -c "php occ app:list | grep -q 'integration_openproject.*$NEW_TAG'"; then - echo "App updated successfully to version $NEW_TAG" + if docker exec nextcloud /bin/bash -c "php occ app:list | grep -q 'integration_openproject.*$NEXT_APP_VERSION'"; then + echo "App updated successfully to version $NEXT_APP_VERSION" else - echo "App not updated to version $NEW_TAG" + echo "App not updated to version $NEXT_APP_VERSION" exit 1 fi From 893f6e64ced26e6e1cdaa2d1ddc8829821183d92 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 25 May 2026 14:36:03 +0545 Subject: [PATCH 20/30] test: rename added varaible name Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 6 +++--- tests/acceptance/features/bootstrap/FeatureContext.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index 976aac661..661f31e25 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -1,6 +1,6 @@ +#!/bin/bash # SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. -# SPDX-License-Identifier: AGPL-3.0-only -#!/usr/bin/env bash +# SPDX-License-Identifier: AGPL-3.0-or-later # This script is used to build the integration_openproject app for upgrade testing. It performs the following steps: # 1. Copy the build files to a separate folder named publish, excluding unnecessary files and directories. @@ -196,7 +196,7 @@ cat > apps.json < Date: Tue, 26 May 2026 09:29:33 +0545 Subject: [PATCH 21/30] ci: add for checking the local appstore server Signed-off-by: nabim777 --- .github/workflows/app-upgrade.yml | 12 ++++++++++++ .../acceptance/features/bootstrap/FeatureContext.php | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/app-upgrade.yml b/.github/workflows/app-upgrade.yml index 6e74d9832..cc977e973 100644 --- a/.github/workflows/app-upgrade.yml +++ b/.github/workflows/app-upgrade.yml @@ -121,6 +121,18 @@ jobs: # Start local appstore server docker exec nextcloud /bin/bash -c "cd build-app-shared && php -S localhost:8080 -t publish &" + # Wait for local appstore server to be ready + docker exec nextcloud /bin/bash -c ' + for i in $(seq 1 5); do + if curl -fsS http://localhost:8080/ > /dev/null; then + exit 0 + fi + sleep 2 + done + echo "Local appstore server did not become ready on localhost:8080" + exit 1 + ' + # Clear appstore cache (force re-fetch) docker exec nextcloud /bin/bash -c "echo '' > /var/www/html/data/appdata_*/appstore/apps.json" diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 5d15b1809..e4c85e7a8 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -270,7 +270,6 @@ private function deleteUserDataFromDocker(string $user): void { echo "'docker' command not found. Skipping user data deletion.\n"; return; } - // Skip if Nextcloud Docker container does not exist exec("docker ps --format \"{{.Names}}\"", $containers); if (!in_array('nextcloud', $containers)) { From 20b16257eb5b36fe334da305b03c0b8515ea3669 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 26 May 2026 09:45:11 +0545 Subject: [PATCH 22/30] ci: make the shell scripts fails inside pipelines Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 2 +- .github/workflows/app-upgrade.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index 661f31e25..d3fe9cc9f 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -14,7 +14,7 @@ # 1. NEXTCLOUD_PATH (Absolute path to nextcloud where occ command is available, e.g. /var/www/html/build-app-shared) # 2. INTEGRATION_OPENPROJECT_DIR (Absolute path to the directory containing the integration_openproject repository, e.g. /home/user) -set -e +set -e -o pipefail # helper functions log_error() { diff --git a/.github/workflows/app-upgrade.yml b/.github/workflows/app-upgrade.yml index cc977e973..785f43110 100644 --- a/.github/workflows/app-upgrade.yml +++ b/.github/workflows/app-upgrade.yml @@ -124,7 +124,7 @@ jobs: # Wait for local appstore server to be ready docker exec nextcloud /bin/bash -c ' for i in $(seq 1 5); do - if curl -fsS http://localhost:8080/ > /dev/null; then + if curl -sS http://localhost:8080 > /dev/null; then exit 0 fi sleep 2 From eaa305e321e1a80d9126774a0a61b24b184b940b Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 27 May 2026 09:54:49 +0545 Subject: [PATCH 23/30] ci: improve comments and log message Signed-off-by: nabim777 --- .github/scripts/build-upgradable-app.sh | 34 ++++++++++++------------- .github/workflows/app-upgrade.yml | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/scripts/build-upgradable-app.sh b/.github/scripts/build-upgradable-app.sh index d3fe9cc9f..4735b7f17 100644 --- a/.github/scripts/build-upgradable-app.sh +++ b/.github/scripts/build-upgradable-app.sh @@ -2,17 +2,17 @@ # SPDX-FileCopyrightText: 2026 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-or-later -# This script is used to build the integration_openproject app for upgrade testing. It performs the following steps: +# This script is used to build the upgradable integration_openproject app. It performs the following steps: # 1. Copy the build files to a separate folder named publish, excluding unnecessary files and directories. # 2. Get the current version of the app and update it to a new version by incrementing the major version number. -# 3. Sign the app using openssl and occ integrity:sign-app command. -# 4. Archive the app into a tar.gz file. -# 5. Sign the archive using openssl dgst command. -# Note: Before running this script, ensure that the nextcloud instance is running and integration_openproject apps need to be build. +# 3. Sign the app files using self-signed certificate. +# 4. Archive the app into a .tar.gz file. +# 5. Sign the archive. +# NOTE: Before running this script, ensure that the Nextcloud instance is running and integration_openproject app is built. # Required environment variables: -# 1. NEXTCLOUD_PATH (Absolute path to nextcloud where occ command is available, e.g. /var/www/html/build-app-shared) -# 2. INTEGRATION_OPENPROJECT_DIR (Absolute path to the directory containing the integration_openproject repository, e.g. /home/user) +# 1. NEXTCLOUD_PATH (Absolute path to Nextcloud where occ command is available, e.g. /var/www/html) +# 2. INTEGRATION_OPENPROJECT_DIR (Absolute path to the directory containing the integration_openproject repository, e.g. /var/www/html/build-app-shared) set -e -o pipefail @@ -30,7 +30,7 @@ log_success() { } if [[ -z "$NEXTCLOUD_PATH" ]] || [[ -z "$INTEGRATION_OPENPROJECT_DIR" ]]; then - log_error "Environment variables NEXTCLOUD_PATH or INTEGRATION_OPENPROJECT_DIR are missing." + log_error "Missing required environment variables: NEXTCLOUD_PATH, INTEGRATION_OPENPROJECT_DIR" exit 1 fi @@ -122,11 +122,11 @@ openssl req -x509 -newkey rsa:4096 -sha256 -nodes \ -addext "extendedKeyUsage=codeSigning" if [[ ! -s app.key || ! -s app.crt ]]; then - log_error "Failed to generate app signing certificate and key. app.key or app.crt not found." + log_error "Failed to generate app signing certificate and key: app.key or app.crt not found." exit 1 fi -log_info "Adding the generated certificate to nextcloud's root.crt..." +log_info "Adding the generated certificate to Nextcloud's root.crt..." nextcloud_root_crt="${NEXTCLOUD_PATH}/resources/codesigning/root.crt" if [[ -f ${nextcloud_root_crt} ]]; then echo "" >> ${nextcloud_root_crt} @@ -143,7 +143,7 @@ chown -R www-data $APP_ID # Sign the app # need full path for signing -log_info "Signing the app using occ integrity:sign-app command..." +log_info "Signing the app files..." php ${NEXTCLOUD_PATH}/occ integrity:sign-app \ --privateKey=${INTEGRATION_OPENPROJECT_DIR}/publish/app.key \ --certificate=${INTEGRATION_OPENPROJECT_DIR}/publish/app.crt \ @@ -155,24 +155,24 @@ if [[ ! -f $APP_ID-$NEXT_APP_VERSION.tar.gz ]]; then log_error "Failed to archive the app. Archive file $APP_ID-$NEXT_APP_VERSION.tar.gz not found." exit 1 fi -log_success "Archived the app into $APP_ID-$NEXT_APP_VERSION.tar.gz." +log_success "App archived into $APP_ID-$NEXT_APP_VERSION.tar.gz." ##################### # Sign the archive # ##################### -log_info "Signing the archive using openssl dgst command..." +log_info "Signing the app archive..." openssl dgst -sha512 -sign app.key $APP_ID-$NEXT_APP_VERSION.tar.gz \ | openssl base64 \ | tee ${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt if [[ ! -s ${INTEGRATION_OPENPROJECT_DIR}/publish/sign.txt ]]; then - log_error "Failed to sign the archive. Signature file sign.txt is empty or not found." + log_error "Failed to sign the app archive. Signature file sign.txt is empty or not found." exit 1 else - log_success "Signed the app archive successfully." + log_success "App archive signed successfully." fi -log_success "App build and release process has been completed successfully." +log_success "Upgradable app built successfully." # prepare apps.json file if [[ ! -f ${INTEGRATION_OPENPROJECT_DIR}/publish/${APP_ID}/appinfo/signature.json ]]; then @@ -196,7 +196,7 @@ cat > apps.json < Date: Wed, 27 May 2026 15:46:53 +0545 Subject: [PATCH 24/30] ci: configure workflow for nightly Signed-off-by: nabim777 --- .github/workflows/app-upgrade.yml | 19 ++++++++++++++++--- .github/workflows/nighlty-ci-master.yml | 5 +++++ .../workflows/nighlty-ci-release-branch.yml | 6 +++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/app-upgrade.yml b/.github/workflows/app-upgrade.yml index 78465f476..4c36cb65e 100644 --- a/.github/workflows/app-upgrade.yml +++ b/.github/workflows/app-upgrade.yml @@ -3,7 +3,20 @@ name: App Upgrade -on: [pull_request] +on: + workflow_call: + inputs: + branch: + required: true + type: string + nextcloud_versions: + required: false + type: string + default: "31 32" + php_versions: + required: false + type: string + default: "8.3" jobs: create-matrix: @@ -15,8 +28,8 @@ jobs: - name: Create matrix id: create-matrix env: - NEXTCLOUD_VERSIONS: "31 32" - PHP_VERSIONS: "8.3" + NEXTCLOUD_VERSIONS: ${{ inputs.nextcloud_versions }} + PHP_VERSIONS: ${{ inputs.php_versions }} DEFAULT_PHP_VERSION: "8.3" DEFAULT_DATABASE: "mysql" run: | diff --git a/.github/workflows/nighlty-ci-master.yml b/.github/workflows/nighlty-ci-master.yml index b2a691155..64ec39371 100644 --- a/.github/workflows/nighlty-ci-master.yml +++ b/.github/workflows/nighlty-ci-master.yml @@ -15,3 +15,8 @@ jobs: secrets: inherit with: branch: master + + upgrade-test: + uses: ./.github/workflows/app-upgrade.yml + with: + branch: master \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 6ab3b0aaa..589ddf68d 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -15,4 +15,8 @@ jobs: secrets: inherit with: branch: release/2.11 - nextcloud_versions: "31 32" + + upgrade-test: + uses: ./.github/workflows/app-upgrade.yml + with: + branch: release/2.11 \ No newline at end of file From bca2c3cc9a59c888d25887608ad2fc2fc5695dfc Mon Sep 17 00:00:00 2001 From: nabim777 Date: Wed, 27 May 2026 15:48:24 +0545 Subject: [PATCH 25/30] ci: notify in matrix Signed-off-by: nabim777 --- .github/workflows/nighlty-ci-release-branch.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 589ddf68d..e1d86c321 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -5,9 +5,7 @@ name: Nightly CI (Release branch) # workflow can be scheduled ONLY from DEFAULT branch # > This event will only trigger a workflow run if the workflow file is on the default branch. # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule -on: - schedule: - - cron: '0 23 * * *' # run at 11 PM UTC +on: [ pull_request ] jobs: builds: From 1aa59119a8d5c0ca6716f304a54c42f9c4b4dc53 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 28 May 2026 08:48:02 +0545 Subject: [PATCH 26/30] ci: replace workflow status check approach Signed-off-by: nabim777 --- .github/scripts/notify-to-element.sh | 71 +++++++++++++------ .../workflows/nighlty-ci-release-branch.yml | 38 +++++++++- 2 files changed, 86 insertions(+), 23 deletions(-) diff --git a/.github/scripts/notify-to-element.sh b/.github/scripts/notify-to-element.sh index 25e8cc650..b5df7156b 100755 --- a/.github/scripts/notify-to-element.sh +++ b/.github/scripts/notify-to-element.sh @@ -2,6 +2,8 @@ # SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-or-later +set -e + # helper functions log_error() { echo -e "\e[31m$1\e[0m" @@ -15,32 +17,57 @@ log_success() { echo -e "\e[32m$1\e[0m" } -log_info "Fetching all workflow jobs....." - -response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ - "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID/jobs?per_page=50") +required_vars=( + ELEMENT_CHAT_URL, + ELEMENT_ROOM_ID, + NIGHTLY_CI_USER_TOKEN, + GITHUB_TOKEN, + REPO_OWNER, + REPO_NAME, + RUN_ID, + BRANCH_NAME, + WORKFLOW_STATUS, + JOB_NAME +) -log_info "Fetching jobs informations succeeded! -" -if [[ "$response" != *"jobs"* ]]; then - log_error "No jobs found in the below response!" - log_info "$response" - exit 1 -fi +for var in "${required_vars[@]}"; do + if [[ -z "${!var}" ]]; then + log_error "❌ Missing required environment variable: $var" + log_info "" + log_info "Available environment variables:" + log_info "- ELEMENT_CHAT_URL : URL of the Element chat (e.g. https://matrix.element.io)" + log_info "- ELEMENT_ROOM_ID : Matrix room ID (e.g. abcdefg:matrix.element.io)" + log_info "- NIGHTLY_CI_USER_TOKEN : Access token for sending messages (e.g. "sometoken")" + log_info "- GITHUB_TOKEN : GitHub API access token (e.g. "sometoken")" + log_info "- REPO_OWNER : Repository owner (e.g. nextcloud)" + log_info "- REPO_NAME : Repository name (e.g. server)" + log_info "- RUN_ID : GitHub Actions run ID (e.g. 26520692643)" + log_info "- BRANCH_NAME : Branch name (e.g. master)" + log_info "- WORKFLOW_STATUS : Workflow status (success/failure/cancelled)" + log_info "- JOB_NAME : Name of the job (e.g. builds)" + log_info "" + exit 1 + fi +done -jobs_informations=$(echo "$response" | jq '.jobs[:-1]') -jobs_conclusions=$(echo "$jobs_informations" | jq -r '.[].conclusion') +log_info "Sending report to the element chat...." -workflow_status="Success" -if [[ " ${jobs_conclusions[*]} " == *"failure"* ]]; then - workflow_status="Failure" -elif [[ " ${jobs_conclusions[*]} " == *"cancelled"* ]]; then - workflow_status="Cancelled" -elif [[ " ${jobs_conclusions[*]} " == *"skipped"* ]]; then - workflow_status="Skipped" +if [[ "$WORKFLOW_STATUS" == "success" ]]; then + WORKFLOW_STATUS="✅ Success" +elif [[ "$WORKFLOW_STATUS" == "failure" ]]; then + WORKFLOW_STATUS="❌ Failure" +else + WORKFLOW_STATUS="⚠️ $WORKFLOW_STATUS" fi -log_info "Sending report to the element chat...." +if [[ "$JOB_NAME" == "builds" ]]; then + NIGHTLY_NAME="NC-Nightly" +elif [[ "$JOB_NAME" == "upgrade-test" ]]; then + NIGHTLY_NAME="NC-Upgrade-Test-Nightly" +else + log_error "Unknown job name: $JOB_NAME. Expected 'builds' or 'upgrade-test'." + exit 1 +fi send_message_to_room_response=$(curl -s -XPOST "$ELEMENT_CHAT_URL/_matrix/client/r0/rooms/%21$ELEMENT_ROOM_ID/send/m.room.message?access_token=$NIGHTLY_CI_USER_TOKEN" \ -d ' @@ -48,7 +75,7 @@ send_message_to_room_response=$(curl -s -XPOST "$ELEMENT_CHAT_URL/_matrix/client "msgtype": "m.text", "body": "", "format": "org.matrix.custom.html", - "formatted_body": "NC-Nightly-'$BRANCH_NAME'

Status: '$workflow_status'" + "formatted_body": "'$NIGHTLY_NAME'-'$BRANCH_NAME' '$WORKFLOW_STATUS'" } ' ) diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index e1d86c321..39f8ae0ab 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -17,4 +17,40 @@ jobs: upgrade-test: uses: ./.github/workflows/app-upgrade.yml with: - branch: release/2.11 \ No newline at end of file + branch: release/2.11 + + # notify-nightly-report: + # needs: [builds, upgrade-test] + # if: ${{ always() }} + # runs-on: ubuntu-22.04 + # steps: + # - name: checkout + # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + # - name: Notify Element (nightly builds) + # env: + # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPO_OWNER: nextcloud + # REPO_NAME: integration_openproject + # RUN_ID: ${{ github.run_id }} + # BRANCH_NAME: ${{ inputs.branch }} + # WORKFLOW_STATUS: ${{ needs.builds.result }} + # JOB_NAME: builds + # run: ./.github/scripts/notify-to-element.sh + + # - name: Notify Element (upgrade tests) + # env: + # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPO_OWNER: nextcloud + # REPO_NAME: integration_openproject + # RUN_ID: ${{ github.run_id }} + # BRANCH_NAME: ${{ inputs.branch }} + # WORKFLOW_STATUS: ${{ needs.upgrade-test.result }} + # JOB_NAME: upgrade-test + # run: ./.github/scripts/notify-to-element.sh \ No newline at end of file From 4eb1e88a65f3a8ec23834973a6bd789a5faea8e0 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 28 May 2026 09:22:36 +0545 Subject: [PATCH 27/30] ci: check the output of needs json Signed-off-by: nabim777 --- .github/workflows/app-upgrade.yml | 12 ++-- .../workflows/nighlty-ci-release-branch.yml | 70 ++++++++++--------- .github/workflows/shared_workflow.yml | 52 +++++++------- 3 files changed, 68 insertions(+), 66 deletions(-) diff --git a/.github/workflows/app-upgrade.yml b/.github/workflows/app-upgrade.yml index 4c36cb65e..9f66a6bc2 100644 --- a/.github/workflows/app-upgrade.yml +++ b/.github/workflows/app-upgrade.yml @@ -167,9 +167,9 @@ jobs: exit 1 fi - - name: API Tests - working-directory: integration_openproject - env: - NEXTCLOUD_BASE_URL: http://localhost - run: | - make api-test \ No newline at end of file + # - name: API Tests + # working-directory: integration_openproject + # env: + # NEXTCLOUD_BASE_URL: http://localhost + # run: | + # make api-test \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 39f8ae0ab..102d48043 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -19,38 +19,40 @@ jobs: with: branch: release/2.11 - # notify-nightly-report: - # needs: [builds, upgrade-test] - # if: ${{ always() }} - # runs-on: ubuntu-22.04 - # steps: - # - name: checkout - # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - # - name: Notify Element (nightly builds) - # env: - # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPO_OWNER: nextcloud - # REPO_NAME: integration_openproject - # RUN_ID: ${{ github.run_id }} - # BRANCH_NAME: ${{ inputs.branch }} - # WORKFLOW_STATUS: ${{ needs.builds.result }} - # JOB_NAME: builds - # run: ./.github/scripts/notify-to-element.sh + notify-nightly-report: + needs: [builds, upgrade-test] + if: ${{ always() }} + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + - name: Notify Element (nightly builds) + # env: + # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPO_OWNER: nextcloud + # REPO_NAME: integration_openproject + # RUN_ID: ${{ github.run_id }} + # BRANCH_NAME: ${{ inputs.branch }} + # WORKFLOW_STATUS: ${{ needs.builds.result }} + # JOB_NAME: builds + run: | + echo '${{ toJson(needs) }}' + - # - name: Notify Element (upgrade tests) - # env: - # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPO_OWNER: nextcloud - # REPO_NAME: integration_openproject - # RUN_ID: ${{ github.run_id }} - # BRANCH_NAME: ${{ inputs.branch }} - # WORKFLOW_STATUS: ${{ needs.upgrade-test.result }} - # JOB_NAME: upgrade-test - # run: ./.github/scripts/notify-to-element.sh \ No newline at end of file + # - name: Notify Element (upgrade tests) + # env: + # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPO_OWNER: nextcloud + # REPO_NAME: integration_openproject + # RUN_ID: ${{ github.run_id }} + # BRANCH_NAME: ${{ inputs.branch }} + # WORKFLOW_STATUS: ${{ needs.upgrade-test.result }} + # JOB_NAME: upgrade-test + # run: ./.github/scripts/notify-to-element.sh \ No newline at end of file diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index c9f423fef..645aee9aa 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -323,29 +323,29 @@ jobs: exit 1 fi - - name: API Tests - env: - NEXTCLOUD_BASE_URL: http://localhost - run: make api-test - - notify-nightly-report: - needs: - - js-lint-unit - - api-phpunit-tests - if: ${{ always() && github.event_name == 'schedule' }} - runs-on: ubuntu-22.04 - steps: - - name: checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Notify nightly report to element - env: - ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO_OWNER: nextcloud - REPO_NAME: integration_openproject - RUN_ID: ${{ github.run_id }} - BRANCH_NAME: ${{ inputs.branch }} - run: ./.github/scripts/notify-to-element.sh + # - name: API Tests + # env: + # NEXTCLOUD_BASE_URL: http://localhost + # run: make api-test + + # notify-nightly-report: + # needs: + # - js-lint-unit + # - api-phpunit-tests + # if: ${{ always() && github.event_name == 'schedule' }} + # runs-on: ubuntu-22.04 + # steps: + # - name: checkout + # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + # - name: Notify nightly report to element + # env: + # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPO_OWNER: nextcloud + # REPO_NAME: integration_openproject + # RUN_ID: ${{ github.run_id }} + # BRANCH_NAME: ${{ inputs.branch }} + # run: ./.github/scripts/notify-to-element.sh From bfa80f845a653200c41bf20d007e0a807df21e7d Mon Sep 17 00:00:00 2001 From: nabim777 Date: Thu, 28 May 2026 16:08:27 +0545 Subject: [PATCH 28/30] ci: make dynamic matrix noitfy Signed-off-by: nabim777 --- .github/scripts/notify-to-element.sh | 86 +++++++++++-------- .../workflows/nighlty-ci-release-branch.yml | 37 +++----- .github/workflows/shared_workflow.yml | 24 +----- 3 files changed, 60 insertions(+), 87 deletions(-) diff --git a/.github/scripts/notify-to-element.sh b/.github/scripts/notify-to-element.sh index b5df7156b..fb7342138 100755 --- a/.github/scripts/notify-to-element.sh +++ b/.github/scripts/notify-to-element.sh @@ -18,16 +18,14 @@ log_success() { } required_vars=( - ELEMENT_CHAT_URL, - ELEMENT_ROOM_ID, - NIGHTLY_CI_USER_TOKEN, - GITHUB_TOKEN, - REPO_OWNER, - REPO_NAME, - RUN_ID, - BRANCH_NAME, - WORKFLOW_STATUS, - JOB_NAME + ELEMENT_CHAT_URL + ELEMENT_ROOM_ID + NIGHTLY_CI_USER_TOKEN + REPO_OWNER + REPO_NAME + RUN_ID + BRANCH_NAME + NEEDS_JSON ) for var in "${required_vars[@]}"; do @@ -38,46 +36,60 @@ for var in "${required_vars[@]}"; do log_info "- ELEMENT_CHAT_URL : URL of the Element chat (e.g. https://matrix.element.io)" log_info "- ELEMENT_ROOM_ID : Matrix room ID (e.g. abcdefg:matrix.element.io)" log_info "- NIGHTLY_CI_USER_TOKEN : Access token for sending messages (e.g. "sometoken")" - log_info "- GITHUB_TOKEN : GitHub API access token (e.g. "sometoken")" log_info "- REPO_OWNER : Repository owner (e.g. nextcloud)" log_info "- REPO_NAME : Repository name (e.g. server)" log_info "- RUN_ID : GitHub Actions run ID (e.g. 26520692643)" log_info "- BRANCH_NAME : Branch name (e.g. master)" - log_info "- WORKFLOW_STATUS : Workflow status (success/failure/cancelled)" - log_info "- JOB_NAME : Name of the job (e.g. builds)" + log_info "- NEEDS_JSON : JSON string containing job results" log_info "" exit 1 fi done -log_info "Sending report to the element chat...." +needs_json=$NEEDS_JSON -if [[ "$WORKFLOW_STATUS" == "success" ]]; then - WORKFLOW_STATUS="✅ Success" -elif [[ "$WORKFLOW_STATUS" == "failure" ]]; then - WORKFLOW_STATUS="❌ Failure" -else - WORKFLOW_STATUS="⚠️ $WORKFLOW_STATUS" -fi - -if [[ "$JOB_NAME" == "builds" ]]; then - NIGHTLY_NAME="NC-Nightly" -elif [[ "$JOB_NAME" == "upgrade-test" ]]; then - NIGHTLY_NAME="NC-Upgrade-Test-Nightly" -else - log_error "Unknown job name: $JOB_NAME. Expected 'builds' or 'upgrade-test'." +jobs=$(echo "$needs_json" | jq -r 'keys[]' 2>/dev/null) +if [[ -z "$jobs" ]]; then + log_error "❌ No jobs found in NEEDS_JSON. Please provide a valid JSON string with job results." exit 1 fi +for job in $jobs; do + WORKFLOW_STATUS=$(echo "$needs_json" | jq -r --arg job "$job" '.[$job].result') + + if [[ "$WORKFLOW_STATUS" == "success" ]]; then + WORKFLOW_STATUS="✅ Success" + elif [[ "$WORKFLOW_STATUS" == "failure" ]]; then + WORKFLOW_STATUS="❌ Failure" + else + WORKFLOW_STATUS="⚠️ $WORKFLOW_STATUS" + fi + + if [[ "$job" == "builds" ]]; then + NIGHTLY_NAME="NC-Nightly" + elif [[ "$job" == "upgrade-test" ]]; then + NIGHTLY_NAME="NC-Upgrade-Test-Nightly" + else + log_error "Unknown job name: $job. Expected 'builds' or 'upgrade-test'." + exit 1 + fi + + message+="$NIGHTLY_NAME-$BRANCH_NAME $WORKFLOW_STATUS
" +done + +payload=$(cat <'$NIGHTLY_NAME'-'$BRANCH_NAME' '$WORKFLOW_STATUS'" - } - ' + -d "$payload" ) if [[ "$send_message_to_room_response" != *"event_id"* ]]; then @@ -86,4 +98,4 @@ if [[ "$send_message_to_room_response" != *"event_id"* ]]; then exit 1 fi -log_success "Notification of the nightly build has been sent to Element chat (OpenProject + Nextcloud)" +log_success "Notification of the nightly build has been sent to Element chat (OpenProject + Nextcloud)" \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 102d48043..69101e163 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -28,31 +28,14 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - name: Notify Element (nightly builds) - # env: - # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPO_OWNER: nextcloud - # REPO_NAME: integration_openproject - # RUN_ID: ${{ github.run_id }} - # BRANCH_NAME: ${{ inputs.branch }} - # WORKFLOW_STATUS: ${{ needs.builds.result }} - # JOB_NAME: builds + env: + ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + REPO_OWNER: nextcloud + REPO_NAME: integration_openproject + RUN_ID: ${{ github.run_id }} + BRANCH_NAME: ${{ inputs.branch }} + NEEDS_JSON: ${{ toJson(needs) }} run: | - echo '${{ toJson(needs) }}' - - - # - name: Notify Element (upgrade tests) - # env: - # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPO_OWNER: nextcloud - # REPO_NAME: integration_openproject - # RUN_ID: ${{ github.run_id }} - # BRANCH_NAME: ${{ inputs.branch }} - # WORKFLOW_STATUS: ${{ needs.upgrade-test.result }} - # JOB_NAME: upgrade-test - # run: ./.github/scripts/notify-to-element.sh \ No newline at end of file + ./.github/scripts/notify-to-element.sh \ No newline at end of file diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index 645aee9aa..cc578c45d 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -326,26 +326,4 @@ jobs: # - name: API Tests # env: # NEXTCLOUD_BASE_URL: http://localhost - # run: make api-test - - # notify-nightly-report: - # needs: - # - js-lint-unit - # - api-phpunit-tests - # if: ${{ always() && github.event_name == 'schedule' }} - # runs-on: ubuntu-22.04 - # steps: - # - name: checkout - # uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - # - name: Notify nightly report to element - # env: - # ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - # ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - # NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPO_OWNER: nextcloud - # REPO_NAME: integration_openproject - # RUN_ID: ${{ github.run_id }} - # BRANCH_NAME: ${{ inputs.branch }} - # run: ./.github/scripts/notify-to-element.sh + # run: make api-test \ No newline at end of file From e2981dffcc8faf73cd28e8bdbbbc969ca23b111f Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 29 May 2026 09:20:02 +0545 Subject: [PATCH 29/30] ci: notify Signed-off-by: nabim777 --- .github/scripts/notify-to-element.sh | 40 +++++++------------ .github/workflows/app-upgrade.yml | 12 +++--- .github/workflows/nighlty-ci-master.yml | 25 +++++++++++- .../workflows/nighlty-ci-release-branch.yml | 11 ++--- .github/workflows/shared_workflow.yml | 8 ++-- 5 files changed, 53 insertions(+), 43 deletions(-) diff --git a/.github/scripts/notify-to-element.sh b/.github/scripts/notify-to-element.sh index fb7342138..1d00f7d1b 100755 --- a/.github/scripts/notify-to-element.sh +++ b/.github/scripts/notify-to-element.sh @@ -46,48 +46,36 @@ for var in "${required_vars[@]}"; do fi done -needs_json=$NEEDS_JSON - -jobs=$(echo "$needs_json" | jq -r 'keys[]' 2>/dev/null) +jobs=$(echo "$NEEDS_JSON" | jq -r 'keys[]' 2>/dev/null) if [[ -z "$jobs" ]]; then - log_error "❌ No jobs found in NEEDS_JSON. Please provide a valid JSON string with job results." + log_error "❌ No jobs found in below JSON:" + log_info "$NEEDS_JSON" exit 1 fi -for job in $jobs; do - WORKFLOW_STATUS=$(echo "$needs_json" | jq -r --arg job "$job" '.[$job].result') - - if [[ "$WORKFLOW_STATUS" == "success" ]]; then - WORKFLOW_STATUS="✅ Success" - elif [[ "$WORKFLOW_STATUS" == "failure" ]]; then - WORKFLOW_STATUS="❌ Failure" - else - WORKFLOW_STATUS="⚠️ $WORKFLOW_STATUS" - fi +results=$(echo "$NEEDS_JSON" | jq -r '.[].result' 2>/dev/null) - if [[ "$job" == "builds" ]]; then - NIGHTLY_NAME="NC-Nightly" - elif [[ "$job" == "upgrade-test" ]]; then - NIGHTLY_NAME="NC-Upgrade-Test-Nightly" - else - log_error "Unknown job name: $job. Expected 'builds' or 'upgrade-test'." - exit 1 - fi +workflow_status="✅ Success" +if [[ "${results[*]}" == *"failure"* ]]; then + workflow_status="❌ Failure" +elif [[ "${results[*]}" == *"cancelled"* ]]; then + workflow_status="⚠️ Cancelled" +elif [[ "${results[*]}" == *"skipped"* ]]; then + workflow_status="⚠️ Skipped" +fi - message+="$NIGHTLY_NAME-$BRANCH_NAME $WORKFLOW_STATUS
" -done +log_info "Sending report to the element chat...." payload=$(cat <NC-Nightly-${BRANCH_NAME}

Status: ${workflow_status}" } EOF ) -log_info "Sending report of $NIGHTLY_NAME-$BRANCH_NAME to the element chat...." send_message_to_room_response=$(curl -s -XPOST "$ELEMENT_CHAT_URL/_matrix/client/r0/rooms/%21$ELEMENT_ROOM_ID/send/m.room.message?access_token=$NIGHTLY_CI_USER_TOKEN" \ -d "$payload" ) diff --git a/.github/workflows/app-upgrade.yml b/.github/workflows/app-upgrade.yml index 9f66a6bc2..4c36cb65e 100644 --- a/.github/workflows/app-upgrade.yml +++ b/.github/workflows/app-upgrade.yml @@ -167,9 +167,9 @@ jobs: exit 1 fi - # - name: API Tests - # working-directory: integration_openproject - # env: - # NEXTCLOUD_BASE_URL: http://localhost - # run: | - # make api-test \ No newline at end of file + - name: API Tests + working-directory: integration_openproject + env: + NEXTCLOUD_BASE_URL: http://localhost + run: | + make api-test \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-master.yml b/.github/workflows/nighlty-ci-master.yml index 64ec39371..181e2e512 100644 --- a/.github/workflows/nighlty-ci-master.yml +++ b/.github/workflows/nighlty-ci-master.yml @@ -16,7 +16,28 @@ jobs: with: branch: master - upgrade-test: + app-upgrade-test: uses: ./.github/workflows/app-upgrade.yml with: - branch: master \ No newline at end of file + branch: master + + notify-nightly-report: + needs: [builds, app-upgrade-test] + if: ${{ always() }} + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + - name: Notify Element (nightly builds) + env: + ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + REPO_OWNER: nextcloud + REPO_NAME: integration_openproject + RUN_ID: ${{ github.run_id }} + BRANCH_NAME: master + NEEDS_JSON: ${{ toJson(needs) }} + run: | + ./.github/scripts/notify-to-element.sh \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 69101e163..8820638e2 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -5,7 +5,9 @@ name: Nightly CI (Release branch) # workflow can be scheduled ONLY from DEFAULT branch # > This event will only trigger a workflow run if the workflow file is on the default branch. # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule -on: [ pull_request ] +on: + schedule: + - cron: '0 23 * * *' # run at 11 PM UTC jobs: builds: @@ -14,13 +16,12 @@ jobs: with: branch: release/2.11 - upgrade-test: + app-upgrade-test: uses: ./.github/workflows/app-upgrade.yml with: branch: release/2.11 - notify-nightly-report: - needs: [builds, upgrade-test] + needs: [builds, app-upgrade-test] if: ${{ always() }} runs-on: ubuntu-22.04 steps: @@ -35,7 +36,7 @@ jobs: REPO_OWNER: nextcloud REPO_NAME: integration_openproject RUN_ID: ${{ github.run_id }} - BRANCH_NAME: ${{ inputs.branch }} + BRANCH_NAME: release/2.11 NEEDS_JSON: ${{ toJson(needs) }} run: | ./.github/scripts/notify-to-element.sh \ No newline at end of file diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index cc578c45d..e593fc4d7 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -323,7 +323,7 @@ jobs: exit 1 fi - # - name: API Tests - # env: - # NEXTCLOUD_BASE_URL: http://localhost - # run: make api-test \ No newline at end of file + - name: API Tests + env: + NEXTCLOUD_BASE_URL: http://localhost + run: make api-test \ No newline at end of file From 48e0b3b4a5723c84d0ec80d52a98de162ba7ff04 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 29 May 2026 15:15:22 +0545 Subject: [PATCH 30/30] chore: revert the changes of matrix notification Signed-off-by: nabim777 --- .github/scripts/notify-to-element.sh | 79 ++++++------------- .github/workflows/nighlty-ci-master.yml | 26 ------ .../workflows/nighlty-ci-release-branch.yml | 26 +----- .github/workflows/shared_workflow.yml | 24 +++++- 4 files changed, 50 insertions(+), 105 deletions(-) diff --git a/.github/scripts/notify-to-element.sh b/.github/scripts/notify-to-element.sh index 1d00f7d1b..25e8cc650 100755 --- a/.github/scripts/notify-to-element.sh +++ b/.github/scripts/notify-to-element.sh @@ -2,8 +2,6 @@ # SPDX-FileCopyrightText: 2023-2024 Jankari Tech Pvt. Ltd. # SPDX-License-Identifier: AGPL-3.0-or-later -set -e - # helper functions log_error() { echo -e "\e[31m$1\e[0m" @@ -17,67 +15,42 @@ log_success() { echo -e "\e[32m$1\e[0m" } -required_vars=( - ELEMENT_CHAT_URL - ELEMENT_ROOM_ID - NIGHTLY_CI_USER_TOKEN - REPO_OWNER - REPO_NAME - RUN_ID - BRANCH_NAME - NEEDS_JSON -) +log_info "Fetching all workflow jobs....." -for var in "${required_vars[@]}"; do - if [[ -z "${!var}" ]]; then - log_error "❌ Missing required environment variable: $var" - log_info "" - log_info "Available environment variables:" - log_info "- ELEMENT_CHAT_URL : URL of the Element chat (e.g. https://matrix.element.io)" - log_info "- ELEMENT_ROOM_ID : Matrix room ID (e.g. abcdefg:matrix.element.io)" - log_info "- NIGHTLY_CI_USER_TOKEN : Access token for sending messages (e.g. "sometoken")" - log_info "- REPO_OWNER : Repository owner (e.g. nextcloud)" - log_info "- REPO_NAME : Repository name (e.g. server)" - log_info "- RUN_ID : GitHub Actions run ID (e.g. 26520692643)" - log_info "- BRANCH_NAME : Branch name (e.g. master)" - log_info "- NEEDS_JSON : JSON string containing job results" - log_info "" - exit 1 - fi -done +response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID/jobs?per_page=50") -jobs=$(echo "$NEEDS_JSON" | jq -r 'keys[]' 2>/dev/null) -if [[ -z "$jobs" ]]; then - log_error "❌ No jobs found in below JSON:" - log_info "$NEEDS_JSON" +log_info "Fetching jobs informations succeeded! +" +if [[ "$response" != *"jobs"* ]]; then + log_error "No jobs found in the below response!" + log_info "$response" exit 1 fi -results=$(echo "$NEEDS_JSON" | jq -r '.[].result' 2>/dev/null) +jobs_informations=$(echo "$response" | jq '.jobs[:-1]') +jobs_conclusions=$(echo "$jobs_informations" | jq -r '.[].conclusion') -workflow_status="✅ Success" -if [[ "${results[*]}" == *"failure"* ]]; then - workflow_status="❌ Failure" -elif [[ "${results[*]}" == *"cancelled"* ]]; then - workflow_status="⚠️ Cancelled" -elif [[ "${results[*]}" == *"skipped"* ]]; then - workflow_status="⚠️ Skipped" +workflow_status="Success" +if [[ " ${jobs_conclusions[*]} " == *"failure"* ]]; then + workflow_status="Failure" +elif [[ " ${jobs_conclusions[*]} " == *"cancelled"* ]]; then + workflow_status="Cancelled" +elif [[ " ${jobs_conclusions[*]} " == *"skipped"* ]]; then + workflow_status="Skipped" fi log_info "Sending report to the element chat...." -payload=$(cat <NC-Nightly-${BRANCH_NAME}

Status: ${workflow_status}" -} -EOF -) - send_message_to_room_response=$(curl -s -XPOST "$ELEMENT_CHAT_URL/_matrix/client/r0/rooms/%21$ELEMENT_ROOM_ID/send/m.room.message?access_token=$NIGHTLY_CI_USER_TOKEN" \ - -d "$payload" + -d ' + { + "msgtype": "m.text", + "body": "", + "format": "org.matrix.custom.html", + "formatted_body": "NC-Nightly-'$BRANCH_NAME'

Status: '$workflow_status'" + } + ' ) if [[ "$send_message_to_room_response" != *"event_id"* ]]; then @@ -86,4 +59,4 @@ if [[ "$send_message_to_room_response" != *"event_id"* ]]; then exit 1 fi -log_success "Notification of the nightly build has been sent to Element chat (OpenProject + Nextcloud)" \ No newline at end of file +log_success "Notification of the nightly build has been sent to Element chat (OpenProject + Nextcloud)" diff --git a/.github/workflows/nighlty-ci-master.yml b/.github/workflows/nighlty-ci-master.yml index 181e2e512..b2a691155 100644 --- a/.github/workflows/nighlty-ci-master.yml +++ b/.github/workflows/nighlty-ci-master.yml @@ -15,29 +15,3 @@ jobs: secrets: inherit with: branch: master - - app-upgrade-test: - uses: ./.github/workflows/app-upgrade.yml - with: - branch: master - - notify-nightly-report: - needs: [builds, app-upgrade-test] - if: ${{ always() }} - runs-on: ubuntu-22.04 - steps: - - name: checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Notify Element (nightly builds) - env: - ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - REPO_OWNER: nextcloud - REPO_NAME: integration_openproject - RUN_ID: ${{ github.run_id }} - BRANCH_NAME: master - NEEDS_JSON: ${{ toJson(needs) }} - run: | - ./.github/scripts/notify-to-element.sh \ No newline at end of file diff --git a/.github/workflows/nighlty-ci-release-branch.yml b/.github/workflows/nighlty-ci-release-branch.yml index 8820638e2..6ab3b0aaa 100644 --- a/.github/workflows/nighlty-ci-release-branch.yml +++ b/.github/workflows/nighlty-ci-release-branch.yml @@ -15,28 +15,4 @@ jobs: secrets: inherit with: branch: release/2.11 - - app-upgrade-test: - uses: ./.github/workflows/app-upgrade.yml - with: - branch: release/2.11 - notify-nightly-report: - needs: [builds, app-upgrade-test] - if: ${{ always() }} - runs-on: ubuntu-22.04 - steps: - - name: checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Notify Element (nightly builds) - env: - ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} - ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} - NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} - REPO_OWNER: nextcloud - REPO_NAME: integration_openproject - RUN_ID: ${{ github.run_id }} - BRANCH_NAME: release/2.11 - NEEDS_JSON: ${{ toJson(needs) }} - run: | - ./.github/scripts/notify-to-element.sh \ No newline at end of file + nextcloud_versions: "31 32" diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index e593fc4d7..c9f423fef 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -326,4 +326,26 @@ jobs: - name: API Tests env: NEXTCLOUD_BASE_URL: http://localhost - run: make api-test \ No newline at end of file + run: make api-test + + notify-nightly-report: + needs: + - js-lint-unit + - api-phpunit-tests + if: ${{ always() && github.event_name == 'schedule' }} + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 + + - name: Notify nightly report to element + env: + ELEMENT_CHAT_URL: ${{ secrets.ELEMENT_CHAT_URL }} + ELEMENT_ROOM_ID: ${{ secrets.ELEMENT_ROOM_ID }} + NIGHTLY_CI_USER_TOKEN: ${{ secrets.NIGHTLY_CI_USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO_OWNER: nextcloud + REPO_NAME: integration_openproject + RUN_ID: ${{ github.run_id }} + BRANCH_NAME: ${{ inputs.branch }} + run: ./.github/scripts/notify-to-element.sh