diff --git a/patches/nextcloud/appstore-build-publish.yml.patch b/patches/nextcloud/appstore-build-publish.yml.patch index 55cef51..562eb80 100644 --- a/patches/nextcloud/appstore-build-publish.yml.patch +++ b/patches/nextcloud/appstore-build-publish.yml.patch @@ -1,13 +1,20 @@ ---- appstore-build-publish.yml -+++ appstore-build-publish.yml -@@ -18,8 +18,8 @@ jobs: +--- upstream/vendor/nextcloud/appstore-build-publish.yml ++++ workflow-templates/appstore-build-publish.yml +@@ -1,6 +1,6 @@ + # This workflow is provided via the organization template repository + # +-# https://github.com/nextcloud/.github ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +@@ -19,9 +19,6 @@ build_and_publish: runs-on: ubuntu-latest - # Only allowed to be run on nextcloud-releases repositories - if: ${{ github.repository_owner == 'nextcloud-releases' }} -+ # Downstream consumers publish from their own repositories. -+ # Repository policy is enforced by the consumer. - +- steps: - name: Check actor permission + uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 diff --git a/patches/nextcloud/block-unconventional-commits.yml.patch b/patches/nextcloud/block-unconventional-commits.yml.patch index 92c5b89..579dfe9 100644 --- a/patches/nextcloud/block-unconventional-commits.yml.patch +++ b/patches/nextcloud/block-unconventional-commits.yml.patch @@ -1,69 +1,19 @@ --- upstream/vendor/nextcloud/block-unconventional-commits.yml -+++ .github/workflows/block-unconventional-commits.yml -@@ -1,36 +1,30 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/block-unconventional-commits.yml +@@ -1,6 +1,6 @@ + # 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: 2024 Nextcloud GmbH and Nextcloud contributors --# SPDX-License-Identifier: MIT -- --name: Block unconventional commits -- --on: -- pull_request: -- types: [opened, ready_for_review, reopened, synchronize] -- --permissions: -- contents: read -- --concurrency: -- group: block-unconventional-commits-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- block-unconventional-commits: -- name: Block unconventional commits -- ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +@@ -23,7 +23,7 @@ + block-unconventional-commits: + name: Block unconventional commits + - runs-on: ubuntu-latest-low -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 -- with: -- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -+# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Block unconventional commits -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: block-unconventional-commits-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ block-unconventional-commits: -+ name: Block unconventional commits + runs-on: ubuntu-latest -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Validate conventional commits -+ uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 -+ with: -+ GITHUB_TOKEN: ${{ github.token }} + + steps: + - name: Checkout diff --git a/patches/nextcloud/block-unconventional-commits.yml.patch.license b/patches/nextcloud/block-unconventional-commits.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/block-unconventional-commits.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-eslint.yml.patch b/patches/nextcloud/lint-eslint.yml.patch index 0020a90..ee9c343 100644 --- a/patches/nextcloud/lint-eslint.yml.patch +++ b/patches/nextcloud/lint-eslint.yml.patch @@ -1,200 +1,28 @@ --- upstream/vendor/nextcloud/lint-eslint.yml -+++ .github/workflows/lint-eslint.yml -@@ -1,100 +1,97 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-eslint.yml +@@ -1,6 +1,6 @@ + # 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: Lint eslint -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: lint-eslint-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- changes: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +@@ -19,7 +19,7 @@ + + jobs: + changes: - runs-on: ubuntu-latest-low -- permissions: -- contents: read -- pull-requests: read -- -- outputs: -- src: ${{ steps.changes.outputs.src}} -- -- steps: -- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -- id: changes -- continue-on-error: true -- with: -- filters: | -- src: -- - '.github/workflows/**' -- - 'src/**' -- - 'appinfo/info.xml' -- - 'package.json' -- - 'package-lock.json' -- - 'tsconfig.json' -- - '.eslintrc.*' -- - '.eslintignore' -- - '**.js' -- - '**.ts' -- - '**.vue' -- -- lint: -- runs-on: ubuntu-latest -- -- needs: changes -- if: needs.changes.outputs.src != 'false' -- -- name: NPM lint -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Read package.json node and npm engines version -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: versions -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} -- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' -- -- - name: Install dependencies -- env: -- CYPRESS_INSTALL_BINARY: 0 -- PUPPETEER_SKIP_DOWNLOAD: true -- run: npm ci -- -- - name: Lint -- run: npm run lint -- -- summary: -- permissions: -- contents: none -- runs-on: ubuntu-latest-low -- needs: [changes, lint] -- -- if: always() -- -- # This is the summary, we just avoid to rename it so that branch protection rules still match -- name: eslint -- -- steps: -- - name: Summary status -- run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Lint eslint -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: lint-eslint-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ changes: -+ runs-on: ubuntu-latest -+ permissions: -+ contents: read -+ pull-requests: read -+ outputs: -+ src: ${{ steps.changes.outputs.src }} -+ steps: -+ - name: Detect JavaScript changes -+ id: changes -+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -+ continue-on-error: true -+ with: -+ filters: | -+ src: -+ - '.github/workflows/**' -+ - 'src/**' -+ - 'appinfo/info.xml' -+ - 'package.json' -+ - 'package-lock.json' -+ - 'tsconfig.json' -+ - '.eslintrc.*' -+ - '.eslintignore' -+ - '**.js' -+ - '**.ts' -+ - '**.vue' -+ -+ lint: + runs-on: ubuntu-latest -+ needs: changes -+ if: needs.changes.outputs.src != 'false' -+ name: NPM lint -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Read package.json engines -+ id: versions -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ run: npm --version -+ -+ - name: Install dependencies -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ PUPPETEER_SKIP_DOWNLOAD: true -+ run: npm ci -+ -+ - name: Lint -+ run: npm run lint -+ -+ summary: -+ permissions: -+ contents: none + permissions: + contents: read + pull-requests: read +@@ -87,7 +87,7 @@ + summary: + permissions: + contents: none +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: -+ - changes -+ - lint -+ if: always() -+ name: eslint -+ steps: -+ - name: Summary status -+ env: -+ CHANGED: ${{ needs.changes.outputs.src }} -+ LINT_RESULT: ${{ needs.lint.result }} -+ run: | -+ if [ "$CHANGED" != "false" ] && [ "$LINT_RESULT" != "success" ]; then -+ exit 1 -+ fi + needs: [changes, lint] + + if: always() diff --git a/patches/nextcloud/lint-eslint.yml.patch.license b/patches/nextcloud/lint-eslint.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-eslint.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-info-xml.yml.patch b/patches/nextcloud/lint-info-xml.yml.patch index a458c3b..bb9ec28 100644 --- a/patches/nextcloud/lint-info-xml.yml.patch +++ b/patches/nextcloud/lint-info-xml.yml.patch @@ -1,77 +1,19 @@ --- upstream/vendor/nextcloud/lint-info-xml.yml -+++ .github/workflows/lint-info-xml.yml -@@ -1,40 +1,34 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-info-xml.yml +@@ -1,6 +1,6 @@ + # 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: Lint info.xml -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: lint-info-xml-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- xml-linters: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +@@ -19,7 +19,7 @@ + + jobs: + xml-linters: - runs-on: ubuntu-latest-low -- -- name: info.xml lint -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- sparse-checkout: | -- appinfo/ -- -- - name: Download schema -- run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd -- -- - name: Lint info.xml -- uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 -- with: -- xml-file: ./appinfo/info.xml -- xml-schema-file: ./info.xsd -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Lint info.xml -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+jobs: -+ xml-linters: -+ name: info.xml lint + runs-on: ubuntu-latest -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ sparse-checkout: | -+ appinfo/ -+ -+ - name: Download schema -+ run: >- -+ wget -+ https://raw.githubusercontent.com/nextcloud/appstore/c8fe8dcb388d2ed7b566e982fd64aa38463ba80a/nextcloudappstore/api/v1/release/info.xsd -+ -+ - name: Lint info.xml -+ uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 -+ with: -+ xml-file: ./appinfo/info.xml -+ xml-schema-file: ./info.xsd + + name: info.xml lint + steps: diff --git a/patches/nextcloud/lint-info-xml.yml.patch.license b/patches/nextcloud/lint-info-xml.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-info-xml.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-php-cs.yml.patch b/patches/nextcloud/lint-php-cs.yml.patch index b9ee5b2..23726f9 100644 --- a/patches/nextcloud/lint-php-cs.yml.patch +++ b/patches/nextcloud/lint-php-cs.yml.patch @@ -1,105 +1,10 @@ --- upstream/vendor/nextcloud/lint-php-cs.yml -+++ .github/workflows/lint-php-cs.yml -@@ -1,54 +1,48 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-php-cs.yml +@@ -1,6 +1,6 @@ + # 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: Lint php-cs -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: lint-php-cs-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- lint: -- runs-on: ubuntu-latest -- -- name: php-cs -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Get php version -- id: versions -- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -- -- - name: Set up php${{ steps.versions.outputs.php-min }} -- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -- with: -- php-version: ${{ steps.versions.outputs.php-min }} -- extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -- coverage: none -- ini-file: development -- env: -- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- -- - name: Remove nextcloud/ocp -- run: | -- composer remove nextcloud/ocp --dev --no-scripts -- -- - name: Install composer dependencies -- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -- -- - name: Lint -- run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Lint php-cs -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: lint-php-cs-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ lint: -+ runs-on: ubuntu-latest -+ name: php-cs -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Get php version -+ id: versions -+ uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -+ -+ - name: Set up php${{ steps.versions.outputs.php-min }} -+ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -+ with: -+ php-version: ${{ steps.versions.outputs.php-min }} -+ extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -+ coverage: none -+ ini-file: development -+ env: -+ GITHUB_TOKEN: ${{ github.token }} -+ -+ - name: Remove nextcloud/ocp -+ run: composer remove nextcloud/ocp --dev --no-scripts -+ -+ - name: Install composer dependencies -+ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -+ -+ - name: Lint -+ run: composer run cs:check ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors diff --git a/patches/nextcloud/lint-php-cs.yml.patch.license b/patches/nextcloud/lint-php-cs.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-php-cs.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-php.yml.patch b/patches/nextcloud/lint-php.yml.patch index f6e66df..0d60065 100644 --- a/patches/nextcloud/lint-php.yml.patch +++ b/patches/nextcloud/lint-php.yml.patch @@ -1,156 +1,37 @@ --- upstream/vendor/nextcloud/lint-php.yml -+++ .github/workflows/lint-php.yml -@@ -1,76 +1,77 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-php.yml +@@ -1,6 +1,6 @@ + # 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: Lint php -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: lint-php-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- matrix: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +@@ -19,7 +19,7 @@ + + jobs: + matrix: - runs-on: ubuntu-latest-low -- outputs: -- php-min: ${{ steps.versions.outputs.php-min }} -- php-max: ${{ steps.versions.outputs.php-max }} -- steps: -- - name: Checkout app -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Get version matrix -- id: versions -- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -- -- php-lint: -- runs-on: ubuntu-latest-low -- needs: matrix -- strategy: -- matrix: -- php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}'] -- -- name: php-lint -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Set up php ${{ matrix.php-versions }} -- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -- with: -- php-version: ${{ matrix.php-versions }} -- extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -- coverage: none -- ini-file: development -- env: -- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- -- - name: Lint -- run: composer run lint -- -- summary: -- permissions: -- contents: none -- runs-on: ubuntu-latest-low -- needs: php-lint -- -- if: always() -- -- name: php-lint-summary -- -- steps: -- - name: Summary status -- run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Lint php -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: lint-php-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ matrix: + runs-on: ubuntu-latest -+ outputs: -+ php-min: ${{ steps.versions.outputs.php-min }} -+ php-max: ${{ steps.versions.outputs.php-max }} -+ steps: -+ - name: Checkout app -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Get version matrix -+ id: versions -+ uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -+ -+ php-lint: + outputs: + php-min: ${{ steps.versions.outputs.php-min }} + php-max: ${{ steps.versions.outputs.php-max }} +@@ -34,7 +34,7 @@ + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + php-lint: +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: matrix -+ strategy: -+ matrix: -+ php-versions: -+ - '${{ needs.matrix.outputs.php-min }}' -+ - '${{ needs.matrix.outputs.php-max }}' -+ -+ name: php-lint -+ -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Set up php ${{ matrix.php-versions }} -+ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -+ with: -+ php-version: ${{ matrix.php-versions }} -+ extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -+ coverage: none -+ ini-file: development -+ env: -+ GITHUB_TOKEN: ${{ github.token }} -+ -+ - name: Lint -+ run: composer run lint -+ -+ summary: -+ permissions: -+ contents: none + needs: matrix + strategy: + matrix: +@@ -64,7 +64,7 @@ + summary: + permissions: + contents: none +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: php-lint -+ if: always() -+ name: php-lint-summary -+ steps: -+ - name: Summary status -+ env: -+ RESULT: ${{ needs.php-lint.result }} -+ run: | -+ if [ "$RESULT" != "success" ] && [ "$RESULT" != "skipped" ]; then -+ exit 1 -+ fi + needs: php-lint + + if: always() diff --git a/patches/nextcloud/lint-php.yml.patch.license b/patches/nextcloud/lint-php.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-php.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-stylelint.yml.patch b/patches/nextcloud/lint-stylelint.yml.patch index f5f36d1..3ce1d8c 100644 --- a/patches/nextcloud/lint-stylelint.yml.patch +++ b/patches/nextcloud/lint-stylelint.yml.patch @@ -1,105 +1,10 @@ --- upstream/vendor/nextcloud/lint-stylelint.yml -+++ .github/workflows/lint-stylelint.yml -@@ -1,53 +1,49 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-stylelint.yml +@@ -1,6 +1,6 @@ + # 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: Lint stylelint -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: lint-stylelint-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- lint: -- runs-on: ubuntu-latest -- -- name: stylelint -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Read package.json node and npm engines version -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: versions -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} -- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' -- -- - name: Install dependencies -- env: -- CYPRESS_INSTALL_BINARY: 0 -- run: npm ci -- -- - name: Lint -- run: npm run stylelint -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Lint stylelint -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: lint-stylelint-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ lint: -+ runs-on: ubuntu-latest -+ name: stylelint -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Read package.json engines -+ id: versions -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ run: npm --version -+ -+ - name: Install dependencies -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ PUPPETEER_SKIP_DOWNLOAD: true -+ run: npm ci -+ -+ - name: Lint -+ run: npm run stylelint ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors diff --git a/patches/nextcloud/lint-stylelint.yml.patch.license b/patches/nextcloud/lint-stylelint.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-stylelint.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/lint-typescript.yml.patch b/patches/nextcloud/lint-typescript.yml.patch index 8266c22..c262230 100644 --- a/patches/nextcloud/lint-typescript.yml.patch +++ b/patches/nextcloud/lint-typescript.yml.patch @@ -1,195 +1,28 @@ --- upstream/vendor/nextcloud/lint-typescript.yml -+++ .github/workflows/lint-typescript.yml -@@ -1,100 +1,92 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/lint-typescript.yml +@@ -1,6 +1,6 @@ + # 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: 2023-2024 Nextcloud GmbH and Nextcloud contributors --# SPDX-License-Identifier: MIT -- --name: Type checking -- --on: -- pull_request: -- push: -- branches: -- - main -- - master -- - stable* -- --permissions: -- contents: read -- --concurrency: -- group: lint-typescript-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- changes: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +@@ -25,7 +25,7 @@ + + jobs: + changes: - runs-on: ubuntu-latest-low -- permissions: -- contents: read -- pull-requests: read -- -- outputs: -- src: ${{ steps.changes.outputs.src}} -- -- steps: -- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -- id: changes -- continue-on-error: true -- with: -- filters: | -- src: -- - '.github/workflows/lint-typescript.yml' -- - 'package.json' -- - 'package-lock.json' -- - 'tsconfig.json' -- - '**.ts' -- - '**.vue' -- -- test: -- runs-on: ubuntu-latest -- -- needs: changes -- if: needs.changes.outputs.src != 'false' -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Read package.json node and npm engines version -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: versions -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} -- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' -- -- - name: Install dependencies -- env: -- CYPRESS_INSTALL_BINARY: 0 -- run: | -- npm ci -- -- - name: Check types -- run: | -- npm run --if-present check-types -- npm run --if-present ts:check -- -- summary: -- permissions: -- contents: none -- runs-on: ubuntu-latest-low -- needs: [changes, test] -- -- if: always() -- -- name: typescript-summary -- -- steps: -- - name: Summary status -- run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi -+# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Type checking -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: lint-typescript-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ changes: -+ runs-on: ubuntu-latest -+ permissions: -+ contents: read -+ pull-requests: read -+ outputs: -+ src: ${{ steps.changes.outputs.src }} -+ steps: -+ - name: Detect TypeScript changes -+ id: changes -+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -+ continue-on-error: true -+ with: -+ filters: | -+ src: -+ - '.github/workflows/**' -+ - 'package.json' -+ - 'package-lock.json' -+ - 'tsconfig.json' -+ - '**.ts' -+ - '**.vue' -+ -+ test: + runs-on: ubuntu-latest -+ needs: changes -+ if: needs.changes.outputs.src != 'false' -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Read package.json engines -+ id: versions -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ run: npm --version -+ -+ - name: Install dependencies -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ run: npm ci -+ -+ - name: Check types -+ run: | -+ npm run --if-present check-types -+ npm run --if-present ts:check -+ -+ summary: -+ permissions: -+ contents: none + permissions: + contents: read + pull-requests: read +@@ -88,7 +88,7 @@ + summary: + permissions: + contents: none +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: -+ - changes -+ - test -+ if: always() -+ name: typescript-summary -+ steps: -+ - name: Summary status -+ env: -+ CHANGED: ${{ needs.changes.outputs.src }} -+ TEST_RESULT: ${{ needs.test.result }} -+ run: | -+ if [ "$CHANGED" != "false" ] && [ "$TEST_RESULT" != "success" ]; then -+ exit 1 -+ fi + needs: [changes, test] + + if: always() diff --git a/patches/nextcloud/lint-typescript.yml.patch.license b/patches/nextcloud/lint-typescript.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/lint-typescript.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/node-test.yml.patch b/patches/nextcloud/node-test.yml.patch index 2757cd6..5ec726f 100644 --- a/patches/nextcloud/node-test.yml.patch +++ b/patches/nextcloud/node-test.yml.patch @@ -1,220 +1,28 @@ --- upstream/vendor/nextcloud/node-test.yml -+++ .github/workflows/node-test.yml -@@ -1,112 +1,105 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/node-test.yml +@@ -1,6 +1,6 @@ + # 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: 2023-2024 Nextcloud GmbH and Nextcloud contributors --# SPDX-License-Identifier: MIT -- --name: Node tests -- --on: -- pull_request: -- push: -- branches: -- - main -- - master -- - stable* -- --permissions: -- contents: read -- --concurrency: -- group: node-tests-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- changes: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +@@ -25,7 +25,7 @@ + + jobs: + changes: - runs-on: ubuntu-latest-low -- permissions: -- contents: read -- pull-requests: read -- -- outputs: -- src: ${{ steps.changes.outputs.src}} -- -- steps: -- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -- id: changes -- continue-on-error: true -- with: -- filters: | -- src: -- - '.github/workflows/**' -- - '__tests__/**' -- - '__mocks__/**' -- - 'src/**' -- - 'appinfo/info.xml' -- - 'package.json' -- - 'package-lock.json' -- - 'tsconfig.json' -- - '**.js' -- - '**.ts' -- - '**.vue' -- -- test: -- runs-on: ubuntu-latest -- -- needs: changes -- if: needs.changes.outputs.src != 'false' -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Read package.json node and npm engines version -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: versions -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} -- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' -- -- - name: Install dependencies & build -- env: -- CYPRESS_INSTALL_BINARY: 0 -- run: | -- npm ci -- npm run build --if-present -- -- - name: Test -- run: npm run test --if-present -- -- - name: Test and process coverage -- run: npm run test:coverage --if-present -- -- - name: Collect coverage -- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 -- with: -- files: ./coverage/lcov.info -- -- summary: -- permissions: -- contents: none -- runs-on: ubuntu-latest-low -- needs: [changes, test] -- -- if: always() -- -- name: test-summary -- -- steps: -- - name: Summary status -- run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi -+# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Node tests -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: node-tests-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ changes: -+ runs-on: ubuntu-latest -+ permissions: -+ contents: read -+ pull-requests: read -+ outputs: -+ src: ${{ steps.changes.outputs.src }} -+ steps: -+ - name: Detect Node test changes -+ id: changes -+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -+ continue-on-error: true -+ with: -+ filters: | -+ src: -+ - '.github/workflows/**' -+ - '__tests__/**' -+ - '__mocks__/**' -+ - 'src/**' -+ - 'appinfo/info.xml' -+ - 'package.json' -+ - 'package-lock.json' -+ - 'tsconfig.json' -+ - '**.js' -+ - '**.ts' -+ - '**.vue' -+ -+ test: + runs-on: ubuntu-latest -+ needs: changes -+ if: needs.changes.outputs.src != 'false' -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Read package.json engines -+ id: versions -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ run: npm --version -+ -+ - name: Install dependencies and build -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ run: | -+ npm ci -+ npm run build --if-present -+ -+ - name: Test -+ run: npm run test --if-present -+ -+ - name: Test and process coverage -+ run: npm run test:coverage --if-present -+ -+ - name: Collect coverage -+ uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0 -+ with: -+ files: ./coverage/lcov.info -+ -+ summary: -+ permissions: -+ contents: none + permissions: + contents: read + pull-requests: read +@@ -100,7 +100,7 @@ + summary: + permissions: + contents: none +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: -+ - changes -+ - test -+ if: always() -+ name: test-summary -+ steps: -+ - name: Summary status -+ env: -+ CHANGED: ${{ needs.changes.outputs.src }} -+ TEST_RESULT: ${{ needs.test.result }} -+ run: | -+ if [ "$CHANGED" != "false" ] && [ "$TEST_RESULT" != "success" ]; then -+ exit 1 -+ fi + needs: [changes, test] + + if: always() diff --git a/patches/nextcloud/node-test.yml.patch.license b/patches/nextcloud/node-test.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/node-test.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/npm-build.yml.patch b/patches/nextcloud/npm-build.yml.patch index c99cc5a..ba03e7e 100644 --- a/patches/nextcloud/npm-build.yml.patch +++ b/patches/nextcloud/npm-build.yml.patch @@ -1,229 +1,28 @@ --- upstream/vendor/nextcloud/npm-build.yml -+++ .github/workflows/npm-build.yml -@@ -1,113 +1,113 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/npm-build.yml +@@ -1,6 +1,6 @@ + # 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 Javascript -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: node-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- changes: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +@@ -19,7 +19,7 @@ + + jobs: + changes: - runs-on: ubuntu-latest-low -- permissions: -- contents: read -- pull-requests: read -- -- outputs: -- src: ${{ steps.changes.outputs.src}} -- -- steps: -- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -- id: changes -- continue-on-error: true -- with: -- filters: | -- src: -- - '.github/workflows/**' -- - 'src/**' -- - 'appinfo/info.xml' -- - 'package.json' -- - 'package-lock.json' -- - 'tsconfig.json' -- - '**.js' -- - '**.ts' -- - '**.vue' -- -- build: -- runs-on: ubuntu-latest -- -- needs: changes -- if: needs.changes.outputs.src != 'false' -- -- name: NPM build -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Read package.json node and npm engines version -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: versions -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.versions.outputs.npmVersion }} -- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' -- -- - name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460 -- run: | -- npm i -g npm-package-lock-add-resolved@1.1.4 -- npm-package-lock-add-resolved -- git --no-pager diff --exit-code -- -- - name: Install dependencies & build -- env: -- CYPRESS_INSTALL_BINARY: 0 -- PUPPETEER_SKIP_DOWNLOAD: true -- run: | -- npm ci -- npm run build --if-present -- -- - name: Check build changes -- run: | -- bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" -- -- - name: Show changes on failure -- if: failure() -- run: | -- git status -- git --no-pager diff -- exit 1 # make it red to grab attention -- -- summary: -- permissions: -- contents: none -- runs-on: ubuntu-latest-low -- needs: [changes, build] -- -- if: always() -- -- # This is the summary, we just avoid to rename it so that branch protection rules still match -- name: node -- -- steps: -- - name: Summary status -- run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi -+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Build Javascript -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: node-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ changes: -+ runs-on: ubuntu-latest -+ permissions: -+ contents: read -+ pull-requests: read -+ outputs: -+ src: ${{ steps.changes.outputs.src }} -+ steps: -+ - name: Detect frontend changes -+ id: changes -+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 -+ continue-on-error: true -+ with: -+ filters: | -+ src: -+ - '.github/workflows/**' -+ - 'src/**' -+ - 'appinfo/info.xml' -+ - 'package.json' -+ - 'package-lock.json' -+ - 'tsconfig.json' -+ - '**.js' -+ - '**.ts' -+ - '**.vue' -+ -+ build: + runs-on: ubuntu-latest -+ needs: changes -+ if: needs.changes.outputs.src != 'false' -+ name: NPM build -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Read package.json node and npm engines version -+ id: versions -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }} -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ run: npm --version -+ -+ - name: Validate package-lock.json -+ run: | -+ npm exec --yes --package=npm-package-lock-add-resolved@1.1.4 -- npm-package-lock-add-resolved -+ git --no-pager diff --exit-code -+ -+ - name: Install dependencies and build -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ PUPPETEER_SKIP_DOWNLOAD: true -+ run: | -+ npm ci -+ npm run build --if-present -+ -+ - name: Check build changes -+ run: | -+ if [ -n "$(git status --porcelain)" ]; then -+ echo 'Please recompile and commit the assets. See the "Show changes on failure" step for details.' -+ exit 1 -+ fi -+ -+ - name: Show changes on failure -+ if: failure() -+ run: | -+ git status -+ git --no-pager diff -+ exit 1 -+ -+ summary: -+ permissions: -+ contents: none + permissions: + contents: read + pull-requests: read +@@ -100,7 +100,7 @@ + summary: + permissions: + contents: none +- runs-on: ubuntu-latest-low + runs-on: ubuntu-latest -+ needs: -+ - changes -+ - build -+ if: always() -+ name: node -+ steps: -+ - name: Summary status -+ env: -+ CHANGED: ${{ needs.changes.outputs.src }} -+ BUILD_RESULT: ${{ needs.build.result }} -+ run: | -+ if [ "$CHANGED" != "false" ] && [ "$BUILD_RESULT" != "success" ]; then -+ exit 1 -+ fi + needs: [changes, build] + + if: always() diff --git a/patches/nextcloud/npm-build.yml.patch.license b/patches/nextcloud/npm-build.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/npm-build.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/openapi.yml.patch b/patches/nextcloud/openapi.yml.patch index 69ab9af..2fb3ad6 100644 --- a/patches/nextcloud/openapi.yml.patch +++ b/patches/nextcloud/openapi.yml.patch @@ -1,190 +1,10 @@ --- upstream/vendor/nextcloud/openapi.yml -+++ .github/workflows/openapi.yml -@@ -1,96 +1,91 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/openapi.yml +@@ -1,6 +1,6 @@ + # 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: 2024 Nextcloud GmbH and Nextcloud contributors --# SPDX-FileCopyrightText: 2024 Arthur Schiwon --# SPDX-License-Identifier: MIT -- --name: OpenAPI -- --on: pull_request -- --permissions: -- contents: read -- --concurrency: -- group: openapi-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --jobs: -- openapi: -- runs-on: ubuntu-latest -- -- if: ${{ github.repository_owner != 'nextcloud-gmbh' }} -- -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Get php version -- id: php_versions -- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -- -- - name: Set up php -- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -- with: -- php-version: ${{ steps.php_versions.outputs.php-available }} -- extensions: xml -- coverage: none -- ini-file: development -- env: -- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- -- - name: Check Typescript OpenApi types -- id: check_typescript_openapi -- uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 -- with: -- files: "src/types/openapi/openapi*.ts" -- -- - name: Read package.json node and npm engines version -- if: steps.check_typescript_openapi.outputs.files_exists == 'true' -- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -- id: node_versions -- # Continue if no package.json -- continue-on-error: true -- with: -- fallbackNode: '^24' -- fallbackNpm: '^11.3' -- -- - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} -- if: ${{ steps.node_versions.outputs.nodeVersion }} -- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -- with: -- node-version: ${{ steps.node_versions.outputs.nodeVersion }} -- -- - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} -- if: ${{ steps.node_versions.outputs.nodeVersion }} -- run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' -- -- - name: Install dependencies -- if: ${{ steps.node_versions.outputs.nodeVersion }} -- env: -- CYPRESS_INSTALL_BINARY: 0 -- PUPPETEER_SKIP_DOWNLOAD: true -- run: | -- npm ci -- -- - name: Install composer dependencies -- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -- -- - name: Regenerate OpenAPI -- run: composer run openapi -- -- - name: Check openapi*.json and typescript changes -- run: | -- bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and (if applicable) src/types/openapi/openapi*.ts, see the section \"Show changes on failure\" for details' && exit 1)" -- -- - name: Show changes on failure -- if: failure() -- run: | -- git status -- git --no-pager diff -- exit 1 # make it red to grab attention -+# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2024 Arthur Schiwon -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: OpenAPI -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: openapi-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ openapi: -+ runs-on: ubuntu-latest -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Get php version -+ id: php_versions -+ uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -+ -+ - name: Set up php -+ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -+ with: -+ php-version: ${{ steps.php_versions.outputs.php-available }} -+ extensions: xml -+ coverage: none -+ ini-file: development -+ env: -+ GITHUB_TOKEN: ${{ github.token }} -+ -+ - name: Check TypeScript OpenAPI types -+ id: check_typescript_openapi -+ uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 -+ with: -+ files: "src/types/openapi/openapi*.ts" -+ -+ - name: Read package.json engines -+ if: steps.check_typescript_openapi.outputs.files_exists == 'true' -+ id: node_versions -+ continue-on-error: true -+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 -+ with: -+ fallbackNode: '^24' -+ fallbackNpm: '^11.3' -+ -+ - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} -+ if: steps.node_versions.outputs.nodeVersion -+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 -+ with: -+ node-version: ${{ steps.node_versions.outputs.nodeVersion }} -+ -+ - name: Show npm version -+ if: steps.node_versions.outputs.nodeVersion -+ run: npm --version -+ -+ - name: Install npm dependencies -+ if: steps.node_versions.outputs.nodeVersion -+ env: -+ CYPRESS_INSTALL_BINARY: 0 -+ PUPPETEER_SKIP_DOWNLOAD: true -+ run: npm ci -+ -+ - name: Install composer dependencies -+ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -+ -+ - name: Regenerate OpenAPI -+ run: composer run openapi -+ -+ - name: Check generated OpenAPI files -+ run: | -+ if [ -n "$(git status --porcelain)" ]; then -+ echo 'Please run "composer run openapi" and commit the generated OpenAPI JSON and TypeScript files.' -+ exit 1 -+ fi -+ -+ - name: Show changes on failure -+ if: failure() -+ run: | -+ git status -+ git --no-pager diff -+ exit 1 ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors diff --git a/patches/nextcloud/openapi.yml.patch.license b/patches/nextcloud/openapi.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/openapi.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/psalm.yml.patch b/patches/nextcloud/psalm.yml.patch index 1b1dac9..ca1bf08 100644 --- a/patches/nextcloud/psalm.yml.patch +++ b/patches/nextcloud/psalm.yml.patch @@ -1,127 +1,10 @@ --- upstream/vendor/nextcloud/psalm.yml -+++ .github/workflows/psalm.yml -@@ -1,61 +1,63 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/psalm.yml +@@ -1,6 +1,6 @@ + # 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-2024 Nextcloud GmbH and Nextcloud contributors --# SPDX-License-Identifier: MIT -- --name: Static analysis -- --on: pull_request -- --concurrency: -- group: psalm-${{ github.head_ref || github.run_id }} -- cancel-in-progress: true -- --permissions: -- contents: read -- --jobs: -- static-analysis: -- runs-on: ubuntu-latest -- -- name: static-psalm-analysis -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: Get php version -- id: versions -- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -- -- - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml -- run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml -- -- - name: Set up php${{ steps.versions.outputs.php-available }} -- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -- with: -- php-version: ${{ steps.versions.outputs.php-available }} -- extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -- coverage: none -- ini-file: development -- # Temporary workaround for missing pcntl_* in PHP 8.3 -- ini-values: disable_functions= -- env: -- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- -- - name: Remove nextcloud/ocp -- run: | -- composer remove nextcloud/ocp --dev --no-scripts -- -- - name: Install composer dependencies -- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -- -- - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} -- run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies -- -- - name: Run coding standards check -- run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github -+# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: MIT -+ -+name: Static analysis -+ -+on: -+ workflow_call: -+ -+permissions: -+ contents: read -+ -+concurrency: -+ group: psalm-${{ github.head_ref || github.run_id }} -+ cancel-in-progress: true -+ -+jobs: -+ static-analysis: -+ runs-on: ubuntu-latest -+ name: static-psalm-analysis -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Get php version -+ id: versions -+ uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 -+ -+ - name: Check minimum PHP version in psalm.xml -+ env: -+ PHP_MIN: ${{ steps.versions.outputs.php-min }} -+ run: grep "phpVersion=\"$PHP_MIN" psalm.xml -+ -+ - name: Set up php${{ steps.versions.outputs.php-available }} -+ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 -+ with: -+ php-version: ${{ steps.versions.outputs.php-available }} -+ extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite -+ coverage: none -+ ini-file: development -+ ini-values: disable_functions= -+ env: -+ GITHUB_TOKEN: ${{ github.token }} -+ -+ - name: Remove nextcloud/ocp -+ run: composer remove nextcloud/ocp --dev --no-scripts -+ -+ - name: Install composer dependencies -+ uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 -+ -+ - name: Install supported nextcloud/ocp -+ env: -+ OCP_BRANCH: ${{ steps.versions.outputs.branches-max }} -+ run: >- -+ composer require --dev -+ "nextcloud/ocp:dev-$OCP_BRANCH" -+ --ignore-platform-reqs -+ --with-dependencies -+ -+ - name: Run Psalm -+ run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + # + # SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors diff --git a/patches/nextcloud/psalm.yml.patch.license b/patches/nextcloud/psalm.yml.patch.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/patches/nextcloud/psalm.yml.patch.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/patches/nextcloud/reuse.yml.patch b/patches/nextcloud/reuse.yml.patch index 8b01f84..6d6bea5 100644 --- a/patches/nextcloud/reuse.yml.patch +++ b/patches/nextcloud/reuse.yml.patch @@ -1,58 +1,19 @@ --- upstream/vendor/nextcloud/reuse.yml -+++ .github/workflows/reuse.yml -@@ -1,27 +1,28 @@ --# This workflow is provided via the organization template repository --# ++++ workflow-templates/reuse.yml +@@ -1,6 +1,6 @@ + # 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: REUSE Compliance Check -- --on: [pull_request] -- --permissions: -- contents: read -- --jobs: -- reuse-compliance-check: ++# https://github.com/LibreCodeCoop/.github + # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + + # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. +@@ -16,7 +16,7 @@ + + jobs: + reuse-compliance-check: - runs-on: ubuntu-latest-low -- steps: -- - name: Checkout -- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -- with: -- persist-credentials: false -- -- - name: REUSE Compliance Check -- uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 -+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -+# SPDX-License-Identifier: AGPL-3.0-or-later -+ -+name: REUSE Compliance Check -+ -+on: -+ workflow_call: -+ pull_request: -+ push: -+ branches: -+ - main -+ -+permissions: -+ contents: read -+ -+jobs: -+ reuse: -+ name: REUSE Compliance Check + runs-on: ubuntu-latest -+ timeout-minutes: 10 -+ steps: -+ - name: Checkout -+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -+ with: -+ persist-credentials: false -+ -+ - name: Run REUSE -+ uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/upstream/templates.json b/upstream/templates.json index 893eb37..db9334b 100644 --- a/upstream/templates.json +++ b/upstream/templates.json @@ -14,7 +14,7 @@ "patches": [ "patches/nextcloud/block-unconventional-commits.yml.patch" ], - "destination": ".github/workflows/block-unconventional-commits.yml" + "destination": "workflow-templates/block-unconventional-commits.yml" }, { "name": "nextcloud-lint-eslint", @@ -22,7 +22,7 @@ "patches": [ "patches/nextcloud/lint-eslint.yml.patch" ], - "destination": ".github/workflows/lint-eslint.yml" + "destination": "workflow-templates/lint-eslint.yml" }, { "name": "nextcloud-lint-info-xml", @@ -30,7 +30,7 @@ "patches": [ "patches/nextcloud/lint-info-xml.yml.patch" ], - "destination": ".github/workflows/lint-info-xml.yml" + "destination": "workflow-templates/lint-info-xml.yml" }, { "name": "nextcloud-lint-php", @@ -38,7 +38,7 @@ "patches": [ "patches/nextcloud/lint-php.yml.patch" ], - "destination": ".github/workflows/lint-php.yml" + "destination": "workflow-templates/lint-php.yml" }, { "name": "nextcloud-lint-php-cs", @@ -46,7 +46,7 @@ "patches": [ "patches/nextcloud/lint-php-cs.yml.patch" ], - "destination": ".github/workflows/lint-php-cs.yml" + "destination": "workflow-templates/lint-php-cs.yml" }, { "name": "nextcloud-lint-stylelint", @@ -54,7 +54,7 @@ "patches": [ "patches/nextcloud/lint-stylelint.yml.patch" ], - "destination": ".github/workflows/lint-stylelint.yml" + "destination": "workflow-templates/lint-stylelint.yml" }, { "name": "nextcloud-lint-typescript", @@ -62,7 +62,7 @@ "patches": [ "patches/nextcloud/lint-typescript.yml.patch" ], - "destination": ".github/workflows/lint-typescript.yml" + "destination": "workflow-templates/lint-typescript.yml" }, { "name": "nextcloud-node-test", @@ -70,7 +70,7 @@ "patches": [ "patches/nextcloud/node-test.yml.patch" ], - "destination": ".github/workflows/node-test.yml" + "destination": "workflow-templates/node-test.yml" }, { "name": "nextcloud-npm-build", @@ -78,7 +78,7 @@ "patches": [ "patches/nextcloud/npm-build.yml.patch" ], - "destination": ".github/workflows/npm-build.yml" + "destination": "workflow-templates/npm-build.yml" }, { "name": "nextcloud-openapi", @@ -86,7 +86,7 @@ "patches": [ "patches/nextcloud/openapi.yml.patch" ], - "destination": ".github/workflows/openapi.yml" + "destination": "workflow-templates/openapi.yml" }, { "name": "nextcloud-psalm", @@ -94,7 +94,7 @@ "patches": [ "patches/nextcloud/psalm.yml.patch" ], - "destination": ".github/workflows/psalm.yml" + "destination": "workflow-templates/psalm.yml" }, { "name": "nextcloud-reuse", @@ -102,15 +102,7 @@ "patches": [ "patches/nextcloud/reuse.yml.patch" ], - "destination": ".github/workflows/reuse.yml" - }, - { - "name": "nextcloud-lint-eslint-template", - "source": "upstream/vendor/nextcloud/lint-eslint.yml", - "patches": [ - "patches/nextcloud/lint-eslint-template.yml.patch" - ], - "destination": "workflow-templates/lint-eslint.yml" + "destination": "workflow-templates/reuse.yml" }, { "name": "nextcloud-sync-workflow-templates", diff --git a/workflow-templates/appstore-build-publish.yml b/workflow-templates/appstore-build-publish.yml index c75464f..213676b 100644 --- a/workflow-templates/appstore-build-publish.yml +++ b/workflow-templates/appstore-build-publish.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/LibreCodeCoop/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -19,9 +19,6 @@ jobs: build_and_publish: runs-on: ubuntu-latest - # Downstream consumers publish from their own repositories. - # Repository policy is enforced by the consumer. - steps: - name: Check actor permission uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 diff --git a/workflow-templates/block-unconventional-commits.yml b/workflow-templates/block-unconventional-commits.yml index 5c60dd3..cdcb2f2 100644 --- a/workflow-templates/block-unconventional-commits.yml +++ b/workflow-templates/block-unconventional-commits.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Block unconventional commits @@ -13,6 +15,22 @@ on: permissions: contents: read +concurrency: + group: block-unconventional-commits-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - conventional-commits: - uses: LibreCodeCoop/github-workflows/.github/workflows/block-unconventional-commits.yml@e2878c8c2d12d0d323116dedd2bcff37706a7eba + block-unconventional-commits: + name: Block unconventional commits + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/workflow-templates/lint-info-xml.yml b/workflow-templates/lint-info-xml.yml index e0372e1..a02c24f 100644 --- a/workflow-templates/lint-info-xml.yml +++ b/workflow-templates/lint-info-xml.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.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: Lint info.xml @@ -11,6 +13,28 @@ on: pull_request permissions: contents: read +concurrency: + group: lint-info-xml-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - lint-info-xml: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-info-xml.yml@c5f578281fa7d270b839866ebc07047287ff50d8 + xml-linters: + runs-on: ubuntu-latest + + name: info.xml lint + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + sparse-checkout: | + appinfo/ + + - name: Download schema + run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd + + - name: Lint info.xml + uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 + with: + xml-file: ./appinfo/info.xml + xml-schema-file: ./info.xsd diff --git a/workflow-templates/lint-php-cs.yml b/workflow-templates/lint-php-cs.yml index 04b650d..fc9867e 100644 --- a/workflow-templates/lint-php-cs.yml +++ b/workflow-templates/lint-php-cs.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.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: Lint php-cs @@ -11,6 +13,42 @@ on: pull_request permissions: contents: read +concurrency: + group: lint-php-cs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - lint-php-cs: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php-cs.yml@bc97b54e3d33d58d6075a0994883acde00f0556c + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Get php version + id: versions + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + - name: Set up php${{ steps.versions.outputs.php-min }} + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: ${{ steps.versions.outputs.php-min }} + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/workflow-templates/lint-php.yml b/workflow-templates/lint-php.yml index a54876f..be01aab 100644 --- a/workflow-templates/lint-php.yml +++ b/workflow-templates/lint-php.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.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: Lint php @@ -11,6 +13,64 @@ on: pull_request permissions: contents: read +concurrency: + group: lint-php-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - lint-php: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php.yml@bc97b54e3d33d58d6075a0994883acde00f0556c + matrix: + runs-on: ubuntu-latest + outputs: + php-min: ${{ steps.versions.outputs.php-min }} + php-max: ${{ steps.versions.outputs.php-max }} + steps: + - name: Checkout app + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Get version matrix + id: versions + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + php-lint: + runs-on: ubuntu-latest + needs: matrix + strategy: + matrix: + php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}'] + + name: php-lint + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: ${{ matrix.php-versions }} + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Lint + run: composer run lint + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: php-lint + + if: always() + + name: php-lint-summary + + steps: + - name: Summary status + run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi diff --git a/workflow-templates/lint-stylelint.yml b/workflow-templates/lint-stylelint.yml index 836b1dc..7b61a7e 100644 --- a/workflow-templates/lint-stylelint.yml +++ b/workflow-templates/lint-stylelint.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.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: Lint stylelint @@ -11,6 +13,41 @@ on: pull_request permissions: contents: read +concurrency: + group: lint-stylelint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - stylelint: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-stylelint.yml@bf6d298f17eacdada7d2f771cad8fe29a11ec09e + lint: + runs-on: ubuntu-latest + + name: stylelint + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/workflow-templates/lint-typescript.yml b/workflow-templates/lint-typescript.yml index 6bab826..26c881a 100644 --- a/workflow-templates/lint-typescript.yml +++ b/workflow-templates/lint-typescript.yml @@ -1,5 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Type checking @@ -13,8 +18,83 @@ on: permissions: contents: read - pull-requests: read + +concurrency: + group: lint-typescript-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - typescript: - uses: LibreCodeCoop/github-workflows/.github/workflows/lint-typescript.yml@cedd15d4962e3194f35639deda66069c469bb794 + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: changes + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/lint-typescript.yml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.ts' + - '**.vue' + + test: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci + + - name: Check types + run: | + npm run --if-present check-types + npm run --if-present ts:check + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, test] + + if: always() + + name: typescript-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/node-test.yml b/workflow-templates/node-test.yml index c06e141..a88c5c4 100644 --- a/workflow-templates/node-test.yml +++ b/workflow-templates/node-test.yml @@ -1,5 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Node tests @@ -13,8 +18,95 @@ on: permissions: contents: read - pull-requests: read + +concurrency: + group: node-tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - node-tests: - uses: LibreCodeCoop/github-workflows/.github/workflows/node-test.yml@cedd15d4962e3194f35639deda66069c469bb794 + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: changes + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/**' + - '__tests__/**' + - '__mocks__/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + + test: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci + npm run build --if-present + + - name: Test + run: npm run test --if-present + + - name: Test and process coverage + run: npm run test:coverage --if-present + + - name: Collect coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + files: ./coverage/lcov.info + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, test] + + if: always() + + name: test-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/npm-build.yml b/workflow-templates/npm-build.yml index fd95cf0..7aeabe8 100644 --- a/workflow-templates/npm-build.yml +++ b/workflow-templates/npm-build.yml @@ -1,8 +1,10 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.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 Javascript @@ -10,8 +12,102 @@ on: pull_request permissions: contents: read - pull-requests: read + +concurrency: + group: node-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - npm-build: - uses: LibreCodeCoop/github-workflows/.github/workflows/npm-build.yml@d96f4b5dcf780dea20d8843f54c4b52207dc25fd + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: changes + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + + build: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + name: NPM build + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460 + run: | + npm i -g npm-package-lock-add-resolved@1.1.4 + npm-package-lock-add-resolved + git --no-pager diff --exit-code + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + npm run build --if-present + + - name: Check build changes + run: | + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, build] + + if: always() + + # This is the summary, we just avoid to rename it so that branch protection rules still match + name: node + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/openapi.yml b/workflow-templates/openapi.yml index fa6fdde..a752d09 100644 --- a/workflow-templates/openapi.yml +++ b/workflow-templates/openapi.yml @@ -1,8 +1,11 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2024 Arthur Schiwon +# SPDX-License-Identifier: MIT name: OpenAPI @@ -11,6 +14,83 @@ on: pull_request permissions: contents: read +concurrency: + group: openapi-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: openapi: - uses: LibreCodeCoop/github-workflows/.github/workflows/openapi.yml@bfd8f06a82ff2fdd95becc1f752363c640f314ca + runs-on: ubuntu-latest + + if: ${{ github.repository_owner != 'nextcloud-gmbh' }} + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Get php version + id: php_versions + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + - name: Set up php + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: ${{ steps.php_versions.outputs.php-available }} + extensions: xml + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check Typescript OpenApi types + id: check_typescript_openapi + uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 + with: + files: "src/types/openapi/openapi*.ts" + + - name: Read package.json node and npm engines version + if: steps.check_typescript_openapi.outputs.files_exists == 'true' + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: node_versions + # Continue if no package.json + continue-on-error: true + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} + if: ${{ steps.node_versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.node_versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} + if: ${{ steps.node_versions.outputs.nodeVersion }} + run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' + + - name: Install dependencies + if: ${{ steps.node_versions.outputs.nodeVersion }} + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Regenerate OpenAPI + run: composer run openapi + + - name: Check openapi*.json and typescript changes + run: | + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and (if applicable) src/types/openapi/openapi*.ts, see the section \"Show changes on failure\" for details' && exit 1)" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention diff --git a/workflow-templates/psalm.yml b/workflow-templates/psalm.yml index b7fa510..33dfdec 100644 --- a/workflow-templates/psalm.yml +++ b/workflow-templates/psalm.yml @@ -1,16 +1,61 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later - -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT name: Static analysis on: pull_request +concurrency: + group: psalm-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: read jobs: - psalm: - uses: LibreCodeCoop/github-workflows/.github/workflows/psalm.yml@bedd8421ad6c95914f10f0dc631333223d17c515 + static-analysis: + runs-on: ubuntu-latest + + name: static-psalm-analysis + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Get php version + id: versions + uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 + + - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml + run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml + + - name: Set up php${{ steps.versions.outputs.php-available }} + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: ${{ steps.versions.outputs.php-available }} + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + # Temporary workaround for missing pcntl_* in PHP 8.3 + ini-values: disable_functions= + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} + run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies + + - name: Run coding standards check + run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/workflow-templates/reuse.yml b/workflow-templates/reuse.yml index 2f96be6..3edce05 100644 --- a/workflow-templates/reuse.yml +++ b/workflow-templates/reuse.yml @@ -1,16 +1,27 @@ -# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors -# SPDX-License-Identifier: AGPL-3.0-or-later +# This workflow is provided via the organization template repository +# +# https://github.com/LibreCodeCoop/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# This workflow is published through the LibreCode organization catalog. -# Implementation: LibreCodeCoop/github-workflows +# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. +# +# SPDX-License-Identifier: CC0-1.0 name: REUSE Compliance Check -on: pull_request +on: [pull_request] permissions: contents: read jobs: - reuse: - uses: LibreCodeCoop/github-workflows/.github/workflows/reuse.yml@5c8e231dae8e4fa1764fe84b552c48f45b6d39e8 + reuse-compliance-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: REUSE Compliance Check + uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0