Skip to content

Commit 14b5b08

Browse files
authored
Merge pull request #32 from icewind1991/release-0.1.17
0.1.17
2 parents 76d44f0 + 91fb501 commit 14b5b08

23 files changed

+5646
-2269
lines changed

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

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@
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

15+
permissions:
16+
contents: write
17+
1218
jobs:
1319
build_and_publish:
1420
runs-on: ubuntu-latest
1521

16-
if: ${{ github.repository_owner == 'icewind1991' }}
22+
# Only allowed to be run on nextcloud-releases repositories
23+
if: ${{ github.repository_owner == 'nextcloud-releases' }}
1724

1825
steps:
1926
- name: Check actor permission
@@ -28,10 +35,22 @@ jobs:
2835
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
2936
3037
- name: Checkout
31-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3239
with:
40+
persist-credentials: false
3341
path: ${{ env.APP_NAME }}
3442

43+
- name: Get app version number
44+
id: app-version
45+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
46+
with:
47+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
48+
expression: "//info//version/text()"
49+
50+
- name: Validate app version against tag
51+
run: |
52+
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
53+
3554
- name: Get appinfo data
3655
id: appinfo
3756
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
@@ -40,7 +59,7 @@ jobs:
4059
expression: "//info//dependencies//nextcloud/@min-version"
4160

4261
- name: Read package.json node and npm engines version
43-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
62+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4463
id: versions
4564
# Continue if no package.json
4665
continue-on-error: true
@@ -52,14 +71,14 @@ jobs:
5271
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5372
# Skip if no package.json
5473
if: ${{ steps.versions.outputs.nodeVersion }}
55-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
74+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
5675
with:
5776
node-version: ${{ steps.versions.outputs.nodeVersion }}
5877

5978
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
6079
# Skip if no package.json
6180
if: ${{ steps.versions.outputs.npmVersion }}
62-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
81+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
6382

6483
- name: Get php version
6584
id: php-versions
@@ -68,7 +87,7 @@ jobs:
6887
filename: ${{ env.APP_NAME }}/appinfo/info.xml
6988

7089
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
71-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
90+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
7291
with:
7392
php-version: ${{ steps.php-versions.outputs.php-min }}
7493
coverage: none
@@ -95,7 +114,7 @@ jobs:
95114
run: |
96115
cd ${{ env.APP_NAME }}
97116
npm ci
98-
npm run build
117+
npm run build --if-present
99118
100119
- name: Check Krankerl config
101120
id: krankerl
@@ -125,14 +144,15 @@ jobs:
125144
continue-on-error: true
126145
id: server-checkout
127146
run: |
128-
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
147+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
129148
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
130149
unzip latest-$NCVERSION.zip
131150
132151
- name: Checkout server master fallback
133-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
152+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
134153
if: ${{ steps.server-checkout.outcome != 'success' }}
135154
with:
155+
persist-credentials: false
136156
submodules: true
137157
repository: nextcloud/server
138158
path: nextcloud
@@ -144,7 +164,7 @@ jobs:
144164
tar -xvf ${{ env.APP_NAME }}.tar.gz
145165
cd ../../../
146166
# Setting up keys
147-
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
167+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
148168
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
149169
# Signing
150170
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 }}

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

Lines changed: 6 additions & 1 deletion
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 info.xml
710

@@ -21,7 +24,9 @@ jobs:
2124
name: info.xml lint
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2530

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

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

Lines changed: 12 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,24 +25,28 @@ jobs:
2225

2326
steps:
2427
- name: Checkout
25-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2631

2732
- name: Get php version
2833
id: versions
2934
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3035

31-
- name: Set up php${{ steps.versions.outputs.php-available }}
32-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
3338
with:
34-
php-version: ${{ steps.versions.outputs.php-available }}
39+
php-version: ${{ steps.versions.outputs.php-min }}
3540
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3641
coverage: none
3742
ini-file: development
3843
env:
3944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4045

4146
- name: Install dependencies
42-
run: composer i
47+
run: |
48+
composer remove nextcloud/ocp --dev
49+
composer i
4350
4451
- name: Lint
4552
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

Lines changed: 11 additions & 3 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
710

@@ -21,7 +24,10 @@ jobs:
2124
php-versions: ${{ steps.versions.outputs.php-versions }}
2225
steps:
2326
- name: Checkout app
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
30+
2531
- name: Get version matrix
2632
id: versions
2733
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
@@ -37,10 +43,12 @@ jobs:
3743

3844
steps:
3945
- name: Checkout
40-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
persist-credentials: false
4149

4250
- name: Set up php ${{ matrix.php-versions }}
43-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
51+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
4452
with:
4553
php-version: ${{ matrix.php-versions }}
4654
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/phpunit-mysql.yml

Lines changed: 21 additions & 9 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: 2022-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: PHPUnit MySQL
710

@@ -21,16 +24,21 @@ jobs:
2124
matrix: ${{ steps.versions.outputs.sparse-matrix }}
2225
steps:
2326
- name: Checkout app
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2530

2631
- name: Get version matrix
2732
id: versions
2833
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
2934
with:
30-
matrix: '{"mysql-versions": ["8.1"]}'
35+
matrix: '{"mysql-versions": ["8.4"]}'
3136

3237
changes:
3338
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
pull-requests: read
3442

3543
outputs:
3644
src: ${{ steps.changes.outputs.src}}
@@ -75,37 +83,42 @@ jobs:
7583

7684
steps:
7785
- name: Set app env
86+
if: ${{ env.APP_NAME == '' }}
7887
run: |
7988
# Split and keep last
8089
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8190
8291
- name: Checkout server
83-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
92+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8493
with:
94+
persist-credentials: false
8595
submodules: true
8696
repository: nextcloud/server
8797
ref: ${{ matrix.server-versions }}
8898

8999
- name: Checkout app
90-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
100+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91101
with:
102+
persist-credentials: false
92103
path: apps/${{ env.APP_NAME }}
93104

94105
- name: Set up php ${{ matrix.php-versions }}
95-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
106+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
96107
with:
97108
php-version: ${{ matrix.php-versions }}
98109
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
99110
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
100111
coverage: none
101112
ini-file: development
113+
# Temporary workaround for missing pcntl_* in PHP 8.3
114+
ini-values: disable_functions=
102115
env:
103116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104117

105118
- name: Enable ONLY_FULL_GROUP_BY MySQL option
106119
run: |
107120
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
108-
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
121+
echo 'SELECT @@sql_mode;' | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
109122
110123
- name: Check composer file existence
111124
id: check_composer
@@ -118,7 +131,6 @@ jobs:
118131
if: steps.check_composer.outputs.files_exists == 'true'
119132
working-directory: apps/${{ env.APP_NAME }}
120133
run: |
121-
rm composer.lock
122134
composer remove nextcloud/ocp --dev
123135
composer i
124136
@@ -135,7 +147,7 @@ jobs:
135147
continue-on-error: true
136148
working-directory: apps/${{ env.APP_NAME }}
137149
run: |
138-
composer run --list | grep "^ test:unit " | wc -l | grep 1
150+
composer run --list | grep '^ test:unit ' | wc -l | grep 1
139151
140152
- name: PHPUnit
141153
# Only run if phpunit config file exists
@@ -148,7 +160,7 @@ jobs:
148160
continue-on-error: true
149161
working-directory: apps/${{ env.APP_NAME }}
150162
run: |
151-
composer run --list | grep "^ test:integration " | wc -l | grep 1
163+
composer run --list | grep '^ test:integration ' | wc -l | grep 1
152164
153165
- name: Run Nextcloud
154166
# Only run if phpunit integration config file exists

0 commit comments

Comments
 (0)