Skip to content

Commit f445187

Browse files
Merge pull request #492 from nextcloud/backport/491/stable34
[stable34] chore: Update workflows from nextcloud/.github
2 parents 3929c7f + 17b5014 commit f445187

14 files changed

Lines changed: 150 additions & 131 deletions

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

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3636
3737
- name: Checkout
38-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3939
with:
4040
persist-credentials: false
4141
path: ${{ env.APP_NAME }}
@@ -65,15 +65,16 @@ jobs:
6565
continue-on-error: true
6666
with:
6767
path: ${{ env.APP_NAME }}
68-
fallbackNode: '^20'
69-
fallbackNpm: '^10'
68+
fallbackNode: '^24'
69+
fallbackNpm: '^11.3'
7070

7171
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
7272
# Skip if no package.json
7373
if: ${{ steps.versions.outputs.nodeVersion }}
74-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
74+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7575
with:
7676
node-version: ${{ steps.versions.outputs.nodeVersion }}
77+
package-manager-cache: false
7778

7879
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
7980
# Skip if no package.json
@@ -82,12 +83,12 @@ jobs:
8283

8384
- name: Get php version
8485
id: php-versions
85-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
86+
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
8687
with:
8788
filename: ${{ env.APP_NAME }}/appinfo/info.xml
8889

8990
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
90-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
91+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
9192
with:
9293
php-version: ${{ steps.php-versions.outputs.php-min }}
9394
coverage: none
@@ -96,7 +97,7 @@ jobs:
9697

9798
- name: Check composer.json
9899
id: check_composer
99-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
100+
uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
100101
with:
101102
files: "${{ env.APP_NAME }}/composer.json"
102103

@@ -118,7 +119,7 @@ jobs:
118119
119120
- name: Check Krankerl config
120121
id: krankerl
121-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
122+
uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
122123
with:
123124
files: ${{ env.APP_NAME }}/krankerl.toml
124125

@@ -140,23 +141,31 @@ jobs:
140141
cd ${{ env.APP_NAME }}
141142
make appstore
142143
143-
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
144-
continue-on-error: true
145-
id: server-checkout
144+
- name: Check server download link for ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
146145
run: |
147146
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
148-
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
149-
unzip latest-$NCVERSION.zip
147+
DOWNLOAD_URL=$(curl -s "https://updates.nextcloud.com/updater_server/latest?channel=beta&version=$NCVERSION" | jq -r '.downloads.zip[0]')
148+
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV
149+
150+
- name: Download server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
151+
continue-on-error: true
152+
id: server-download
153+
if: ${{ env.DOWNLOAD_URL != 'null' }}
154+
run: |
155+
echo "Downloading release tarball from $DOWNLOAD_URL"
156+
wget $DOWNLOAD_URL -O nextcloud.zip
157+
unzip nextcloud.zip
150158
151159
- name: Checkout server master fallback
152-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
153-
if: ${{ steps.server-checkout.outcome != 'success' }}
160+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
161+
if: ${{ steps.server-download.outcome != 'success' }}
154162
with:
155163
persist-credentials: false
156164
submodules: true
157165
repository: nextcloud/server
158166
path: nextcloud
159167

168+
160169
- name: Sign app
161170
run: |
162171
# Extracting release
@@ -173,7 +182,7 @@ jobs:
173182
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
174183
175184
- name: Attach tarball to github release
176-
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2
185+
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
177186
id: attach_to_release
178187
with:
179188
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cypress.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ jobs:
4646
exit 1
4747
4848
- name: Checkout app
49-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5050
with:
5151
persist-credentials: false
5252

5353
- name: Check composer.json
5454
id: check_composer
55-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
55+
uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
5656
with:
57-
files: "composer.json"
57+
files: 'composer.json'
5858

5959
- name: Install composer dependencies
6060
if: steps.check_composer.outputs.files_exists == 'true'
@@ -64,11 +64,11 @@ jobs:
6464
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6565
id: versions
6666
with:
67-
fallbackNode: "^20"
68-
fallbackNpm: "^10"
67+
fallbackNode: '^24'
68+
fallbackNpm: '^11.3'
6969

7070
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
71+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7272
with:
7373
node-version: ${{ steps.versions.outputs.nodeVersion }}
7474

@@ -81,7 +81,7 @@ jobs:
8181
TESTING=true npm run build --if-present
8282
8383
- name: Save context
84-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
84+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8585
with:
8686
key: cypress-context-${{ github.run_id }}
8787
path: ./
@@ -95,28 +95,28 @@ jobs:
9595
matrix:
9696
# Run multiple copies of the current job in parallel
9797
# Please increase the number or runners as your tests suite grows
98-
containers: ['1']
98+
containers: ['component', '1', '2', '3']
9999

100100
name: runner ${{ matrix.containers }}
101101

102102
steps:
103103
- name: Restore context
104-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
104+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
105105
with:
106106
fail-on-cache-miss: true
107107
key: cypress-context-${{ github.run_id }}
108108
path: ./
109109

110110
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
111-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
111+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
112112
with:
113113
node-version: ${{ needs.init.outputs.nodeVersion }}
114114

115115
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
116116
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
117117

118118
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
119-
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
119+
uses: cypress-io/github-action@dace029018fcdf86e0df89a31bc3cfa5b32570d8 # v7.3.0
120120
with:
121121
record: ${{ secrets.CYPRESS_RECORD_KEY && true }}
122122
parallel: ${{ secrets.CYPRESS_RECORD_KEY && true }}
@@ -139,7 +139,7 @@ jobs:
139139
CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
140140

141141
- name: Upload snapshots
142-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
142+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
143143
if: always()
144144
with:
145145
name: snapshots_${{ matrix.containers }}
@@ -150,7 +150,7 @@ jobs:
150150
run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
151151

152152
- name: Upload NC logs
153-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
153+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
154154
if: failure() && matrix.containers != 'component'
155155
with:
156156
name: nc_logs_${{ matrix.containers }}

.github/workflows/dependabot-approve-merge.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
6-
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
6+
# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
77
# SPDX-License-Identifier: MIT
88

9-
name: Dependabot
9+
name: Auto approve Dependabot PRs
1010

1111
on:
1212
pull_request_target: # zizmor: ignore[dangerous-triggers]
@@ -24,11 +24,13 @@ concurrency:
2424

2525
jobs:
2626
auto-approve-merge:
27-
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
27+
if: github.event.pull_request.user.login == 'dependabot[bot]'
2828
runs-on: ubuntu-latest-low
2929
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
30+
# for auto-approve step to work
3131
pull-requests: write
32+
# for alexwilson/enable-github-automerge-action to approve PRs
33+
contents: write
3234

3335
steps:
3436
- name: Disabled on forks
@@ -37,13 +39,27 @@ jobs:
3739
echo 'Can not approve PRs from forks'
3840
exit 1
3941
40-
# GitHub actions bot approve
41-
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
42+
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
43+
id: branchname
44+
with:
45+
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Dependabot metadata
48+
id: metadata
49+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
4250
with:
4351
github-token: ${{ secrets.GITHUB_TOKEN }}
4452

45-
# Nextcloud bot approve and merge request
46-
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
53+
- name: GitHub actions bot approve
54+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
55+
run: gh pr review --approve "$PR_URL"
56+
env:
57+
PR_URL: ${{ github.event.pull_request.html_url }}
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+
# Enable GitHub auto merge
61+
- name: Auto merge
62+
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # 2.0.0
63+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/') && (github.event.action == 'opened' || github.event.action == 'reopened') && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor')
4764
with:
48-
target: minor
49-
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
65+
github-token: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: info.xml lint
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828
with:
2929
persist-credentials: false
3030

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
with:
3030
persist-credentials: false
3131

3232
- name: Get php version
3333
id: versions
34-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
34+
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3535

3636
- name: Set up php${{ steps.versions.outputs.php-min }}
37-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
37+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
3838
with:
3939
php-version: ${{ steps.versions.outputs.php-min }}
4040
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/lint-php.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,35 @@ jobs:
2121
matrix:
2222
runs-on: ubuntu-latest-low
2323
outputs:
24-
php-versions: ${{ steps.versions.outputs.php-versions }}
24+
php-min: ${{ steps.versions.outputs.php-min }}
25+
php-max: ${{ steps.versions.outputs.php-max }}
2526
steps:
2627
- name: Checkout app
27-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2829
with:
2930
persist-credentials: false
3031

3132
- name: Get version matrix
3233
id: versions
33-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
34+
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3435

3536
php-lint:
3637
runs-on: ubuntu-latest
3738
needs: matrix
3839
strategy:
3940
matrix:
40-
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
41+
php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}']
4142

4243
name: php-lint
4344

4445
steps:
4546
- name: Checkout
46-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4748
with:
4849
persist-credentials: false
4950

5051
- name: Set up php ${{ matrix.php-versions }}
51-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
52+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
5253
with:
5354
php-version: ${{ matrix.php-versions }}
5455
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
matrix: ${{ steps.versions.outputs.sparse-matrix }}
2525
steps:
2626
- name: Checkout app
27-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828
with:
2929
persist-credentials: false
3030

3131
- name: Get version matrix
3232
id: versions
33-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
33+
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3434
with:
3535
matrix: '{"mysql-versions": ["8.4"]}'
3636

@@ -44,7 +44,7 @@ jobs:
4444
src: ${{ steps.changes.outputs.src}}
4545

4646
steps:
47-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
47+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
4848
id: changes
4949
continue-on-error: true
5050
with:
@@ -89,21 +89,21 @@ jobs:
8989
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9090
9191
- name: Checkout server
92-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
92+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9393
with:
9494
persist-credentials: false
9595
submodules: true
9696
repository: nextcloud/server
9797
ref: ${{ matrix.server-versions }}
9898

9999
- name: Checkout app
100-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
100+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
101101
with:
102102
persist-credentials: false
103103
path: apps/${{ env.APP_NAME }}
104104

105105
- name: Set up php ${{ matrix.php-versions }}
106-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
106+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
107107
with:
108108
php-version: ${{ matrix.php-versions }}
109109
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -122,7 +122,7 @@ jobs:
122122
123123
- name: Check composer file existence
124124
id: check_composer
125-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
125+
uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
126126
with:
127127
files: apps/${{ env.APP_NAME }}/composer.json
128128

0 commit comments

Comments
 (0)