Skip to content

Commit 7a3c76a

Browse files
committed
chore: update workflows from templates
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 110f0d9 commit 7a3c76a

File tree

6 files changed

+90
-139
lines changed

6 files changed

+90
-139
lines changed

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

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
release:
1313
types: [published]
1414

15-
env:
16-
PHP_VERSION: 8.1
17-
1815
jobs:
1916
build_and_publish:
2017
runs-on: ubuntu-latest
@@ -35,7 +32,7 @@ jobs:
3532
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3633
3734
- name: Checkout
38-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
35+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3936
with:
4037
path: ${{ env.APP_NAME }}
4138

@@ -47,7 +44,7 @@ jobs:
4744
expression: "//info//dependencies//nextcloud/@min-version"
4845

4946
- name: Read package.json node and npm engines version
50-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
47+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
5148
id: versions
5249
# Continue if no package.json
5350
continue-on-error: true
@@ -59,26 +56,32 @@ jobs:
5956
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
6057
# Skip if no package.json
6158
if: ${{ steps.versions.outputs.nodeVersion }}
62-
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
59+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
6360
with:
6461
node-version: ${{ steps.versions.outputs.nodeVersion }}
6562

6663
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
6764
# Skip if no package.json
6865
if: ${{ steps.versions.outputs.npmVersion }}
69-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
66+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
67+
68+
- name: Get php version
69+
id: php-versions
70+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
71+
with:
72+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
7073

71-
- name: Set up php ${{ env.PHP_VERSION }}
72-
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
74+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
75+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
7376
with:
74-
php-version: ${{ env.PHP_VERSION }}
77+
php-version: ${{ steps.php-versions.outputs.php-min }}
7578
coverage: none
7679
env:
7780
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7881

7982
- name: Check composer.json
8083
id: check_composer
81-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
84+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
8285
with:
8386
files: "${{ env.APP_NAME }}/composer.json"
8487

@@ -96,11 +99,11 @@ jobs:
9699
run: |
97100
cd ${{ env.APP_NAME }}
98101
npm ci
99-
npm run build
102+
npm run build --if-present
100103
101104
- name: Check Krankerl config
102105
id: krankerl
103-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
106+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
104107
with:
105108
files: ${{ env.APP_NAME }}/krankerl.toml
106109

@@ -126,12 +129,12 @@ jobs:
126129
continue-on-error: true
127130
id: server-checkout
128131
run: |
129-
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
132+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
130133
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
131134
unzip latest-$NCVERSION.zip
132135
133136
- name: Checkout server master fallback
134-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
137+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
135138
if: ${{ steps.server-checkout.outcome != 'success' }}
136139
with:
137140
submodules: true
@@ -145,7 +148,7 @@ jobs:
145148
tar -xvf ${{ env.APP_NAME }}.tar.gz
146149
cd ../../../
147150
# Setting up keys
148-
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
151+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
149152
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
150153
# Signing
151154
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 }}
@@ -154,7 +157,7 @@ jobs:
154157
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
155158
156159
- name: Attach tarball to github release
157-
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
160+
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
158161
id: attach_to_release
159162
with:
160163
repo_token: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 13 additions & 47 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

@@ -15,46 +18,24 @@ concurrency:
1518
cancel-in-progress: true
1619

1720
jobs:
18-
changes:
19-
runs-on: ubuntu-latest
20-
21-
outputs:
22-
src: ${{ steps.changes.outputs.src}}
23-
24-
steps:
25-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
26-
id: changes
27-
continue-on-error: true
28-
with:
29-
filters: |
30-
src:
31-
- '.github/workflows/**'
32-
- '3rdparty/**'
33-
- '**/lib/**'
34-
- '**/tests/**'
35-
- '**/vendor-bin/**'
36-
- '.php-cs-fixer.dist.php'
37-
- 'composer.json'
38-
- 'composer.lock'
39-
- '**.php'
40-
4121
lint:
4222
runs-on: ubuntu-latest
4323

44-
name: PHP CS fixer lint
45-
46-
strategy:
47-
matrix:
48-
php-versions: [ "8.1", "8.2", "8.3" ]
24+
name: php-cs
4925

5026
steps:
5127
- name: Checkout
52-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5329

54-
- name: Set up php
55-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
30+
- name: Get php version
31+
id: versions
32+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
33+
34+
- name: Set up php${{ steps.versions.outputs.php-available }}
35+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
5636
with:
57-
php-version: ${{ matrix.php-versions }}
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
5839
coverage: none
5940
ini-file: development
6041
env:
@@ -65,18 +46,3 @@ jobs:
6546

6647
- name: Lint
6748
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
68-
69-
summary:
70-
permissions:
71-
contents: none
72-
runs-on: ubuntu-latest
73-
needs: [changes, lint]
74-
75-
if: always()
76-
77-
# This is the summary, we just avoid to rename it so that branch protection rules still match
78-
name: php-cs
79-
80-
steps:
81-
- name: Summary status
82-
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-php.yml

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +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 php
710

8-
on:
9-
pull_request:
11+
on: pull_request
1012

1113
permissions:
1214
contents: read
@@ -16,49 +18,35 @@ concurrency:
1618
cancel-in-progress: true
1719

1820
jobs:
19-
changes:
20-
runs-on: ubuntu-latest
21-
21+
matrix:
22+
runs-on: ubuntu-latest-low
2223
outputs:
23-
src: ${{ steps.changes.outputs.src}}
24-
24+
php-versions: ${{ steps.versions.outputs.php-versions }}
2525
steps:
26-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
27-
id: changes
28-
continue-on-error: true
29-
with:
30-
filters: |
31-
src:
32-
- '.github/workflows/**'
33-
- '3rdparty/**'
34-
- '**/lib/**'
35-
- '**/tests/**'
36-
- '**/vendor-bin/**'
37-
- '.php-cs-fixer.dist.php'
38-
- 'composer.json'
39-
- 'composer.lock'
40-
- '**.php'
26+
- name: Checkout app
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
- name: Get version matrix
29+
id: versions
30+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
4131

42-
lint:
32+
php-lint:
4333
runs-on: ubuntu-latest
44-
45-
needs: changes
46-
if: needs.changes.outputs.src != 'false'
47-
34+
needs: matrix
4835
strategy:
4936
matrix:
50-
php-versions: [ "8.1", "8.2", "8.3" ]
37+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
5138

5239
name: php-lint
5340

5441
steps:
5542
- name: Checkout
56-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5744

5845
- name: Set up php ${{ matrix.php-versions }}
59-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
46+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
6047
with:
6148
php-version: ${{ matrix.php-versions }}
49+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
6250
coverage: none
6351
ini-file: development
6452
env:
@@ -70,13 +58,13 @@ jobs:
7058
summary:
7159
permissions:
7260
contents: none
73-
runs-on: ubuntu-latest
74-
needs: [changes, lint]
61+
runs-on: ubuntu-latest-low
62+
needs: php-lint
7563

7664
if: always()
7765

7866
name: php-lint-summary
7967

8068
steps:
8169
- name: Summary status
82-
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi
70+
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi

.github/workflows/node.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +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: Node
710

8-
on:
9-
pull_request:
11+
on: pull_request
1012

1113
permissions:
1214
contents: read
@@ -17,21 +19,24 @@ concurrency:
1719

1820
jobs:
1921
changes:
20-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
2126

2227
outputs:
2328
src: ${{ steps.changes.outputs.src}}
2429

2530
steps:
26-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
2732
id: changes
2833
continue-on-error: true
2934
with:
3035
filters: |
3136
src:
3237
- '.github/workflows/**'
33-
- '**/src/**'
34-
- '**/appinfo/info.xml'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
3540
- 'package.json'
3641
- 'package-lock.json'
3742
- 'tsconfig.json'
@@ -48,26 +53,27 @@ jobs:
4853
name: NPM build
4954
steps:
5055
- name: Checkout
51-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.6.0
56+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5257

5358
- name: Read package.json node and npm engines version
54-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
59+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
5560
id: versions
5661
with:
5762
fallbackNode: '^20'
58-
fallbackNpm: '^9'
63+
fallbackNpm: '^10'
5964

6065
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
61-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
66+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
6267
with:
6368
node-version: ${{ steps.versions.outputs.nodeVersion }}
6469

6570
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
66-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
71+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
6772

6873
- name: Install dependencies & build
6974
env:
7075
CYPRESS_INSTALL_BINARY: 0
76+
PUPPETEER_SKIP_DOWNLOAD: true
7177
run: |
7278
npm ci
7379
npm run build --if-present
@@ -86,7 +92,7 @@ jobs:
8692
summary:
8793
permissions:
8894
contents: none
89-
runs-on: ubuntu-latest
95+
runs-on: ubuntu-latest-low
9096
needs: [changes, build]
9197

9298
if: always()

0 commit comments

Comments
 (0)