diff --git a/.editorconfig b/.editorconfig index ddb3e039..2d273651 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,14 @@ root = true +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + [*.yml] indent_size = 2 indent_style = space diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.md b/.github/ISSUE_TEMPLATE/1_bug_report.md deleted file mode 100644 index 7e1cf132..00000000 --- a/.github/ISSUE_TEMPLATE/1_bug_report.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -name: 🐞 Bug report -about: Help us to improve by reporting a bug -labels: 0. Needs triage, bug ---- - - - -### How to use GitHub - -* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue. -* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue. -* Subscribe to receive notifications on status change and new comments. - ---- - -### Steps to reproduce -1. -2. -3. - -### Expected behaviour -Tell us what should happen - -### Actual behaviour -Tell us what happens instead, if possible also add a screenshot - -### Server configuration - -**Web server:** Apache/Nginx - -**Database:** MySQL/Maria/SQLite/PostgreSQL - -**PHP version:** 8.5/8.4/8.3 - -**Nextcloud version:** (see Nextcloud admin page) - -
-List of activated apps - -``` -If you have access to your command line run e.g.: -sudo -u www-data php occ app:list -from within your Nextcloud installation folder -``` -
- -
-Nextcloud configuration - -``` -If you have access to your command line run e.g.: -sudo -u www-data php occ config:list system -from within your Nextcloud installation folder -``` -
- -### Browser - -**Browser name:** Firefox/Chrome/Safari/… - -**Browser version:** 124/125/… - -**Operating system:** Windows/Ubuntu/Mac/… - -
-Browser log - -``` -Insert your browser log here, this could for example include: -a) The javascript console log -b) The network log -c) ... -``` - -
diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.md.license b/.github/ISSUE_TEMPLATE/1_bug_report.md.license deleted file mode 100644 index 32990c01..00000000 --- a/.github/ISSUE_TEMPLATE/1_bug_report.md.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors -SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.md b/.github/ISSUE_TEMPLATE/2_feature_request.md deleted file mode 100644 index 94b0eaac..00000000 --- a/.github/ISSUE_TEMPLATE/2_feature_request.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: 🚀 Feature request -about: Suggest an idea for this app -labels: 0. Needs triage, enhancement ---- - - - -### How to use GitHub - -* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature. -* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue. -* Subscribe to receive notifications on status change and new comments. - ---- - -## Feature request - -**Which Nextcloud Version are you currently using:** (see administration page) - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.md.license b/.github/ISSUE_TEMPLATE/2_feature_request.md.license deleted file mode 100644 index 3e87d1c6..00000000 --- a/.github/ISSUE_TEMPLATE/2_feature_request.md.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors -SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index f60e14c6..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: AGPL-3.0-or-later -contact_links: - - name: 🚨 Report a security or privacy issue - url: https://hackerone.com/nextcloud - about: Report security and privacy related issues privately to the Nextcloud team, so we can coordinate the fix and release without potentially exposing all Nextcloud servers and users in the meantime. - - name: 🚨 报告安全或隐私问题 - url: https://hackerone.com/nextcloud - about: 请以私密方式向 Nextcloud 团队报告安全和隐私相关问题,以便我们能够协调修复工作并安排发布计划,避免在此期间可能暴露所有 Nextcloud 服务器和用户的风险。 - - name: ❓ Community Support and Help - url: https://help.nextcloud.com/ - about: Configuration, webserver/proxy or performance issues and other questions - - name: 💼 Nextcloud Enterprise - url: https://portal.nextcloud.com/ - about: If you are a Nextcloud Enterprise customer, or need Professional support, so it can be resolved directly by our dedicated engineers more quickly diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 24a59e9a..382fae08 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,8 +17,6 @@ updates: interval: daily time: "03:00" timezone: Europe/Berlin - cooldown: - default-days: 7 - package-ecosystem: "github-actions" directory: ".github/workflows" @@ -30,5 +28,3 @@ updates: day: saturday time: "03:00" timezone: Europe/Berlin - cooldown: - default-days: 7 diff --git a/.github/workflows/ai-policy.yml b/.github/workflows/ai-policy.yml index 4b4653ee..b3d1ae9b 100644 --- a/.github/workflows/ai-policy.yml +++ b/.github/workflows/ai-policy.yml @@ -27,7 +27,7 @@ concurrency: jobs: check-ai-trailers: - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Collect PR commit messages id: collect diff --git a/.github/workflows/block-unconventional-commits.yml b/.github/workflows/block-unconventional-commits.yml index bcc722a6..d6930d37 100644 --- a/.github/workflows/block-unconventional-commits.yml +++ b/.github/workflows/block-unconventional-commits.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.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 @@ jobs: block-unconventional-commits: name: Block unconventional commits - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml index 69da2bbb..d30a43d6 100644 --- a/.github/workflows/fixup.yml +++ b/.github/workflows/fixup.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -27,7 +27,7 @@ jobs: pull-requests: write name: Block fixup and squash commits - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Run check diff --git a/.github/workflows/lint-yaml.yml b/.github/workflows/lint-yaml.yml index 0c9d1f1c..12666005 100644 --- a/.github/workflows/lint-yaml.yml +++ b/.github/workflows/lint-yaml.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.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/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 0f39e9f0..2f4b2f2f 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. diff --git a/.github/workflows/update-workflows.yml b/.github/workflows/update-workflows.yml new file mode 100644 index 00000000..b024b5f5 --- /dev/null +++ b/.github/workflows/update-workflows.yml @@ -0,0 +1,87 @@ +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Sync workflows with Nextcloud + +on: + workflow_dispatch: + schedule: + - cron: "0 18 * * 0" + +permissions: + contents: read + +jobs: + sync-workflows: + name: Sync workflows + runs-on: ubuntu-latest + + permissions: + issues: write + strategy: + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup git + run: | + git config --local user.email "nextcloud-command@users.noreply.github.com" + git config --local user.name "nextcloud-command" + git remote add upstream '${{ env.GIT_UPSTREAM }}' + git fetch upstream + env: + GIT_UPSTREAM: https://github.com/nextcloud/.github.git + + - name: Merge upstream + id: merge + run: | + if (git merge --no-commit --no-ff -Xours 'upstream/${{ env.GIT_BRANCH }}' || echo 'conflicts') | grep 'Already up to date' ; then + exit 0 + fi + echo "trying to remove files deleted by us..." + git diff --name-only --diff-filter=DU | xargs -r git rm + # only sync workflow templates and the repo workflows + git status --porcelain | cut -c4- | grep -vP "(workflow-templates|.github/workflows)" | xargs -r git checkout HEAD + git commit -sm 'chore: merge updated from Nextcloud organization' + env: + GIT_BRANCH: master + + - name: Check changes + id: changes + continue-on-error: true + run: | + git status -uno | grep 'branch is ahead of' + + - name: Create Pull Request + if: steps.merge.outcome == 'success' && steps.changes.outcome == 'success' + id: pull-request + continue-on-error: true + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + token: ${{ secrets.SYNC_TOKEN }} + commit-message: 'chore: update workflows from Nextcloud organization' + committer: GitHub + author: nextcloud-command + signoff: true + branch: automated/sync-workflows + title: 'chore: sync workflows from Nextcloud organization' + labels: | + 3. to review + + - name: Raise on issue on failure + if: failure() && (steps.pull-request.outcome == 'failure' || steps.merge.outcome == 'failure') + uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: 'Failed to sync workflows' + body: 'Please check the output of the GitHub action and manually merge the latest changes
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' + + - name: Summary + if: failure() && steps.changes.outcome == 'failure' + run: | + echo "No changes detected." diff --git a/AGENT_MD_SNIPPETS.md b/AGENT_MD_SNIPPETS.md index 73de1851..6a069f76 100644 --- a/AGENT_MD_SNIPPETS.md +++ b/AGENT_MD_SNIPPETS.md @@ -7,8 +7,8 @@ All contributions generated or assisted by this agent must fully comply with: -- **[AI Contribution Policy](https://github.com/nextcloud/.github/blob/master/AI_POLICY.md)** - the primary reference for AI-specific rules, covering disclosure, author accountability, communication, security, licensing, code quality, and autonomous agent behavior. -- **[Contribution Guidelines](https://github.com/nextcloud/.github/blob/master/CONTRIBUTING.md)** - covering testing requirements, the Developer Certificate of Origin (DCO), license headers, conventional commits, and translations. These apply in full to all contributions regardless of how they were produced. +- **[AI Contribution Policy](https://github.com/nextcloud-libraries/.github/blob/master/AI_POLICY.md)** - the primary reference for AI-specific rules, covering disclosure, author accountability, communication, security, licensing, code quality, and autonomous agent behavior. +- **[Contribution Guidelines](https://github.com/nextcloud-libraries/.github/blob/master/CONTRIBUTING.md)** - covering testing requirements, the Developer Certificate of Origin (DCO), license headers, conventional commits, and translations. These apply in full to all contributions regardless of how they were produced. ### What this agent must always do diff --git a/AI_POLICY.md b/AI_POLICY.md index 53b45471..e9e14dec 100644 --- a/AI_POLICY.md +++ b/AI_POLICY.md @@ -5,7 +5,7 @@ # AI Contribution Policy -This document provides guidance for AI tools and developers using AI assistance when contributing to Nextcloud. It applies to all repositories under the [Nextcloud GitHub organization](https://github.com/nextcloud/), including the server, clients, apps, and the community app ecosystem. +This document provides guidance for AI tools and developers using AI assistance when contributing to Nextcloud. It applies to all repositories under the [Nextcloud GitHub organization](https://github.com/nextcloud/) and the [Nextcloud Libraries GitHub organization](https://github.com/nextcloud-libraries/), including the server, clients, apps, and the community app ecosystem. This policy complements the existing [Contribution Guidelines](CONTRIBUTING.md). The requirements around testing, the Developer Certificate of Origin, license headers, and security reporting described there continue to apply in full - this document addresses how they extend to AI-assisted contributions. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f6d46f4..6b6e87e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,4 +78,4 @@ In case you are not sure how to add or update the license header correctly pleas ## Translations Please submit translations via [Transifex][transifex]. -[transifex]: https://explore.transifex.com/nextcloud +[transifex]: https://www.transifex.com/nextcloud diff --git a/LICENSES/AGPL-3.0-or-later.txt b/LICENSES/AGPL-3.0-or-later.txt deleted file mode 100644 index 0c97efd2..00000000 --- a/LICENSES/AGPL-3.0-or-later.txt +++ /dev/null @@ -1,235 +0,0 @@ -GNU AFFERO GENERAL PUBLIC LICENSE -Version 3, 19 November 2007 - -Copyright (C) 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - - Preamble - -The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. - -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - -Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. - -A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. - -The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. - -An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. - -The precise terms and conditions for copying, distribution and modification follow. - - TERMS AND CONDITIONS - -0. Definitions. - -"This License" refers to version 3 of the GNU Affero General Public License. - -"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - -"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. - -To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. - -A "covered work" means either the unmodified Program or a work based on the Program. - -To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - -To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - -1. Source Code. -The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. - -A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - -The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - -The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - -8. Termination. - -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - -9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - -11. Patents. - -A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - -In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - -A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - -12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - -13. Remote Network Interaction; Use with the GNU General Public License. - -Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. - -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. - -14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - -15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. - -You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . diff --git a/LICENSES/LicenseRef-NextcloudTrademarks.txt b/LICENSES/LicenseRef-NextcloudTrademarks.txt deleted file mode 100644 index 464a30b5..00000000 --- a/LICENSES/LicenseRef-NextcloudTrademarks.txt +++ /dev/null @@ -1,9 +0,0 @@ -The Nextcloud marks -Nextcloud and the Nextcloud logo is a registered trademark of Nextcloud GmbH in Germany and/or other countries. -These guidelines cover the following marks pertaining both to the product names and the logo: “Nextcloud” -and the blue/white cloud logo with or without the word Nextcloud; the service “Nextcloud Enterprise”; -and our products: “Nextcloud Files”; “Nextcloud Groupware” and “Nextcloud Talk”. -This set of marks is collectively referred to as the “Nextcloud marks.” - -Use of Nextcloud logos and other marks is only permitted under the guidelines provided by the Nextcloud GmbH. -A copy can be found at https://nextcloud.com/trademarks/ diff --git a/README.md b/README.md index 7bbe9ce1..81854ee5 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,11 @@ SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors SPDX-License-Identifier: MIT --> -# This repository contains Nextcloud's workflow templates +# This repository contains Nextcloud's workflow templates for libraries ## Set up a new template on your repository When creating a new workflow on your repository, you will see templates originating from here. -https://github.com/nextcloud/viewer/actions/new - -![image](https://raw.githubusercontent.com/nextcloud/.github/master/screenshots/choose-a-workflow.png) ## Auto-update in a repository @@ -39,7 +36,7 @@ If there was an error it will be outlined in the PR description. ## Update workflows manually -You can also run the following shell script on your machine to update all workflows of an app. It should be run inside the cloned repository of an app and requires rsync to be installed. +You can run the following shell script on your machine to update all workflows of an app. It should be run inside the cloned repository of an app and requires rsync to be installed. > [!WARNING] > Do not forget to check the diff for unwanted changes before committing, especially when updating the workflows on stable branches! @@ -55,7 +52,7 @@ You can also run the following shell script on your machine to update all workfl # Clone template repository temp="$(mktemp -d)" -git clone --depth=1 https://github.com/nextcloud/.github.git "$temp" +git clone --depth=1 https://github.com/nextcloud-libraries/.github.git "$temp" # Update workflows rsync -vr \ diff --git a/REUSE.toml b/REUSE.toml index ec830af8..f2d7f733 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -10,9 +10,3 @@ path = "workflow-templates/**.properties.json" precedence = "aggregate" SPDX-FileCopyrightText = "2021-2024 Nextcloud GmbH and Nextcloud contributors" SPDX-License-Identifier = "MIT" - -[[annotations]] -path = "screenshots/**" -precedence = "aggregate" -SPDX-FileCopyrightText = "2022-2025 Nextcloud GmbH and Nextcloud contributors" -SPDX-License-Identifier = "MIT" diff --git a/SECURITY.md b/SECURITY.md index 4306758a..9a6e1aa2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,52 +3,55 @@ SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors SPDX-License-Identifier: MIT --> -# Security Policy +# 💡 TLDR: Report issues at [hackerone.com/nextcloud](https://hackerone.com/nextcloud) -## 💡 TLDR: Report security issues at [hackerone.com/nextcloud](https://hackerone.com/nextcloud) +# Security Policy -### Found a security bug in Nextcloud? Let's get it fixed! +[Security](https://nextcloud.com/security/) is very important to us. If you believe you have found an issue that meets our [definition of a security vulnerability](https://nextcloud.com/security/threat-model), we encourage you to let us know right away. Please use the reporting process described below. -| If you are a... | See section... | -|-------------------------|---------------------------------------------------------------------------------------| -| Security Researcher | [How to Report a Vulnerability](#how-to-report-a-vulnerability) | -| Nextcloud Admin or User | [Security Advisories](#security-advisories), [Supported Versions](#supported-versions) | +## Context ---- +Please review our [threat model and accepted risks](https://nextcloud.com/security/threat-model) to learn what +is currently considered a security vulnerability versus expected behavior. And review what is considered +[in scope or bounty eligible](https://hackerone.com/nextcloud/policy_scopes). -## How to Report a Vulnerability -**⚠️ Do _not_ report security vulnerabilities through public GitHub issues.** +## Reporting a Vulnerability -Instead, please: -- Review our [responsible disclosure guidelines](https://nextcloud.com/security/) -- Submit your report via [HackerOne](https://hackerone.com/nextcloud) +**⚠️ Please do _not_ report security vulnerabilities through public GitHub issues.** + +If you have discovered a security matter with Nextcloud, please read our +[responsible disclosure guidelines](https://nextcloud.com/security/) and contact us at +[hackerone.com/nextcloud](https://hackerone.com/nextcloud). Your report should include: + - Product version -- A clear description of the vulnerability -- Steps to reproduce the issue (clear, step-by-step instructions are greatly appreciated) -- Any other details that may assist our investigation +- A vulnerability description +- Reproduction steps +- Any other details you think are likely to be important -If you require encrypted communication, please request it in your initial message. +### What to Expect > **Note:** This process is for confidential reporting of software vulnerabilities only. > For general support or configuration help, see > [Nextcloud Support](https://nextcloud.com/support/). -## What to Expect After Reporting +A member of the security team will confirm the vulnerability, determine its impact, follow-up with any questions, +and coordinate the fix and publication. -In most cases, you should receive an initial response within 24 hours. +The fix will be applied to all applicable and still supported stable branches, tested, and packaged in the next security release. +The vulnerability will be publicly announced after the release. Finally, your name will be added +to the [hall of fame](https://hackerone.com/nextcloud/thanks) as a thank you from the entire Nextcloud +community. -A member of our security team will: -- Confirm the vulnerability -- Assess its impact -- Follow up with any questions -- Coordinate the fix and public disclosure +If the vulnerability involves an app that is not maintained by Nextcloud (i.e. hosted by the +Nextcloud project but community maintained, or hosted elsewhere), the security team will try to coordinate with the +current maintainer and help to get the issue fixed in similar fashion. We apply, test, and release fixes for all relevant, supported stable branches in the next security update. Vulnerabilities are publicly announced after the fix is released. As a thank @@ -58,7 +61,7 @@ If your report concerns an app not maintained by Nextcloud (e.g., community-main hosted by Nextcloud or hosted elsewhere), our security team will coordinate with the current maintainer to help resolve the issue in a similar fashion. -## Bug Bounties +## Existing Security Advisories If you are interested in a bug bounty, please note that complete, detailed reports can contribute to higher bounty awards. Details on past bounties are available at @@ -92,6 +95,5 @@ for details. ## Additional Information -- [Nextcloud Security Overview](https://nextcloud.com/security/) -- [Threat Model and Accepted Risks](https://nextcloud.com/security/threat-model) -- [Nextcloud Support](https://nextcloud.com/support/) +Please visit [https://nextcloud.com/security/](https://nextcloud.com/security/) for further information about Nextcloud security. +Please visit [https://nextcloud.com/security/threat-model](https://nextcloud.com/security/threat-model) for our threat model and accepted risks. diff --git a/non-community-usernames.txt b/non-community-usernames.txt deleted file mode 100644 index a92ed532..00000000 --- a/non-community-usernames.txt +++ /dev/null @@ -1,51 +0,0 @@ -andrey18106 -bigcat88 -burdoto -CarlSchwan -Chartman123 -cristianscheid -dartcafe -datenangebot -DerDreschner -edward-ly -elzody -enjeck -grnd-alt -hweihwang -individual-it -Ivansss -janepie -jaylinski -joshtrichards -JuliaKirschenheuter -Koc -kra-mo -lukasdotcom -max65482 -MB-Finski -mejo- -mgallien -Minion3665 -nc-fkl -nextcloud-android-bot -nextcloud-bot -nextcloud-command -nfebe -odzhychko -Pytal -raimund-schluessler -rakekniven -rapterjet2004 -salmart-dev -SebastianKrupinski -skalidindi53 -skjnldsv -solracsf -sowjanyakch -st3iny -sudormant -susnux -tcitworld -viktorix -Yuvrajsinghspd09 -ZetaTom diff --git a/non-community-usernames.txt.license b/non-community-usernames.txt.license deleted file mode 100644 index 9b565d56..00000000 --- a/non-community-usernames.txt.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: Nextcloud -SPDX-License-Identifier: CC0-1.0 diff --git a/profile/README.md b/profile/README.md deleted file mode 100644 index c78ba7e4..00000000 --- a/profile/README.md +++ /dev/null @@ -1,41 +0,0 @@ - - -# Nextcloud -**A safe home for all your data.** - -![Files view shown in browser and the iOS app](https://raw.githubusercontent.com/nextcloud/screenshots/master/nextcloud-hub-25-files.png) - -## Why is this so awesome? 🤩 - -* 📁 **Access your Data** You can store your files, contacts, calendars, conversations and more on a server of your choosing. -* 🔄 **Sync your Data** You keep your files, contacts, calendars, and more synchronized amongst your devices. -* 🙌 **Share your Data** …by giving others access to the stuff you want them to see or to collaborate with. -* 🚀 **Expandable with hundreds of Apps** ...like [Calendar](https://github.com/nextcloud/calendar), [Contacts](https://github.com/nextcloud/contacts), [Mail](https://github.com/nextcloud/mail), [Video Chat](https://github.com/nextcloud/spreed) and all those you can discover in our [App Store](https://apps.nextcloud.com) -* 🔒 **Security** with our encryption mechanisms, [HackerOne bounty program](https://hackerone.com/nextcloud) and two-factor authentication. - -Do you want to learn more about how you can use Nextcloud to access, share and protect your files, calendars, contacts, communication & more at home and in your organization? [**Learn about all our Features**](https://nextcloud.com). - -## Get your Nextcloud 🚚 - -- ☑️ [**Simply sign up**](https://nextcloud.com/signup/) at one of our providers either through our website or through the apps directly. -- 🖥 [**Install** a server by yourself](https://nextcloud.com/install/#instructions-server) on your hardware or by using one of our ready to use **appliances** -- 📦 Buy one of the [awesome **devices** coming with a preinstalled Nextcloud](https://nextcloud.com/devices/) -- 🏢 Find a [service **provider**](https://nextcloud.com/partners/) who hosts Nextcloud for you or your company - -Enterprise? Public Sector or Education user? You may want to have a look into [**Nextcloud Enterprise**](https://nextcloud.com/enterprise/) provided by Nextcloud GmbH. - -## Get in touch 💬 - -* [📋 Forum](https://help.nextcloud.com) -* [👥 Facebook](https://www.facebook.com/nextclouders) -* [🐣 Bluesky](https://bsky.app/profile/nextcloud.bsky.social) -* [🐘 Mastodon](https://mastodon.xyz/@nextcloud) - -You can also [get support for Nextcloud](https://nextcloud.com/support)! - -## Join the team 👪 - -There are many ways to contribute, of which development is only one! Find out [how to get involved](https://nextcloud.com/contribute/), including as a [translator](https://help.nextcloud.com/t/translation-knowledge-valid-for-the-entire-nextcloud-project-wiki/51550), designer, tester, helping others, and much more! 😍 diff --git a/screenshots/choose-a-workflow.png b/screenshots/choose-a-workflow.png deleted file mode 100644 index a087bd5e..00000000 Binary files a/screenshots/choose-a-workflow.png and /dev/null differ diff --git a/screenshots/dispatch-a-workflow.png b/screenshots/dispatch-a-workflow.png deleted file mode 100644 index fb4bc847..00000000 Binary files a/screenshots/dispatch-a-workflow.png and /dev/null differ diff --git a/workflow-templates/ai-policy.yml b/workflow-templates/ai-policy.yml index 4b4653ee..b3d1ae9b 100644 --- a/workflow-templates/ai-policy.yml +++ b/workflow-templates/ai-policy.yml @@ -27,7 +27,7 @@ concurrency: jobs: check-ai-trailers: - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Collect PR commit messages id: collect diff --git a/workflow-templates/appstore-build-publish.properties.json b/workflow-templates/appstore-build-publish.properties.json deleted file mode 100644 index 11b3722a..00000000 --- a/workflow-templates/appstore-build-publish.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Build, sign and push to the appstore", - "description": "On release, build a npm app, sign it, attach to the release and publish to the appstore.`", - "iconName": "appstore-build-publish" -} diff --git a/workflow-templates/appstore-build-publish.svg b/workflow-templates/appstore-build-publish.svg deleted file mode 100644 index 6b86948b..00000000 --- a/workflow-templates/appstore-build-publish.svg +++ /dev/null @@ -1,5 +0,0 @@ - - \ No newline at end of file diff --git a/workflow-templates/appstore-build-publish.yml b/workflow-templates/appstore-build-publish.yml deleted file mode 100644 index c4cf97f7..00000000 --- a/workflow-templates/appstore-build-publish.yml +++ /dev/null @@ -1,202 +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] - -permissions: - contents: write - -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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: ${{ env.APP_NAME }} - - - name: Get app version number - id: app-version - uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0 - 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@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0 - 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: '^24' - fallbackNpm: '^11.3' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - # Skip if no package.json - if: ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - package-manager-cache: false - - - 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@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - - - name: Set up php ${{ steps.php-versions.outputs.php-min }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - 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@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: "${{ env.APP_NAME }}/composer.json" - - - name: Install composer dependencies - if: steps.check_composer.outputs.files_exists == 'true' - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - composer-options: '--no-dev' - working-directory: ${{ env.APP_NAME }} - ignore-cache: 'yes' - - - 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@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.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: Check server download link for ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} - run: | - NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}' - DOWNLOAD_URL=$(curl -s "https://updates.nextcloud.com/updater_server/latest?channel=beta&version=$NCVERSION" | jq -r '.downloads.zip[0]') - echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV - - - name: Download server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} - continue-on-error: true - id: server-download - if: ${{ env.DOWNLOAD_URL != 'null' }} - run: | - echo "Downloading release tarball from $DOWNLOAD_URL" - wget $DOWNLOAD_URL -O nextcloud.zip - unzip nextcloud.zip - - - name: Checkout server master fallback - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - if: ${{ steps.server-download.outcome != 'success' }} - with: - persist-credentials: false - 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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5 - 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.0.3 - 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/workflow-templates/block-merge-eol.properties.json b/workflow-templates/block-merge-eol.properties.json deleted file mode 100644 index 9133d1b4..00000000 --- a/workflow-templates/block-merge-eol.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Block merging for EOL branches", - "description": "If trying to merge a PR against a stablexx branch, testing our updater server to check if the version is end-of-life. If so, merging will require Admin's approval.", - "iconName": "octicon git-pull-request-closed" -} diff --git a/workflow-templates/block-merge-eol.yml b/workflow-templates/block-merge-eol.yml deleted file mode 100644 index ab049456..00000000 --- a/workflow-templates/block-merge-eol.yml +++ /dev/null @@ -1,49 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Block merges for EOL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: block-merge-eol-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-merges-eol: - name: Block merges for EOL branches - - # Only run on stableXX branches - if: startsWith( github.base_ref, 'stable') - runs-on: ubuntu-latest-low - - steps: - - name: Set server major version environment - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const regex = /^stable(\d+)$/ - const baseRef = context.payload.pull_request.base.ref - const match = baseRef.match(regex) - if (match) { - console.log('Setting server_major to ' + match[1]); - core.exportVariable('server_major', match[1]); - console.log('Setting current_day to ' + (new Date()).toISOString().substr(0, 10)); - core.exportVariable('current_day', (new Date()).toISOString().substr(0, 10)); - } - - - name: Checking if server ${{ env.server_major }} is EOL - if: ${{ env.server_major != '' }} - run: | - curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \ - | jq '.["${{ env.server_major }}"]["eol"] // "9999-99-99" | . >= "${{ env.current_day }}"' \ - | grep -q true diff --git a/workflow-templates/block-merge-freeze.properties.json b/workflow-templates/block-merge-freeze.properties.json deleted file mode 100644 index 516ac932..00000000 --- a/workflow-templates/block-merge-freeze.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Block merging during freeze", - "description": "Add a failing github action when the server base branch is in RC phase", - "iconName": "octicon git-pull-request-closed" -} diff --git a/workflow-templates/block-merge-freeze.yml b/workflow-templates/block-merge-freeze.yml deleted file mode 100644 index 3a9d5cc3..00000000 --- a/workflow-templates/block-merge-freeze.yml +++ /dev/null @@ -1,57 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Block merges during freezes - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: block-merge-freeze-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-merges-during-freeze: - name: Block merges during freezes - - if: github.event.pull_request.draft == false - - runs-on: ubuntu-latest-low - - steps: - - name: Register server reference to fallback to master branch - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const baseRef = context.payload.pull_request.base.ref - if (baseRef === 'main' || baseRef === 'master') { - core.exportVariable('server_ref', 'master'); - console.log('Setting server_ref to master'); - } else { - const regex = /^stable(\d+)$/ - const match = baseRef.match(regex) - if (match) { - core.exportVariable('server_ref', match[0]); - console.log('Setting server_ref to ' + match[0]); - } else { - console.log('Not based on master/main/stable*, so skipping freeze check'); - } - } - - - name: Download version.php from ${{ env.server_ref }} - if: ${{ env.server_ref != '' }} - run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php - - - name: Run check - if: ${{ env.server_ref != '' }} - run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC' diff --git a/workflow-templates/block-unconventional-commits.yml b/workflow-templates/block-unconventional-commits.yml index bcc722a6..d6930d37 100644 --- a/workflow-templates/block-unconventional-commits.yml +++ b/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://github.com/nextcloud-libraries/.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 @@ jobs: block-unconventional-commits: name: Block unconventional commits - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Checkout diff --git a/workflow-templates/command-compile.properties.json b/workflow-templates/command-compile.properties.json deleted file mode 100644 index d5f37e38..00000000 --- a/workflow-templates/command-compile.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Compile node workflow", - "description": "Compile and commit node assets.\nExample: `/compile [[rebase][-][amend|fixup]] /[path/to/assets]`", - "iconName": "octicon package" -} diff --git a/workflow-templates/command-compile.yml b/workflow-templates/command-compile.yml deleted file mode 100644 index 3a0da7a0..00000000 --- a/workflow-templates/command-compile.yml +++ /dev/null @@ -1,235 +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: Compile Command -on: - issue_comment: - types: [created] - -permissions: - contents: read - -jobs: - init: - runs-on: ubuntu-latest-low - - # On pull requests and if the comment starts with `/compile` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/compile') - - outputs: - git_path: ${{ steps.git-path.outputs.path }} - arg1: ${{ steps.command.outputs.arg1 }} - arg2: ${{ steps.command.outputs.arg2 }} - head_ref: ${{ steps.comment-branch.outputs.head_ref }} - base_ref: ${{ steps.comment-branch.outputs.base_ref }} - - steps: - - name: Get repository from pull request comment - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - id: get-repository - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const pull = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - const repositoryName = pull.data.head?.repo?.full_name - console.log(repositoryName) - return repositoryName - - - name: Disabled on forks - if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }} - run: | - echo 'Can not execute /compile on forks' - exit 1 - - - name: Check actor permission - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 - with: - require: write - - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '+1' - - - name: Parse command - uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1 - id: command - - # Init path depending on which command is run - - name: Init path - id: git-path - run: | - if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then - echo "path=${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT - else - echo "path=${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT - fi - - - name: Init branch - uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0 - id: comment-branch - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' - - process: - runs-on: ubuntu-latest - needs: init - - steps: - - name: Restore cached git repository - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: .git - key: git-repo - - - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - token: ${{ secrets.COMMAND_BOT_PAT }} - fetch-depth: 0 - ref: ${{ needs.init.outputs.head_ref }} - - - name: Setup git - run: | - git config --local user.email 'nextcloud-command@users.noreply.github.com' - git config --local user.name 'nextcloud-command' - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: package-engines-versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} - cache: npm - - - name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.npmVersion }}' - - - name: Rebase to ${{ needs.init.outputs.base_ref }} - if: ${{ contains(needs.init.outputs.arg1, 'rebase') }} - env: - BASE_REF: ${{ needs.init.outputs.base_ref }} - run: | - git fetch origin "${BASE_REF}:${BASE_REF}" - - # Start the rebase - git rebase "origin/${BASE_REF}" || { - # Handle rebase conflicts in a loop - while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do - echo "Handling rebase conflict..." - - # Remove and checkout /dist and /js folders from the base branch - if [ -d "dist" ]; then - rm -rf dist - git checkout "origin/${BASE_REF}" -- dist/ 2>/dev/null || echo "No dist folder in base branch" - fi - if [ -d "js" ]; then - rm -rf js - git checkout "origin/${BASE_REF}" -- js/ 2>/dev/null || echo "No js folder in base branch" - fi - - # Stage all changes - git add . - - # Check if there are any changes after resolving conflicts - if git diff --cached --quiet; then - echo "No changes after conflict resolution, skipping commit" - git rebase --skip - else - echo "Changes found, continuing rebase without editing commit message" - git -c core.editor=true rebase --continue - fi - - # Break if rebase is complete - if [ ! -d .git/rebase-merge ] && [ ! -d .git/rebase-apply ]; then - break - fi - done - } - - - name: Install dependencies & build - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - npm run build --if-present - - - name: Commit default - if: ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }} - env: - GIT_PATH: ${{ needs.init.outputs.git_path }} - run: | - git add "${GITHUB_WORKSPACE}${GIT_PATH}" - git commit --signoff -m 'chore(assets): Recompile assets' - - - name: Commit fixup - if: ${{ contains(needs.init.outputs.arg1, 'fixup') }} - env: - GIT_PATH: ${{ needs.init.outputs.git_path }} - run: | - git add "${GITHUB_WORKSPACE}${GIT_PATH}" - git commit --fixup=HEAD --signoff - - - name: Commit amend - if: ${{ contains(needs.init.outputs.arg1, 'amend') }} - env: - GIT_PATH: ${{ needs.init.outputs.git_path }} - run: | - git add "${GITHUB_WORKSPACE}${GIT_PATH}" - git commit --amend --no-edit --signoff - # Remove any [skip ci] from the amended commit - git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')" - - - name: Push normally - if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }} - env: - HEAD_REF: ${{ needs.init.outputs.head_ref }} - BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env] - run: | - git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git" - git push origin "$HEAD_REF" - - - name: Force push - if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }} - env: - HEAD_REF: ${{ needs.init.outputs.head_ref }} - BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env] - run: | - git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git" - git push --force-with-lease origin "$HEAD_REF" - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' diff --git a/workflow-templates/command-l10n-update.properties.json b/workflow-templates/command-l10n-update.properties.json new file mode 100644 index 00000000..57e122e2 --- /dev/null +++ b/workflow-templates/command-l10n-update.properties.json @@ -0,0 +1,5 @@ +{ + "name": "Update translations command", + "description": "Extract translations and commits them onto the current pull request.", + "iconName": "octicon accessibility" +} diff --git a/workflow-templates/command-l10n-update.yml b/workflow-templates/command-l10n-update.yml new file mode 100644 index 00000000..f705592c --- /dev/null +++ b/workflow-templates/command-l10n-update.yml @@ -0,0 +1,108 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud-libraries/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Command L10n Update +on: + issue_comment: + types: [created] +permissions: + contents: read + +jobs: + init: + runs-on: ubuntu-latest + + # On pull requests and if the comment starts with `/l10n-update` + if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/l10n-update') + + outputs: + arg1: ${{ steps.command.outputs.arg1 }} + head_ref: ${{ steps.comment-branch.outputs.head_ref }} + + steps: + - name: Add reaction on start + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reactions: '+1' + + - name: Parse command + uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1 + id: command + + - name: Init branch + uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0 + id: comment-branch + + process: + runs-on: ubuntu-latest + needs: init + + steps: + - name: Checkout ${{ needs.init.outputs.head_ref }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + ref: ${{ needs.init.outputs.head_ref }} + # Needed to push changes + persist-credentials: true + token: ${{ secrets.COMMAND_BOT_PAT }} + + - name: Setup git + run: | + git config --local user.email "nextcloud-command@users.noreply.github.com" + git config --local user.name "nextcloud-command" + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - name: Install dependencies & build l10n + run: | + npm ci + npm run l10n:extract --if-present + + - name: Commit and push default + if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }} + run: | + git add . + git commit --signoff -m 'chore(l10n): extract new translations' + git push origin ${{ needs.init.outputs.head_ref }} + + - name: Commit and push fixup + if: ${{ needs.init.outputs.arg1 == 'fixup' }} + run: | + git add . + git commit --fixup=HEAD --signoff + git push origin ${{ needs.init.outputs.head_ref }} + + - name: Commit and push amend + if: ${{ needs.init.outputs.arg1 == 'amend' }} + run: | + git add . + git commit --amend --no-edit --signoff + git push --force origin ${{ needs.init.outputs.head_ref }} + + - name: Add reaction on failure + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 + if: failure() + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reaction-type: "-1" diff --git a/workflow-templates/command-openapi.properties.json b/workflow-templates/command-openapi.properties.json deleted file mode 100644 index 5570eac6..00000000 --- a/workflow-templates/command-openapi.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Regenerate OpenAPI workflow", - "description": "Regenerate and commit OpenAPI assets.\nExample: `/openapi [[rebase][-][amend|fixup]]`", - "iconName": "openapi" -} diff --git a/workflow-templates/command-openapi.yml b/workflow-templates/command-openapi.yml deleted file mode 100644 index 83bae892..00000000 --- a/workflow-templates/command-openapi.yml +++ /dev/null @@ -1,199 +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: OpenAPI Command -on: - issue_comment: - types: [created] - -permissions: - contents: read - -jobs: - init: - runs-on: ubuntu-latest - - # On pull requests and if the comment starts with `/openapi` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/openapi') - - outputs: - git_path: ${{ steps.git-path.outputs.path }} - arg1: ${{ steps.command.outputs.arg1 }} - arg2: ${{ steps.command.outputs.arg2 }} - head_ref: ${{ steps.comment-branch.outputs.head_ref }} - base_ref: ${{ steps.comment-branch.outputs.base_ref }} - - steps: - - name: Get repository from pull request comment - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - id: get-repository - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const pull = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - const repositoryName = pull.data.head?.repo?.full_name - console.log(repositoryName) - return repositoryName - - - name: Disabled on forks - if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }} - run: | - echo 'Can not execute /openapi on forks' - exit 1 - - - name: Check actor permission - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 - with: - require: write - - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '+1' - - - name: Parse command - uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1 - id: command - - # Init path depending on which command is run - - name: Init path - id: git-path - run: | - if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then - echo "path=${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT - else - echo "path=${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT - fi - - - name: Init branch - uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0 - id: comment-branch - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' - - process: - runs-on: ubuntu-latest - needs: init - - steps: - - name: Restore cached git repository - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: .git - key: git-repo - - - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - # Needed to allow force push later - persist-credentials: true - token: ${{ secrets.COMMAND_BOT_PAT }} - fetch-depth: 0 - ref: ${{ needs.init.outputs.head_ref }} - - - name: Setup git - run: | - git config --local user.email 'nextcloud-command@users.noreply.github.com' - git config --local user.name 'nextcloud-command' - - - 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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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: Rebase to ${{ needs.init.outputs.base_ref }} - if: ${{ contains(needs.init.outputs.arg1, 'rebase') }} - run: | - git fetch origin '${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}' - git rebase 'origin/${{ needs.init.outputs.base_ref }}' - - - name: Install dependencies - 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: Commit default - if: ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --signoff -m 'fix(openapi): Regenerate OpenAPI assets' - - - name: Commit fixup - if: ${{ contains(needs.init.outputs.arg1, 'fixup') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --fixup=HEAD --signoff - - - name: Commit amend - if: ${{ contains(needs.init.outputs.arg1, 'amend') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --amend --no-edit --signoff - # Remove any [skip ci] from the amended commit - git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')" - - - name: Push normally - if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }} - run: git push origin '${{ needs.init.outputs.head_ref }}' - - - name: Force push - if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }} - run: git push --force-with-lease origin '${{ needs.init.outputs.head_ref }}' - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' diff --git a/workflow-templates/command-playwright-update.properties.json b/workflow-templates/command-playwright-update.properties.json new file mode 100644 index 00000000..0c915f1b --- /dev/null +++ b/workflow-templates/command-playwright-update.properties.json @@ -0,0 +1,10 @@ +{ + "name": "Update playwright snapshots command", + "description": "Update playwright test snapshots on a pull request using '/playwright-update' command.", + "iconName": "playwright", + "filePatterns": [ + "^playwright.config.js$", + "^playwright.config.mjs$", + "^playwright.config.ts$" + ] +} diff --git a/workflow-templates/command-playwright-update.yml b/workflow-templates/command-playwright-update.yml new file mode 100644 index 00000000..ce16c1e4 --- /dev/null +++ b/workflow-templates/command-playwright-update.yml @@ -0,0 +1,117 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud-libraries/.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 + +# Usage: +# /playwright-update - update the snapshots and commit as a new commit +# /playwright-update fixup - update but commit as a fixup commit +# /playwright-update amend - update and commit as amended commit + +name: Command update Playwright snapshots +on: + issue_comment: + types: [created] +permissions: + contents: read + +jobs: + init: + runs-on: ubuntu-latest + + # On pull requests and if the comment starts with `/update-snapshots` + if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/update-snapshots') + + outputs: + arg1: ${{ steps.command.outputs.arg1 }} + head_ref: ${{ steps.comment-branch.outputs.head_ref }} + + steps: + - name: Add reaction on start + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reactions: '+1' + + - name: Parse command + uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1 + id: command + + - name: Init branch + uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0 + id: comment-branch + + process: + runs-on: ubuntu-latest + needs: init + + steps: + - name: Checkout ${{ needs.init.outputs.head_ref }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + ref: ${{ needs.init.outputs.head_ref }} + # To push the changes + persist-credentials: true + token: ${{ secrets.COMMAND_BOT_PAT }} + + - name: Setup git + run: | + git config --local user.email "nextcloud-command@users.noreply.github.com" + git config --local user.name "nextcloud-command" + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Update snapshots + run: npm run update:snapshots + + - name: Commit and push default + if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }} + run: | + git add . + git commit --signoff -m 'test: update playwright snapshots' + git push origin ${{ needs.init.outputs.head_ref }} + + - name: Commit and push fixup + if: ${{ needs.init.outputs.arg1 == 'fixup' }} + run: | + git add . + git commit --fixup=HEAD --signoff + git push origin ${{ needs.init.outputs.head_ref }} + + - name: Commit and push amend + if: ${{ needs.init.outputs.arg1 == 'amend' }} + run: | + git add . + git commit --amend --no-edit --signoff + git push --force origin ${{ needs.init.outputs.head_ref }} + + - name: Add reaction on failure + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 + if: failure() + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reaction-type: "-1" diff --git a/workflow-templates/cypress.yml b/workflow-templates/cypress.yml index f8df1578..ecc088ec 100644 --- a/workflow-templates/cypress.yml +++ b/workflow-templates/cypress.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors @@ -31,9 +31,6 @@ permissions: jobs: init: runs-on: ubuntu-latest - outputs: - nodeVersion: ${{ steps.versions.outputs.nodeVersion }} - npmVersion: ${{ steps.versions.outputs.npmVersion }} env: PUPPETEER_SKIP_DOWNLOAD: true @@ -62,20 +59,10 @@ jobs: with: composer-options: '--no-dev' - - 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 }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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 }}' + node-version-file: 'package.json' - name: Install node dependencies & build app run: | @@ -97,7 +84,7 @@ jobs: matrix: # Run multiple copies of the current job in parallel # Please increase the number or runners as your tests suite grows - containers: ['component', '1', '2', '3'] + containers: ['component'] name: runner ${{ matrix.containers }} @@ -109,21 +96,25 @@ jobs: key: cypress-context-${{ github.run_id }} path: ./ - - name: Set up node ${{ needs.init.outputs.nodeVersion }} + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ needs.init.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ needs.init.outputs.npmVersion }} - run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - - name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests + - name: Run ${{ startsWith(matrix.containers, 'component') && 'component' || 'E2E' }} cypress tests uses: cypress-io/github-action@fa4a118725a8f001170d49631ea89e5d66fee626 # v7.4.1 with: record: ${{ secrets.CYPRESS_RECORD_KEY && true }} parallel: ${{ secrets.CYPRESS_RECORD_KEY && true }} # cypress run type - component: ${{ matrix.containers == 'component' }} + component: ${{ startsWith(matrix.containers, 'component') }} group: ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_GROUP }} # cypress env ci-build-id: ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_BUILD_ID }} @@ -138,7 +129,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} CYPRESS_BUILD_ID: ${{ github.sha }}-${{ github.run_number }} - CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} + CYPRESS_GROUP: Run ${{ startsWith(matrix.containers, 'component') && 'component' || 'E2E' }} - name: Upload snapshots uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 @@ -147,19 +138,8 @@ jobs: name: snapshots_${{ matrix.containers }} path: cypress/snapshots - - name: Extract NC logs - if: failure() && matrix.containers != 'component' - run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log - - - name: Upload NC logs - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: failure() && matrix.containers != 'component' - with: - name: nc_logs_${{ matrix.containers }} - path: nextcloud.log - summary: - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest needs: [init, cypress] if: always() diff --git a/workflow-templates/dependabot-approve-merge.yml b/workflow-templates/dependabot-approve-merge.yml index 76340acb..4d7889af 100644 --- a/workflow-templates/dependabot-approve-merge.yml +++ b/workflow-templates/dependabot-approve-merge.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors @@ -25,7 +25,7 @@ concurrency: jobs: auto-approve-merge: if: github.event.pull_request.user.login == 'dependabot[bot]' - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest env: # env variable for maintainers: 'true' allows to auto-merge 1.0.2 -> 2.0.0 ALLOW_MAJOR: false diff --git a/workflow-templates/documentation.yml b/workflow-templates/documentation.yml index ba7d9c65..7e73a123 100644 --- a/workflow-templates/documentation.yml +++ b/workflow-templates/documentation.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors @@ -14,7 +14,7 @@ on: types: [published] permissions: - contents: read + contents: write jobs: build-and-deploy: @@ -22,33 +22,23 @@ jobs: name: Build and deploy steps: - - name: Check actor permission level - # Only allow admin to deploy on release - if: github.event.release - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 - with: - require: admin - - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} package-manager-cache: false - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies & build env: diff --git a/workflow-templates/fixup.yml b/workflow-templates/fixup.yml index 69da2bbb..d30a43d6 100644 --- a/workflow-templates/fixup.yml +++ b/workflow-templates/fixup.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -27,7 +27,7 @@ jobs: pull-requests: write name: Block fixup and squash commits - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Run check diff --git a/workflow-templates/lint-eslint.yml b/workflow-templates/lint-eslint.yml index 3e34f7e8..ec4bb440 100644 --- a/workflow-templates/lint-eslint.yml +++ b/workflow-templates/lint-eslint.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -18,41 +18,10 @@ concurrency: cancel-in-progress: true jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - 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 + name: eslint steps: - name: Checkout @@ -60,20 +29,17 @@ jobs: with: persist-credentials: false - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies env: @@ -83,18 +49,3 @@ jobs: - 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 diff --git a/workflow-templates/lint-info-xml.properties.json b/workflow-templates/lint-info-xml.properties.json deleted file mode 100644 index 3c2e9689..00000000 --- a/workflow-templates/lint-info-xml.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Linting info.xml", - "description": "info.xml app linting based on the app-info template", - "iconName": "octicon codescan", - "categories": [ - "XML" - ], - "filePatterns": [ - "^appinfo/info.xml$" - ] -} diff --git a/workflow-templates/lint-info-xml.yml b/workflow-templates/lint-info-xml.yml deleted file mode 100644 index e5570522..00000000 --- a/workflow-templates/lint-info-xml.yml +++ /dev/null @@ -1,40 +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: 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: - runs-on: ubuntu-latest-low - - name: info.xml lint - steps: - - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - 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.properties.json b/workflow-templates/lint-php-cs.properties.json deleted file mode 100644 index 3ba0eed3..00000000 --- a/workflow-templates/lint-php-cs.properties.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "Linting PHP Coding Standards", - "description": "PHP Coding Standards linting. Require proper script in composer.json", - "iconName": "lint-php", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^.php-cs-fixer.dist.php$", - "^.php_cs.dist$" - ] -} diff --git a/workflow-templates/lint-php-cs.yml b/workflow-templates/lint-php-cs.yml deleted file mode 100644 index 0a65977b..00000000 --- a/workflow-templates/lint-php-cs.yml +++ /dev/null @@ -1,54 +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: 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - - 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.properties.json b/workflow-templates/lint-php.properties.json deleted file mode 100644 index 55443e53..00000000 --- a/workflow-templates/lint-php.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Linting php", - "description": "Php linting. Require proper script in composer.json", - "iconName": "lint-php", - "categories": [ - "PHP" - ], - "filePatterns": [ - ".*\\.php$" - ] -} diff --git a/workflow-templates/lint-php.svg b/workflow-templates/lint-php.svg deleted file mode 100644 index d95f8010..00000000 --- a/workflow-templates/lint-php.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - Official PHP Logo - - - - image/svg+xml - - Official PHP Logo - - - Colin Viebrock - - - - - - - - - - - - Copyright Colin Viebrock 1997 - All rights reserved. - - - 1997 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/workflow-templates/lint-php.yml b/workflow-templates/lint-php.yml deleted file mode 100644 index cb2684b2..00000000 --- a/workflow-templates/lint-php.yml +++ /dev/null @@ -1,76 +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: Lint php - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-php-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - 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 diff --git a/workflow-templates/lint-stylelint.yml b/workflow-templates/lint-stylelint.yml index 7a1457c8..df0ca668 100644 --- a/workflow-templates/lint-stylelint.yml +++ b/workflow-templates/lint-stylelint.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -29,20 +29,17 @@ jobs: with: persist-credentials: false - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies env: diff --git a/workflow-templates/lint-typescript.yml b/workflow-templates/lint-typescript.yml index 56a4215e..cf0619dc 100644 --- a/workflow-templates/lint-typescript.yml +++ b/workflow-templates/lint-typescript.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors @@ -24,34 +24,9 @@ concurrency: cancel-in-progress: true jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - 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' + name: Lint Typescript steps: - name: Checkout @@ -59,42 +34,24 @@ jobs: with: persist-credentials: false - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies env: CYPRESS_INSTALL_BINARY: 0 - run: | - npm ci + 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 diff --git a/workflow-templates/node-test.yml b/workflow-templates/node-test.yml index 97c5cb99..8fe6b01f 100644 --- a/workflow-templates/node-test.yml +++ b/workflow-templates/node-test.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors @@ -24,39 +24,9 @@ concurrency: cancel-in-progress: true jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - 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' + name: node-tests steps: - name: Checkout @@ -64,20 +34,17 @@ jobs: with: persist-credentials: false - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies & build env: @@ -96,17 +63,5 @@ jobs: 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 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/workflow-templates/node.yml b/workflow-templates/node.yml index 9f672c2a..a8e32b87 100644 --- a/workflow-templates/node.yml +++ b/workflow-templates/node.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors @@ -20,13 +20,38 @@ concurrency: cancel-in-progress: true jobs: - summary: - runs-on: ubuntu-latest-low - if: always() - - # This is the summary, we just avoid to rename it so that branch protection rules still match - name: node + build: + runs-on: ubuntu-latest + name: node-build steps: - - name: No-op please switch to npm-build.yml - run: echo "The workflow has been renamed, please switch to npm-build.yml from organization templates"; exit 1; + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - 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 diff --git a/workflow-templates/npm-audit-fix.yml b/workflow-templates/npm-audit-fix.yml index 470fb72e..1f8d0880 100644 --- a/workflow-templates/npm-audit-fix.yml +++ b/workflow-templates/npm-audit-fix.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors @@ -24,11 +24,7 @@ jobs: strategy: fail-fast: false matrix: - branches: - - ${{ github.event.repository.default_branch }} - - 'stable34' - - 'stable33' - - 'stable32' + branches: ['main'] name: npm-audit-fix-${{ matrix.branches }} @@ -41,20 +37,17 @@ jobs: ref: ${{ matrix.branches }} continue-on-error: true - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 id: versions - with: - fallbackNode: '^24' - fallbackNpm: '^11.3' - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + - name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ steps.versions.outputs.nodeVersion }} + node-version: ${{ steps.versions.outputs.node-version }} - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Fix npm audit id: npm-audit diff --git a/workflow-templates/npm-build.yml b/workflow-templates/npm-build.yml index ffc89199..53ae07a7 100644 --- a/workflow-templates/npm-build.yml +++ b/workflow-templates/npm-build.yml @@ -18,38 +18,9 @@ concurrency: cancel-in-progress: true jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - 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 @@ -100,8 +71,8 @@ jobs: summary: permissions: contents: none - runs-on: ubuntu-latest-low - needs: [changes, build] + runs-on: ubuntu-latest + needs: [build] if: always() @@ -110,4 +81,4 @@ jobs: steps: - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi + run: if ${{ needs.build.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/npm-publish.properties.json b/workflow-templates/npm-publish.properties.json new file mode 100644 index 00000000..34d92dd3 --- /dev/null +++ b/workflow-templates/npm-publish.properties.json @@ -0,0 +1,11 @@ +{ + "name": "Publish to npm", + "description": "Build and publish package to npm on tagged releases.", + "iconName": "octicon package", + "categories": [ + "JavaScript" + ], + "filePatterns": [ + "^package.json$" + ] +} diff --git a/workflow-templates/npm-publish.yml b/workflow-templates/npm-publish.yml new file mode 100644 index 00000000..cb087d62 --- /dev/null +++ b/workflow-templates/npm-publish.yml @@ -0,0 +1,81 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud-libraries/.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: Publish + +on: + release: + types: [published] + +permissions: + id-token: write # Required for OIDC + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + name: Build and publish to npm + environment: npm-publish + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + package-manager-cache: false + registry-url: https://registry.npmjs.org + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - name: Check tag matches package.json + run: | + VERSION=$(node -p -e "require('./package.json').version") + GH_VERSION=$(echo "$GH_VERSION" | sed s,\^v,,) + if [ "$VERSION" != "$GH_VERSION" ]; then + echo "$VERSION does not match $GH_VERSION" + exit 1; + fi; + env: + GH_VERSION: ${{ github.event.release.tag_name }} + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + run: | + npm ci --ignore-scripts + npm run build --if-present + + - name: Fetch latest tag + id: latest-tag + run: | + TAG=$(gh release list \ + --exclude-drafts \ + --exclude-pre-releases \ + --json isLatest,tagName \ + --jq 'map(select(.isLatest == true))[].tagName' \ + -R ${{ github.repository }}) + echo "Latest tag is $TAG" + echo "LATEST_TAG=$TAG" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + + - name: Publish + run: | + npm publish --tag $RELEASE_GROUP + env: + RELEASE_GROUP: ${{ (contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')) && 'next' || ((steps.latest-tag.outputs.LATEST_TAG != github.event.release.tag_name) && 'stable' || 'latest') }} diff --git a/workflow-templates/openapi.properties.json b/workflow-templates/openapi.properties.json deleted file mode 100644 index 4d86eb50..00000000 --- a/workflow-templates/openapi.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "OpenAPI status check", - "description": "Checks that the openapi.json (and typescript definitions if applicable) are up to date", - "iconName": "openapi" -} diff --git a/workflow-templates/openapi.svg b/workflow-templates/openapi.svg deleted file mode 100644 index c80b6712..00000000 --- a/workflow-templates/openapi.svg +++ /dev/null @@ -1,5 +0,0 @@ - - \ No newline at end of file diff --git a/workflow-templates/openapi.yml b/workflow-templates/openapi.yml deleted file mode 100644 index 20c1a5cb..00000000 --- a/workflow-templates/openapi.yml +++ /dev/null @@ -1,96 +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: 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get php version - id: php_versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - - 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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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/phpunit-mariadb.properties.json b/workflow-templates/phpunit-mariadb.properties.json deleted file mode 100644 index 2a289fa8..00000000 --- a/workflow-templates/phpunit-mariadb.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "PHPUnit MariaDB", - "description": "Run PHPUnit tests on MariaDB database", - "iconName": "phpunit", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^tests/phpunit.xml$" - ] -} diff --git a/workflow-templates/phpunit-mariadb.yml b/workflow-templates/phpunit-mariadb.yml deleted file mode 100644 index 2e7b92b0..00000000 --- a/workflow-templates/phpunit-mariadb.yml +++ /dev/null @@ -1,207 +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: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit MariaDB - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-mariadb-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-mariadb: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - mariadb-versions: ['10.6', '11.4'] - - name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - mariadb: - image: ghcr.io/nextcloud/continuous-integration-mariadb-${{ matrix.mariadb-versions }}:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MARIADB_ROOT_PASSWORD: rootpassword - options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql - 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: Enable ONLY_FULL_GROUP_BY MariaDB option - run: | - echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword - echo 'SELECT @@sql_mode;' | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Remove nextcloud/ocp - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - working-directory: apps/${{ env.APP_NAME }} - - - name: Set up Nextcloud - env: - DB_PORT: 4444 - run: | - mkdir data - ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:integration - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Skipped - # Fail the action when neither unit nor integration tests ran - if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-mariadb] - - if: always() - - name: phpunit-mariadb-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mariadb.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/phpunit-mysql.properties.json b/workflow-templates/phpunit-mysql.properties.json deleted file mode 100644 index 832b7956..00000000 --- a/workflow-templates/phpunit-mysql.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "PHPUnit MySQL", - "description": "Run PHPUnit tests on MySQL database", - "iconName": "phpunit", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^tests/phpunit.xml$" - ] -} diff --git a/workflow-templates/phpunit-mysql.yml b/workflow-templates/phpunit-mysql.yml deleted file mode 100644 index 596d91ea..00000000 --- a/workflow-templates/phpunit-mysql.yml +++ /dev/null @@ -1,205 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit MySQL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-mysql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - matrix: ${{ steps.versions.outputs.sparse-matrix }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - with: - matrix: '{"mysql-versions": ["8.4"]}' - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-mysql: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} - - name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - mysql: - image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MYSQL_ROOT_PASSWORD: rootpassword - options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql - 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: Enable ONLY_FULL_GROUP_BY MySQL option - run: | - echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword - echo 'SELECT @@sql_mode;' | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Remove nextcloud/ocp - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - working-directory: apps/${{ env.APP_NAME }} - - - name: Set up Nextcloud - env: - DB_PORT: 4444 - run: | - mkdir data - ./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:integration - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Skipped - # Fail the action when neither unit nor integration tests ran - if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-mysql] - - if: always() - - name: phpunit-mysql-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/phpunit-oci.properties.json b/workflow-templates/phpunit-oci.properties.json deleted file mode 100644 index 03acec5a..00000000 --- a/workflow-templates/phpunit-oci.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "PHPUnit oci", - "description": "Run PHPUnit tests on oci database", - "iconName": "phpunit", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^tests/phpunit.xml$" - ] -} diff --git a/workflow-templates/phpunit-oci.yml b/workflow-templates/phpunit-oci.yml deleted file mode 100644 index 4314399b..00000000 --- a/workflow-templates/phpunit-oci.yml +++ /dev/null @@ -1,212 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit OCI - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-oci-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src }} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-oci: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - oci-versions: ['18', '21', '23'] - - name: OCI ${{ matrix.oci-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - oracle: - image: ghcr.io/gvenzl/oracle-${{ matrix.oci-versions < 23 && 'xe' || 'free' }}:${{ matrix.oci-versions }} - - # Provide passwords and other environment variables to container - env: - ORACLE_PASSWORD: oracle - - # Forward Oracle port - ports: - - 1521:1521 - - # Provide healthcheck script options for startup - options: >- - --health-cmd healthcheck.sh - --health-interval 20s - --health-timeout 10s - --health-retries 10 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8 - 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: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Remove nextcloud/ocp - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - working-directory: apps/${{ env.APP_NAME }} - - - name: Set up Nextcloud - env: - DB_PORT: 1521 - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=${{ matrix.oci-versions < 23 && 'XE' || 'FREE' }} --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=system --database-pass=oracle --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:integration - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Skipped - # Fail the action when neither unit nor integration tests ran - if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-oci] - - if: always() - - name: phpunit-oci-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-oci.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/phpunit-pgsql.properties.json b/workflow-templates/phpunit-pgsql.properties.json deleted file mode 100644 index 611186d6..00000000 --- a/workflow-templates/phpunit-pgsql.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "PHPUnit pgsql", - "description": "Run PHPUnit tests on postgresql database", - "iconName": "phpunit", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^tests/phpunit.xml$" - ] -} diff --git a/workflow-templates/phpunit-pgsql.yml b/workflow-templates/phpunit-pgsql.yml deleted file mode 100644 index dab23f2e..00000000 --- a/workflow-templates/phpunit-pgsql.yml +++ /dev/null @@ -1,203 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit PostgreSQL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-pgsql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src }} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-pgsql: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - - name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - postgres: - image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:5432/tcp - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: rootpassword - POSTGRES_DB: nextcloud - options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Remove nextcloud/ocp - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - working-directory: apps/${{ env.APP_NAME }} - - - name: Set up Nextcloud - env: - DB_PORT: 4444 - run: | - mkdir data - ./occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:integration - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Skipped - # Fail the action when neither unit nor integration tests ran - if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-pgsql] - - if: always() - - name: phpunit-pgsql-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/phpunit-sqlite.properties.json b/workflow-templates/phpunit-sqlite.properties.json deleted file mode 100644 index 50a195db..00000000 --- a/workflow-templates/phpunit-sqlite.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "PHPUnit sqlite", - "description": "Run PHPUnit tests on sqlite database", - "iconName": "phpunit", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^tests/phpunit.xml$" - ] -} diff --git a/workflow-templates/phpunit-sqlite.yml b/workflow-templates/phpunit-sqlite.yml deleted file mode 100644 index 273400a4..00000000 --- a/workflow-templates/phpunit-sqlite.yml +++ /dev/null @@ -1,192 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit SQLite - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-sqlite-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-sqlite: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - - name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - 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: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Remove nextcloud/ocp - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - with: - working-directory: apps/${{ env.APP_NAME }} - - - name: Set up Nextcloud - env: - DB_PORT: 4444 - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:integration - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Skipped - # Fail the action when neither unit nor integration tests ran - if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-sqlite] - - if: always() - - name: phpunit-sqlite-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/phpunit.svg b/workflow-templates/phpunit.svg deleted file mode 100644 index bedfc361..00000000 --- a/workflow-templates/phpunit.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/workflow-templates/playwright.properties.json b/workflow-templates/playwright.properties.json new file mode 100644 index 00000000..330dc963 --- /dev/null +++ b/workflow-templates/playwright.properties.json @@ -0,0 +1,10 @@ +{ + "name": "Playwright testing", + "description": "Default Playwright workflow. It will setup node, install dependencies, run Playwright and upload artifacts.", + "iconName": "playwright", + "filePatterns": [ + "^playwright.config.js$", + "^playwright.config.mjs$", + "^playwright.config.ts$" + ] +} diff --git a/workflow-templates/playwright.svg b/workflow-templates/playwright.svg new file mode 100644 index 00000000..6978979e --- /dev/null +++ b/workflow-templates/playwright.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/workflow-templates/playwright.yml b/workflow-templates/playwright.yml new file mode 100644 index 00000000..56568db6 --- /dev/null +++ b/workflow-templates/playwright.yml @@ -0,0 +1,123 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud-libraries/.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: Playwright Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + playwright-tests: + timeout-minutes: 60 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + shardIndex: [1, 2] + shardTotal: [2] + outputs: + node-version: ${{ steps.versions.outputs.node-version }} + package-manager-version: ${{ steps.versions.outputs.package-manager-version }} + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Read package.json + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 + id: versions + + - name: Set up node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ steps.versions.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: npm run test:component -- --shard='${{ matrix.shardIndex }}/${{ matrix.shardTotal }}' + + - name: Upload blob report to GitHub Actions Artifacts + if: ${{ !cancelled() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: blob-report-${{ matrix.shardIndex }} + path: blob-report + retention-days: 1 + + merge-reports: + # Merge reports after playwright-tests, even if some shards have failed + if: ${{ !cancelled() }} + needs: [playwright-tests] + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ needs.playwright-tests.outputs.node-version }} + + - name: Set up npm + run: npm i -g 'npm@${{ needs.playwright-tests.outputs.package-manager-version }}' + + - name: Install dependencies + run: npm ci + + - name: Download blob reports from GitHub Actions Artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + path: all-blob-reports + pattern: blob-report-* + merge-multiple: true + + - name: Merge into HTML Report + run: npx playwright merge-reports --reporter html,github ./all-blob-reports + + - name: Upload HTML report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: html-report--attempt-${{ github.run_attempt }} + path: playwright-report + retention-days: 7 + + - name: Show the logs + run: | + echo 'To view the report:' + echo ' 1. Extract the folder from the zip file' + echo ' 2. run "npx playwright show-report name-of-my-extracted-playwright-report"' + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [playwright-tests] + + if: always() + + name: playwright-test-summary + + steps: + - name: Summary status + run: if ${{ needs.playwright-tests.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/pr-feedback.properties.json b/workflow-templates/pr-feedback.properties.json deleted file mode 100644 index 0aed7ab6..00000000 --- a/workflow-templates/pr-feedback.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Ask for feedback on PR review", - "description": "Add a comment 14 days after a PR was created, asking for feedback on how the review process went.", - "iconName": "octicon thumbsup" -} diff --git a/workflow-templates/pr-feedback.yml b/workflow-templates/pr-feedback.yml deleted file mode 100644 index 4420bf69..00000000 --- a/workflow-templates/pr-feedback.yml +++ /dev/null @@ -1,55 +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: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Marcel Klehr -# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com> -# SPDX-FileCopyrightText: 2023 Daniel Kesselberg -# SPDX-FileCopyrightText: 2023 Florian Steffens -# SPDX-License-Identifier: MIT - -name: 'Ask for feedback on PRs' -on: - schedule: - - cron: '30 1 * * *' - -permissions: - contents: read - pull-requests: write - -jobs: - pr-feedback: - if: ${{ github.repository_owner == 'nextcloud' }} - runs-on: ubuntu-latest - steps: - - name: The get-github-handles-from-website action - uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1 - id: scrape - with: - website: 'https://nextcloud.com/team/' - - - name: Get blocklist - id: blocklist - run: | - blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) - echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" - - - uses: nextcloud/pr-feedback-action@5227c55be184087d0aef6338bee210d8620b6297 # v1.0.1 - with: - feedback-message: | - Hello there, - Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. - - We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. - - Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 - - Thank you for contributing to Nextcloud and we hope to hear from you soon! - - (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) - days-before-feedback: 14 - start-date: '2025-06-12' - exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' - exempt-bots: true diff --git a/workflow-templates/psalm-matrix.properties.json b/workflow-templates/psalm-matrix.properties.json deleted file mode 100644 index 49ea535b..00000000 --- a/workflow-templates/psalm-matrix.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Psalm static analysis (Multiple versions)", - "description": "Run Psalm static analysis against multiple Nextcloud versions", - "iconName": "psalm", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^composer.json$" - ] -} diff --git a/workflow-templates/psalm-matrix.yml b/workflow-templates/psalm-matrix.yml deleted file mode 100644 index b2d0ff1e..00000000 --- a/workflow-templates/psalm-matrix.yml +++ /dev/null @@ -1,91 +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: 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: - matrix: - runs-on: ubuntu-latest-low - outputs: - ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }} - php-min: ${{ steps.versions.outputs.php-min }} - steps: - - name: Checkout app - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - - 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 - - static-analysis: - runs-on: ubuntu-latest - needs: matrix - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }} - - name: static-psalm-analysis ${{ matrix.ocp-version }} - steps: - - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Set up php${{ needs.matrix.outputs.php-min }} - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: ${{ needs.matrix.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 - # 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:${{ matrix.ocp-version }} - env: - OCP_VERSION: ${{ matrix.ocp-version }} - run: composer require --dev "nextcloud/ocp:$OCP_VERSION" --ignore-platform-reqs --with-dependencies - - - name: Run coding standards check - run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github - - summary: - runs-on: ubuntu-latest-low - needs: static-analysis - - if: always() - - name: static-psalm-analysis-summary - - steps: - - name: Summary status - run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi diff --git a/workflow-templates/psalm.properties.json b/workflow-templates/psalm.properties.json deleted file mode 100644 index 398d8da8..00000000 --- a/workflow-templates/psalm.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Psalm static analysis", - "description": "Run Psalm static analysis", - "iconName": "psalm", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^composer.json$" - ] -} diff --git a/workflow-templates/psalm.svg b/workflow-templates/psalm.svg deleted file mode 100644 index 89176855..00000000 --- a/workflow-templates/psalm.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/workflow-templates/psalm.yml b/workflow-templates/psalm.yml deleted file mode 100644 index 4feadcb8..00000000 --- a/workflow-templates/psalm.yml +++ /dev/null @@ -1,61 +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: 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - - 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/release-relay.properties.json b/workflow-templates/release-relay.properties.json deleted file mode 100644 index 53bdc97a..00000000 --- a/workflow-templates/release-relay.properties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Release Relay", - "description": "Dispatches the repository information and tag of a release to a relay for further release processing", - "iconName": "octicon robot" -} diff --git a/workflow-templates/release-relay.yml b/workflow-templates/release-relay.yml deleted file mode 100644 index 08908315..00000000 --- a/workflow-templates/release-relay.yml +++ /dev/null @@ -1,38 +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: 2026 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Notify release-relay on release - -on: - release: - types: [published] - -permissions: - contents: read - -jobs: - notify: - name: Dispatch release to release-relay - runs-on: ubuntu-latest - - # Only allowed to 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: Dispatch to release-relay - uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 - with: - token: ${{ secrets.DISPATCH_PAT }} - repository: nextcloud-gmbh/release-relay - event-type: app-tagged - client-payload: '{"app": "${{ github.repository }}", "tag": "${{ github.event.release.tag_name }}"}' diff --git a/workflow-templates/renovate-approve-merge.yml b/workflow-templates/renovate-approve-merge.yml index c3187c35..4619f296 100644 --- a/workflow-templates/renovate-approve-merge.yml +++ b/workflow-templates/renovate-approve-merge.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # # SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors diff --git a/workflow-templates/reuse.yml b/workflow-templates/reuse.yml index 4e1a7419..2f4b2f2f 100644 --- a/workflow-templates/reuse.yml +++ b/workflow-templates/reuse.yml @@ -1,6 +1,6 @@ # This workflow is provided via the organization template repository # -# https://github.com/nextcloud/.github +# https://github.com/nextcloud-libraries/.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 @@ permissions: jobs: reuse-compliance-check: - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 diff --git a/workflow-templates/update-nextcloud-ocp-approve-merge.properties.json b/workflow-templates/update-nextcloud-ocp-approve-merge.properties.json deleted file mode 100644 index 21d7e03f..00000000 --- a/workflow-templates/update-nextcloud-ocp-approve-merge.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Auto approve and merge of nextcloud/ocp updates", - "description": "Auto approve and merge of nextcloud/ocp dev dependency updates", - "iconName": "octicon git-pull-request", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^composer.json$" - ] -} diff --git a/workflow-templates/update-nextcloud-ocp-approve-merge.yml b/workflow-templates/update-nextcloud-ocp-approve-merge.yml deleted file mode 100644 index 88c54da0..00000000 --- a/workflow-templates/update-nextcloud-ocp-approve-merge.yml +++ /dev/null @@ -1,59 +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: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Auto approve nextcloud/ocp - -on: - pull_request_target: # zizmor: ignore[dangerous-triggers] - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - auto-approve-merge: - if: github.actor == 'nextcloud-command' - runs-on: ubuntu-latest-low - permissions: - # for auto-approve-action to approve PRs - pull-requests: write - # for alexwilson/enable-github-automerge-action to approve PRs - contents: write - - steps: - - name: Disabled on forks - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - run: | - echo 'Can not approve PRs from forks' - exit 1 - - - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0 - id: branchname - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: GitHub actions bot approve - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Enable GitHub auto merge - - name: Auto merge - uses: alexwilson/enable-github-automerge-action@2c32e18a76e0726ffe7a573bfff2d42a20885126 # 3.0.0 - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/workflow-templates/update-nextcloud-ocp-matrix.properties.json b/workflow-templates/update-nextcloud-ocp-matrix.properties.json deleted file mode 100644 index d0c2f5b7..00000000 --- a/workflow-templates/update-nextcloud-ocp-matrix.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Update nextcloud/ocp (Multiple versions)", - "description": "Update nextcloud/ocp dev dependency with support for multiple Nextcloud versions", - "iconName": "octicon git-pull-request", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^composer.json$" - ] -} diff --git a/workflow-templates/update-nextcloud-ocp-matrix.yml b/workflow-templates/update-nextcloud-ocp-matrix.yml deleted file mode 100644 index fff6a406..00000000 --- a/workflow-templates/update-nextcloud-ocp-matrix.yml +++ /dev/null @@ -1,112 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Update nextcloud/ocp - -on: - workflow_dispatch: - schedule: - - cron: '5 2 * * 0' - -permissions: - contents: read - issues: write - -jobs: - update-nextcloud-ocp: - runs-on: ubuntu-latest - - # Only allowed to be run on nextcloud repositories - if: ${{ github.repository_owner == 'nextcloud' }} - - strategy: - fail-fast: false - matrix: - branches: - - ${{ github.event.repository.default_branch }} - - name: update-nextcloud-ocp-${{ matrix.branches }} - - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - ref: ${{ matrix.branches }} - submodules: true - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 - - - name: Set up php8.3 - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: 8.3 - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - 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 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Read codeowners - id: codeowners - run: | - grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT - continue-on-error: true - - - name: Install composer dependencies - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - - - name: Check composer bin for nextcloud/ocp exists - id: check_composer_bin - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: vendor-bin/nextcloud-ocp/composer.json - - - name: Composer update nextcloud/ocp - id: update_branch - env: - USE_COMPOSER_BIN: ${{ steps.check_composer_bin.outputs.files_exists }} - BRANCH_NAME: ${{ steps.versions.outputs.branches-min }} - run: | - COMPOSER_CMD='composer' - if [[ "$USE_COMPOSER_BIN" == 'true' ]]; then - COMPOSER_CMD='composer bin nextcloud-ocp' - fi - - echo $COMPOSER_CMD require --dev nextcloud/ocp:dev-$BRANCH_NAME - $COMPOSER_CMD require --dev nextcloud/ocp:dev-$BRANCH_NAME - - - name: Raise on issue on failure - uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 - if: ${{ failure() && steps.update_branch.conclusion == 'failure' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: 'Failed to update nextcloud/ocp package' - body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' - - - name: Create Pull Request - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: 'chore(dev-deps): Bump nextcloud/ocp package' - committer: GitHub - author: nextcloud-command - signoff: true - branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp' - title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency' - add-path: | - composer.json - composer.lock - vendor-bin/nextcloud-ocp/composer.json - vendor-bin/nextcloud-ocp/composer.lock - body: | - Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency - labels: | - dependencies - 3. to review diff --git a/workflow-templates/update-nextcloud-ocp.properties.json b/workflow-templates/update-nextcloud-ocp.properties.json deleted file mode 100644 index 59169b3b..00000000 --- a/workflow-templates/update-nextcloud-ocp.properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Update nextcloud/ocp", - "description": "Update nextcloud/ocp dev dependency", - "iconName": "octicon git-pull-request", - "categories": [ - "PHP" - ], - "filePatterns": [ - "^composer.json$" - ] -} diff --git a/workflow-templates/update-nextcloud-ocp.yml b/workflow-templates/update-nextcloud-ocp.yml deleted file mode 100644 index 8162864c..00000000 --- a/workflow-templates/update-nextcloud-ocp.yml +++ /dev/null @@ -1,122 +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: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Update nextcloud/ocp - -on: - workflow_dispatch: - schedule: - - cron: "5 2 * * 0" - -permissions: - contents: read - issues: write - -jobs: - update-nextcloud-ocp: - runs-on: ubuntu-latest - - # Only allowed to be run on nextcloud repositories - if: ${{ github.repository_owner == 'nextcloud' }} - - strategy: - fail-fast: false - matrix: - branches: - - ${{ github.event.repository.default_branch }} - - 'stable34' - - 'stable33' - - 'stable32' - - name: update-nextcloud-ocp-${{ matrix.branches }} - - steps: - - id: checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - ref: ${{ matrix.branches }} - submodules: true - continue-on-error: true - - - name: Set up php8.3 - if: steps.checkout.outcome == 'success' - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 - with: - php-version: 8.3 - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - 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 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Read codeowners - if: steps.checkout.outcome == 'success' - id: codeowners - run: | - grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT - continue-on-error: true - - - name: Install composer dependencies - if: steps.checkout.outcome == 'success' - uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 - - - name: Check composer bin for nextcloud/ocp exists - id: check_composer_bin - uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0 - with: - files: vendor-bin/nextcloud-ocp/composer.json - - - name: Composer update nextcloud/ocp - id: update_branch - env: - USE_COMPOSER_BIN: ${{ steps.check_composer_bin.outputs.files_exists }} - BRANCH_NAME: ${{ matrix.branches }} - run: | - COMPOSER_CMD='composer' - if [[ "$USE_COMPOSER_BIN" == 'true' ]]; then - COMPOSER_CMD='composer bin nextcloud-ocp' - fi - - PACKAGE_VERSION="nextcloud/ocp:dev-$BRANCH_NAME" - if [[ "$BRANCH_NAME" == 'main' ]]; then - PACKAGE_VERSION='nextcloud/ocp:dev-master' - fi - - echo $COMPOSER_CMD require --dev $PACKAGE_VERSION - $COMPOSER_CMD require --dev $PACKAGE_VERSION - - - name: Raise on issue on failure - uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 - if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}' - body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' - - - name: Create Pull Request - if: steps.checkout.outcome == 'success' - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: 'chore(dev-deps): Bump nextcloud/ocp package' - committer: GitHub - author: nextcloud-command - signoff: true - branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp' - title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency' - add-path: | - composer.json - composer.lock - vendor-bin/nextcloud-ocp/composer.json - vendor-bin/nextcloud-ocp/composer.lock - body: | - Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency - labels: | - dependencies - 3. to review diff --git a/workflow-templates/update-stable-titles.yml b/workflow-templates/update-stable-titles.yml index ca8be8bf..9575cede 100644 --- a/workflow-templates/update-stable-titles.yml +++ b/workflow-templates/update-stable-titles.yml @@ -14,7 +14,7 @@ concurrency: jobs: update-pr-title: - runs-on: ubuntu-latest-low + runs-on: ubuntu-latest permissions: pull-requests: write contents: read