Skip to content

Commit d91c6e9

Browse files
Merge pull request #24 from MarcelRobitaille/cherry-pick
Support Nextcloud 30
2 parents 6978656 + 7ff34b5 commit d91c6e9

26 files changed

Lines changed: 10788 additions & 15240 deletions

.github/workflows/appstore-build-publish.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Build and publish app release
710

811
on:
912
release:
1013
types: [published]
1114

12-
env:
13-
PHP_VERSION: 8.1
14-
1515
jobs:
1616
build_and_publish:
1717
runs-on: ubuntu-latest
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Check actor permission
24-
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
24+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
2525
with:
2626
require: write
2727

@@ -32,10 +32,21 @@ jobs:
3232
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3333
3434
- name: Checkout
35-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
35+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3636
with:
3737
path: ${{ env.APP_NAME }}
3838

39+
- name: Get app version number
40+
id: app-version
41+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
42+
with:
43+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
44+
expression: "//info//version/text()"
45+
46+
- name: Validate app version against tag
47+
run: |
48+
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
49+
3950
- name: Get appinfo data
4051
id: appinfo
4152
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
@@ -44,38 +55,44 @@ jobs:
4455
expression: "//info//dependencies//nextcloud/@min-version"
4556

4657
- name: Read package.json node and npm engines version
47-
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
58+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4859
id: versions
4960
# Continue if no package.json
5061
continue-on-error: true
5162
with:
5263
path: ${{ env.APP_NAME }}
53-
fallbackNode: "^16"
54-
fallbackNpm: "^7"
64+
fallbackNode: '^20'
65+
fallbackNpm: '^10'
5566

5667
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5768
# Skip if no package.json
5869
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
70+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
6071
with:
6172
node-version: ${{ steps.versions.outputs.nodeVersion }}
6273

6374
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
6475
# Skip if no package.json
6576
if: ${{ steps.versions.outputs.npmVersion }}
66-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
77+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
78+
79+
- name: Get php version
80+
id: php-versions
81+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
82+
with:
83+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
6784

68-
- name: Set up php ${{ env.PHP_VERSION }}
69-
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
85+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
86+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
7087
with:
71-
php-version: ${{ env.PHP_VERSION }}
88+
php-version: ${{ steps.php-versions.outputs.php-min }}
7289
coverage: none
7390
env:
7491
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7592

7693
- name: Check composer.json
7794
id: check_composer
78-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
95+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
7996
with:
8097
files: "${{ env.APP_NAME }}/composer.json"
8198

@@ -88,14 +105,16 @@ jobs:
88105
- name: Build ${{ env.APP_NAME }}
89106
# Skip if no package.json
90107
if: ${{ steps.versions.outputs.nodeVersion }}
108+
env:
109+
CYPRESS_INSTALL_BINARY: 0
91110
run: |
92111
cd ${{ env.APP_NAME }}
93112
npm ci
94-
npm run build
113+
npm run build --if-present
95114
96115
- name: Check Krankerl config
97116
id: krankerl
98-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
117+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
99118
with:
100119
files: ${{ env.APP_NAME }}/krankerl.toml
101120

@@ -121,12 +140,12 @@ jobs:
121140
continue-on-error: true
122141
id: server-checkout
123142
run: |
124-
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
143+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
125144
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
126145
unzip latest-$NCVERSION.zip
127146
128147
- name: Checkout server master fallback
129-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
148+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
130149
if: ${{ steps.server-checkout.outcome != 'success' }}
131150
with:
132151
submodules: true
@@ -140,7 +159,7 @@ jobs:
140159
tar -xvf ${{ env.APP_NAME }}.tar.gz
141160
cd ../../../../
142161
# Setting up keys
143-
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
162+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
144163
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
145164
# Signing
146165
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}
@@ -149,7 +168,7 @@ jobs:
149168
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150169
151170
- name: Attach tarball to github release
152-
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
171+
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
153172
id: attach_to_release
154173
with:
155174
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-eslint.yml

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,12 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
6-
# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
7-
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
88

99
name: Lint eslint
1010

11-
on:
12-
pull_request:
13-
paths:
14-
- '.github/workflows/**'
15-
- 'src/**'
16-
- 'appinfo/info.xml'
17-
- 'package.json'
18-
- 'package-lock.json'
19-
- 'tsconfig.json'
20-
- '.eslintrc.*'
21-
- '.eslintignore'
22-
- '**.js'
23-
- '**.ts'
24-
- '**.vue'
11+
on: pull_request
2512

2613
permissions:
2714
contents: read
@@ -31,32 +18,81 @@ concurrency:
3118
cancel-in-progress: true
3219

3320
jobs:
21+
changes:
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- '.eslintrc.*'
44+
- '.eslintignore'
45+
- '**.js'
46+
- '**.ts'
47+
- '**.vue'
48+
3449
lint:
3550
runs-on: ubuntu-latest
3651

37-
name: eslint
52+
needs: changes
53+
if: needs.changes.outputs.src != 'false'
54+
55+
name: NPM lint
3856

3957
steps:
4058
- name: Checkout
41-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
59+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4260

4361
- name: Read package.json node and npm engines version
44-
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
62+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4563
id: versions
4664
with:
47-
fallbackNode: '^16'
48-
fallbackNpm: '^7'
65+
fallbackNode: '^20'
66+
fallbackNpm: '^10'
4967

5068
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
69+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5270
with:
5371
node-version: ${{ steps.versions.outputs.nodeVersion }}
5472

5573
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
56-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
74+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
5775

5876
- name: Install dependencies
77+
env:
78+
CYPRESS_INSTALL_BINARY: 0
79+
PUPPETEER_SKIP_DOWNLOAD: true
5980
run: npm ci
6081

6182
- name: Lint
6283
run: npm run lint
84+
85+
summary:
86+
permissions:
87+
contents: none
88+
runs-on: ubuntu-latest-low
89+
needs: [changes, lint]
90+
91+
if: always()
92+
93+
# This is the summary, we just avoid to rename it so that branch protection rules still match
94+
name: eslint
95+
96+
steps:
97+
- name: Summary status
98+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-info-xml.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Lint info.xml
710

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- master
14-
- stable*
11+
on: pull_request
1512

1613
permissions:
1714
contents: read
@@ -22,18 +19,18 @@ concurrency:
2219

2320
jobs:
2421
xml-linters:
25-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-latest-low
2623

2724
name: info.xml lint
2825
steps:
2926
- name: Checkout
30-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3128

3229
- name: Download schema
3330
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
3431

3532
- name: Lint info.xml
36-
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
33+
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
3734
with:
3835
xml-file: ./appinfo/info.xml
3936
xml-schema-file: ./info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Lint php-cs
710

@@ -22,19 +25,26 @@ jobs:
2225

2326
steps:
2427
- name: Checkout
25-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29+
30+
- name: Get php version
31+
id: versions
32+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
2633

27-
- name: Set up php
28-
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
34+
- name: Set up php${{ steps.versions.outputs.php-available }}
35+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
2936
with:
30-
php-version: 8.1
37+
php-version: ${{ steps.versions.outputs.php-available }}
38+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3139
coverage: none
3240
ini-file: development
3341
env:
3442
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3543

3644
- name: Install dependencies
37-
run: composer i
45+
run: |
46+
composer remove nextcloud/ocp --dev
47+
composer i
3848
3949
- name: Lint
4050
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

0 commit comments

Comments
 (0)