From 122e17a651b9da154c8c68cf9d8abe80bb6019e6 Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Thu, 9 Jan 2025 20:28:15 +0300 Subject: [PATCH] updated CI after "branch off" Signed-off-by: Oleksander Piskun --- .github/workflows/appstore-build-publish.yml | 187 ------------------- .github/workflows/lint.yml | 2 +- .github/workflows/tests-deploy.yml | 59 +++--- .github/workflows/tests-special.yml | 6 +- .github/workflows/tests.yml | 65 +++---- 5 files changed, 53 insertions(+), 266 deletions(-) delete mode 100644 .github/workflows/appstore-build-publish.yml diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml deleted file mode 100644 index 08d44aa9..00000000 --- a/.github/workflows/appstore-build-publish.yml +++ /dev/null @@ -1,187 +0,0 @@ -# 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: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Build and publish app release - -on: - release: - types: [published] - -jobs: - build_and_publish: - runs-on: ubuntu-latest - - # Only allowed to be run on nextcloud-releases repositories - if: ${{ github.repository_owner == 'nextcloud-releases' }} - - steps: - - name: Check actor permission - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 - with: - require: write - - - name: Set app env - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - path: ${{ env.APP_NAME }} - - - name: Get app version number - id: app-version - uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - expression: "//info//version/text()" - - - name: Validate app version against tag - run: | - [ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ] - - - name: Get appinfo data - id: appinfo - uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - expression: "//info//dependencies//nextcloud/@min-version" - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - # Continue if no package.json - continue-on-error: true - with: - path: ${{ env.APP_NAME }} - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - # Skip if no package.json - if: ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - # Skip if no package.json - if: ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Get php version - id: php-versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - - - name: Set up php ${{ steps.php-versions.outputs.php-min }} - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 - with: - php-version: ${{ steps.php-versions.outputs.php-min }} - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer.json - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "${{ env.APP_NAME }}/composer.json" - - - name: Install composer dependencies - if: steps.check_composer.outputs.files_exists == 'true' - run: | - cd ${{ env.APP_NAME }} - composer install --no-dev - - - name: Build ${{ env.APP_NAME }} - # Skip if no package.json - if: ${{ steps.versions.outputs.nodeVersion }} - env: - CYPRESS_INSTALL_BINARY: 0 - run: | - cd ${{ env.APP_NAME }} - npm ci - npm run build --if-present - - - name: Check Krankerl config - id: krankerl - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: ${{ env.APP_NAME }}/krankerl.toml - - - name: Install Krankerl - if: steps.krankerl.outputs.files_exists == 'true' - run: | - wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb - sudo dpkg -i krankerl_0.14.0_amd64.deb - - - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl - if: steps.krankerl.outputs.files_exists == 'true' - run: | - cd ${{ env.APP_NAME }} - krankerl package - - - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile - if: steps.krankerl.outputs.files_exists != 'true' - run: | - cd ${{ env.APP_NAME }} - make appstore - - - name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} - continue-on-error: true - id: server-checkout - run: | - NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}' - wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip - unzip latest-$NCVERSION.zip - - - name: Checkout server master fallback - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - if: ${{ steps.server-checkout.outcome != 'success' }} - with: - submodules: true - repository: nextcloud/server - path: nextcloud - - - name: Sign app - run: | - # Extracting release - cd ${{ env.APP_NAME }}/build/artifacts - tar -xvf ${{ env.APP_NAME }}.tar.gz - cd ../../../ - # Setting up keys - echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key - wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt" - # Signing - php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }} - # Rebuilding archive - cd ${{ env.APP_NAME }}/build/artifacts - tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} - - - name: Attach tarball to github release - uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 - id: attach_to_release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz - asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz - tag: ${{ github.ref }} - overwrite: true - - - name: Upload app to Nextcloud appstore - uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1 - with: - app_name: ${{ env.APP_NAME }} - appstore_token: ${{ secrets.APPSTORE_TOKEN }} - download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} - app_private_key: ${{ secrets.APP_PRIVATE_KEY }} - diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5056fc5a..627eeee1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ name: Lint on: pull_request: push: - branches: [main] + branches: [stable31] workflow_dispatch: permissions: diff --git a/.github/workflows/tests-deploy.yml b/.github/workflows/tests-deploy.yml index 636eec79..04ebf954 100644 --- a/.github/workflows/tests-deploy.yml +++ b/.github/workflows/tests-deploy.yml @@ -4,9 +4,9 @@ name: Tests - Deploy on: pull_request: - branches: [main] + branches: [stable31] push: - branches: [main] + branches: [stable31] workflow_dispatch: permissions: @@ -19,12 +19,7 @@ concurrency: jobs: nc-host-app-docker: runs-on: ubuntu-22.04 - name: NC In Host • ${{ matrix.server-version }} • 🐘${{ matrix.php-version }} - strategy: - fail-fast: false - matrix: - php-version: [ '8.3' ] - server-version: [ 'master' ] + name: NC In Host services: postgres: @@ -46,17 +41,17 @@ jobs: with: submodules: true repository: nextcloud/server - ref: ${{ matrix.server-version }} + ref: ${{ github.ref_name }} - name: Checkout AppAPI uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: path: apps/${{ env.APP_NAME }} - - name: Set up php ${{ matrix.php-version }} + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: - php-version: ${{ matrix.php-version }} + php-version: '8.3' extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql coverage: none ini-file: development @@ -120,7 +115,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_${{ matrix.server-version }}_${{ matrix.php-version }}_container.json + name: nc_host_app_docker_container.json path: container.json if-no-files-found: warn @@ -128,7 +123,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_${{ matrix.server-version }}_${{ matrix.php-version }}_container.log + name: nc_host_app_docker_container.log path: container.log if-no-files-found: warn @@ -136,7 +131,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_${{ matrix.server-version }}_${{ matrix.php-version }}_nextcloud.log + name: nc_host_app_docker_nextcloud.log path: data/nextcloud.log if-no-files-found: warn @@ -153,7 +148,7 @@ jobs: - name: Create container run: | docker network create master_bridge - docker run --net master_bridge --name nextcloud --rm -d -v /var/run/docker.sock:/var/run/docker.sock ${{ env.docker-image }} + docker run --net master_bridge --name nextcloud -e SERVER_BRANCH=${{ github.ref_name }} --rm -d -v /var/run/docker.sock:/var/run/docker.sock ${{ env.docker-image }} sudo chmod 766 /var/run/docker.sock sleep 120s @@ -243,7 +238,7 @@ jobs: -e NC_HAPROXY_PASSWORD="some_secure_password" \ --net master_bridge --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \ --privileged -d ghcr.io/nextcloud/nextcloud-appapi-dsp:latest - docker run --net master_bridge --name nextcloud --rm -d ${{ env.docker-image }} + docker run --net master_bridge --name nextcloud -e SERVER_BRANCH=${{ github.ref_name }} --rm -d ${{ env.docker-image }} sleep 60s - name: Install AppAPI @@ -342,7 +337,7 @@ jobs: -e EX_APPS_NET="ipv4@localhost" \ --net host --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \ --privileged -d ghcr.io/nextcloud/nextcloud-appapi-dsp:latest - docker run --net master_bridge --name nextcloud --rm -d ${{ env.docker-image }} + docker run --net master_bridge --name nextcloud -e SERVER_BRANCH=${{ github.ref_name }} --rm -d ${{ env.docker-image }} sleep 60s - name: Debug information @@ -471,7 +466,7 @@ jobs: -e EX_APPS_NET="ipv4@localhost" \ --net host --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \ --privileged -d ghcr.io/nextcloud/nextcloud-appapi-dsp:latest - docker run --net=bridge --name=nextcloud -p 8080:80 --rm -d ${{ env.docker-image }} + docker run --net=bridge --name=nextcloud -e SERVER_BRANCH=${{ github.ref_name }} -p 8080:80 --rm -d ${{ env.docker-image }} sleep 60s - name: Debug information @@ -571,7 +566,7 @@ jobs: nc-host-app-docker-redis: runs-on: ubuntu-22.04 - name: NC In Host(Redis) • master • 🐘8.3 + name: NC In Host(Redis) services: postgres: @@ -603,17 +598,17 @@ jobs: with: submodules: true repository: nextcloud/server - ref: master + ref: ${{ github.ref_name }} - name: Checkout AppAPI uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: path: apps/${{ env.APP_NAME }} - - name: Set up php 8.3 + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: - php-version: 8.3 + php-version: '8.3' extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql, redis coverage: none ini-file: development @@ -689,7 +684,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_redis_master_8.3_container.json + name: nc_host_app_docker_redis_container.json path: container.json if-no-files-found: warn @@ -697,7 +692,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_redis_master_8.3_container.log + name: nc_host_app_docker_redis_container.log path: container.log if-no-files-found: warn @@ -705,13 +700,13 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_app_docker_redis_master_8.3_nextcloud.log + name: nc_host_app_docker_redis_nextcloud.log path: data/nextcloud.log if-no-files-found: warn nc-host-network-host: runs-on: ubuntu-22.04 - name: NC In Host(network=host) • master • 🐘8.3 + name: NC In Host(network=host) • 🐘8.3 services: postgres: @@ -733,17 +728,17 @@ jobs: with: submodules: true repository: nextcloud/server - ref: master + ref: ${{ github.ref_name }} - name: Checkout AppAPI uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: path: apps/${{ env.APP_NAME }} - - name: Set up php 8.3 + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: - php-version: 8.3 + php-version: '8.3' extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql, redis coverage: none ini-file: development @@ -809,7 +804,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_network_host_master_8.2_container.json + name: nc_host_network_host_container.json path: container.json if-no-files-found: warn @@ -817,7 +812,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_network_host_master_8.2_container.log + name: nc_host_network_host_container.log path: container.log if-no-files-found: warn @@ -825,7 +820,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: nc_host_network_host_master_8.2_nextcloud.log + name: nc_host_network_host_nextcloud.log path: data/nextcloud.log if-no-files-found: warn diff --git a/.github/workflows/tests-special.yml b/.github/workflows/tests-special.yml index 387d7c6c..61ad97cd 100644 --- a/.github/workflows/tests-special.yml +++ b/.github/workflows/tests-special.yml @@ -4,9 +4,9 @@ name: Tests Special on: pull_request: - branches: [main] + branches: [stable31] push: - branches: [main] + branches: [stable31] workflow_dispatch: permissions: @@ -53,7 +53,7 @@ jobs: with: submodules: true repository: nextcloud/server - ref: 'master' + ref: ${{ github.ref_name }} - name: Checkout AppAPI uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f16b0ad..06c11aaa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,9 +4,9 @@ name: Tests on: pull_request: - branches: [main] + branches: [stable31] push: - branches: [main] + branches: [stable31] workflow_dispatch: permissions: @@ -27,12 +27,7 @@ env: jobs: nc-py-api-pgsql: runs-on: ubuntu-22.04 - name: NC_Py_API • ${{ matrix.server-version }} • 🐘${{ matrix.php-version }} • PgSQL - strategy: - fail-fast: false - matrix: - php-version: [ '8.3' ] - server-version: [ 'master' ] + name: NC_Py_API • PgSQL env: DATABASE_PGSQL: 1 @@ -60,13 +55,13 @@ jobs: with: submodules: true repository: nextcloud/server - ref: ${{ matrix.server-version }} + ref: ${{ github.ref_name }} - name: Checkout Notifications uses: actions/checkout@v4 with: repository: nextcloud/notifications - ref: ${{ matrix.server-version }} + ref: ${{ github.ref_name }} path: apps/notifications - name: Checkout AppAPI @@ -74,18 +69,10 @@ jobs: with: path: apps/${{ env.APP_NAME }} - - name: Checkout Notes - uses: actions/checkout@v4 - if: ${{ !startsWith(matrix.server-version, 'master') }} - with: - repository: nextcloud/notes - ref: "main" - path: apps/notes - - - name: Set up php ${{ matrix.php-version }} + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: - php-version: ${{ matrix.php-version }} + php-version: '8.3' extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql coverage: none ini-file: development @@ -114,10 +101,6 @@ jobs: ./occ app:enable notifications ./occ app:enable --force ${{ env.APP_NAME }} - - name: Enable Notes - if: ${{ !startsWith(matrix.server-version, 'master') }} - run: ./occ app:enable notes - - name: Run Nextcloud run: PHP_CLI_SERVER_WORKERS=2 php -S 127.0.0.1:8080 & @@ -150,13 +133,13 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: pgsql_nc_py_api_${{ matrix.server-version }}_${{ matrix.php-version }}_nextcloud.log + name: pgsql_nc_py_api_nextcloud.log path: data/nextcloud.log if-no-files-found: warn nc-py-api-mysql: runs-on: ubuntu-22.04 - name: NC_Py_API • master • 8.3 • MySQL + name: NC_Py_API • MySQL services: mysql: @@ -180,13 +163,13 @@ jobs: with: submodules: true repository: nextcloud/server - ref: master + ref: ${{ github.ref_name }} - name: Checkout Notifications uses: actions/checkout@v4 with: repository: nextcloud/notifications - ref: master + ref: ${{ github.ref_name }} path: apps/notifications - name: Checkout AppAPI @@ -194,7 +177,7 @@ jobs: with: path: apps/${{ env.APP_NAME }} - - name: Set up php 8.3 + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: php-version: '8.3' @@ -263,13 +246,13 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: mysql_nc_py_api_master_8.3_nextcloud.log + name: mysql_nc_py_api_nextcloud.log path: data/nextcloud.log if-no-files-found: warn nc-py-api-mysql-apcu: runs-on: ubuntu-22.04 - name: APCu • NC_Py_API • master • 8.3 • MySQL + name: APCu • NC_Py_API • MySQL services: mysql: @@ -293,13 +276,13 @@ jobs: with: submodules: true repository: nextcloud/server - ref: master + ref: ${{ github.ref_name }} - name: Checkout Notifications uses: actions/checkout@v4 with: repository: nextcloud/notifications - ref: master + ref: ${{ github.ref_name }} path: apps/notifications - name: Checkout AppAPI @@ -307,7 +290,7 @@ jobs: with: path: apps/${{ env.APP_NAME }} - - name: Set up php 8.3 + - name: Set up php uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: php-version: '8.3' @@ -379,17 +362,13 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: apcu_mysql_nc_py_api_master_8.3_nextcloud.log + name: apcu_mysql_nc_py_api_nextcloud.log path: data/nextcloud.log if-no-files-found: warn nc-py-api-oci: runs-on: ubuntu-22.04 - name: NC_Py_API • ${{ matrix.server-version }} • 8.3 • Oracle - strategy: - fail-fast: false - matrix: - server-version: [ 'master' ] + name: NC_Py_API • Oracle services: oracle: @@ -419,13 +398,13 @@ jobs: with: submodules: true repository: nextcloud/server - ref: ${{ matrix.server-version }} + ref: ${{ github.ref_name }} - name: Checkout Notifications uses: actions/checkout@v4 with: repository: nextcloud/notifications - ref: ${{ matrix.server-version }} + ref: ${{ github.ref_name }} path: apps/notifications - name: Checkout AppAPI @@ -495,7 +474,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: oci_nc_py_api_${{ matrix.server-version }}_8.3_nextcloud.log + name: oci_nc_py_api_nextcloud.log path: data/nextcloud.log if-no-files-found: warn