Skip to content

Commit b74c5b7

Browse files
committed
chore: update workflows from templates
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 1caa50a commit b74c5b7

10 files changed

+328
-172
lines changed

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

+27-19
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,7 +32,7 @@ jobs:
3232
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3333
3434
- name: Checkout
35-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
35+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3636
with:
3737
path: ${{ env.APP_NAME }}
3838

@@ -44,38 +44,44 @@ jobs:
4444
expression: "//info//dependencies//nextcloud/@min-version"
4545

4646
- name: Read package.json node and npm engines version
47-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
47+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4848
id: versions
4949
# Continue if no package.json
5050
continue-on-error: true
5151
with:
5252
path: ${{ env.APP_NAME }}
5353
fallbackNode: '^20'
54-
fallbackNpm: '^9'
54+
fallbackNpm: '^10'
5555

5656
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5757
# Skip if no package.json
5858
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
59+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
6060
with:
6161
node-version: ${{ steps.versions.outputs.nodeVersion }}
6262

6363
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
6464
# Skip if no package.json
6565
if: ${{ steps.versions.outputs.npmVersion }}
66-
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
6773

68-
- name: Set up php ${{ env.PHP_VERSION }}
69-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
74+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
75+
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
7076
with:
71-
php-version: ${{ env.PHP_VERSION }}
77+
php-version: ${{ steps.php-versions.outputs.php-min }}
7278
coverage: none
7379
env:
7480
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7581

7682
- name: Check composer.json
7783
id: check_composer
78-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
84+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
7985
with:
8086
files: "${{ env.APP_NAME }}/composer.json"
8187

@@ -88,14 +94,16 @@ jobs:
8894
- name: Build ${{ env.APP_NAME }}
8995
# Skip if no package.json
9096
if: ${{ steps.versions.outputs.nodeVersion }}
97+
env:
98+
NODE_ENV: production
9199
run: |
92100
cd ${{ env.APP_NAME }}
93101
npm ci
94-
npm run build
102+
npm run build --if-present
95103
96104
- name: Check Krankerl config
97105
id: krankerl
98-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
106+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
99107
with:
100108
files: ${{ env.APP_NAME }}/krankerl.toml
101109

@@ -121,12 +129,12 @@ jobs:
121129
continue-on-error: true
122130
id: server-checkout
123131
run: |
124-
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
132+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
125133
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
126134
unzip latest-$NCVERSION.zip
127135
128136
- name: Checkout server master fallback
129-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
137+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
130138
if: ${{ steps.server-checkout.outcome != 'success' }}
131139
with:
132140
submodules: true
@@ -140,7 +148,7 @@ jobs:
140148
tar -xvf ${{ env.APP_NAME }}.tar.gz
141149
cd ../../../
142150
# Setting up keys
143-
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
151+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
144152
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
145153
# Signing
146154
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 }}
@@ -149,7 +157,7 @@ jobs:
149157
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150158
151159
- name: Attach tarball to github release
152-
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
160+
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
153161
id: attach_to_release
154162
with:
155163
repo_token: ${{ secrets.GITHUB_TOKEN }}

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

+6-3
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: Dependabot
710

@@ -21,14 +24,14 @@ concurrency:
2124

2225
jobs:
2326
auto-approve-merge:
24-
if: github.actor == 'dependabot[bot]'
25-
runs-on: ubuntu-latest
27+
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
28+
runs-on: ubuntu-latest-low
2629
permissions:
2730
# for hmarr/auto-approve-action to approve PRs
2831
pull-requests: write
2932

3033
steps:
31-
# Github actions bot approve
34+
# GitHub actions bot approve
3235
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3336
with:
3437
github-token: ${{ secrets.GITHUB_TOKEN }}

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

+7-10
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
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

+12-4
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,12 +25,17 @@ jobs:
2225

2326
steps:
2427
- name: Checkout
25-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
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@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
34+
- name: Set up php${{ steps.versions.outputs.php-available }}
35+
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
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:

.github/workflows/lint-php.yml

+21-11
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 php
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
@@ -21,22 +18,35 @@ concurrency:
2118
cancel-in-progress: true
2219

2320
jobs:
21+
matrix:
22+
runs-on: ubuntu-latest-low
23+
outputs:
24+
php-versions: ${{ steps.versions.outputs.php-versions }}
25+
steps:
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
31+
2432
php-lint:
2533
runs-on: ubuntu-latest
34+
needs: matrix
2635
strategy:
2736
matrix:
28-
php-versions: [ "8.0", "8.1", "8.2" ]
37+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
2938

3039
name: php-lint
3140

3241
steps:
3342
- name: Checkout
34-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
43+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3544

3645
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
46+
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
3847
with:
3948
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
4050
coverage: none
4151
ini-file: development
4252
env:
@@ -48,7 +58,7 @@ jobs:
4858
summary:
4959
permissions:
5060
contents: none
51-
runs-on: ubuntu-latest
61+
runs-on: ubuntu-latest-low
5262
needs: php-lint
5363

5464
if: always()

0 commit comments

Comments
 (0)