2
2
#
3
3
# https://github.com/nextcloud/.github
4
4
# 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
5
8
6
9
name : Build and publish app release
7
10
8
11
on :
9
12
release :
10
13
types : [published]
11
14
12
- env :
13
- PHP_VERSION : 8.1
14
-
15
15
jobs :
16
16
build_and_publish :
17
17
runs-on : ubuntu-latest
21
21
22
22
steps :
23
23
- name : Check actor permission
24
- uses : skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
24
+ uses : skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
25
25
with :
26
26
require : write
27
27
32
32
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
33
33
34
34
- name : Checkout
35
- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
35
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36
36
with :
37
37
path : ${{ env.APP_NAME }}
38
38
@@ -44,38 +44,44 @@ jobs:
44
44
expression : " //info//dependencies//nextcloud/@min-version"
45
45
46
46
- name : Read package.json node and npm engines version
47
- uses : skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
47
+ uses : skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
48
48
id : versions
49
49
# Continue if no package.json
50
50
continue-on-error : true
51
51
with :
52
52
path : ${{ env.APP_NAME }}
53
- fallbackNode : " ^16 "
54
- fallbackNpm : " ^7 "
53
+ fallbackNode : ' ^20 '
54
+ fallbackNpm : ' ^10 '
55
55
56
56
- name : Set up node ${{ steps.versions.outputs.nodeVersion }}
57
57
# Skip if no package.json
58
58
if : ${{ steps.versions.outputs.nodeVersion }}
59
- uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
59
+ uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
60
60
with :
61
61
node-version : ${{ steps.versions.outputs.nodeVersion }}
62
62
63
63
- name : Set up npm ${{ steps.versions.outputs.npmVersion }}
64
64
# Skip if no package.json
65
65
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
67
73
68
- - name : Set up php ${{ env.PHP_VERSION }}
69
- uses : shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
74
+ - name : Set up php ${{ steps.php-versions.outputs.php-min }}
75
+ uses : shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
70
76
with :
71
- php-version : ${{ env.PHP_VERSION }}
77
+ php-version : ${{ steps.php-versions.outputs.php-min }}
72
78
coverage : none
73
79
env :
74
80
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
81
76
82
- name : Check composer.json
77
83
id : check_composer
78
- uses : andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
84
+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
79
85
with :
80
86
files : " ${{ env.APP_NAME }}/composer.json"
81
87
@@ -88,14 +94,16 @@ jobs:
88
94
- name : Build ${{ env.APP_NAME }}
89
95
# Skip if no package.json
90
96
if : ${{ steps.versions.outputs.nodeVersion }}
97
+ env :
98
+ CYPRESS_INSTALL_BINARY : 0
91
99
run : |
92
100
cd ${{ env.APP_NAME }}
93
101
npm ci
94
- npm run build
102
+ npm run build --if-present
95
103
96
104
- name : Check Krankerl config
97
105
id : krankerl
98
- uses : andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
106
+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
99
107
with :
100
108
files : ${{ env.APP_NAME }}/krankerl.toml
101
109
@@ -121,12 +129,12 @@ jobs:
121
129
continue-on-error : true
122
130
id : server-checkout
123
131
run : |
124
- NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
132
+ NCVERSION=' ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
125
133
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
126
134
unzip latest-$NCVERSION.zip
127
135
128
136
- name : Checkout server master fallback
129
- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
137
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
130
138
if : ${{ steps.server-checkout.outcome != 'success' }}
131
139
with :
132
140
submodules : true
@@ -136,24 +144,24 @@ jobs:
136
144
- name : Sign app
137
145
run : |
138
146
# Extracting release
139
- cd ${{ env.APP_NAME }}/build/artifacts/appstore
147
+ cd ${{ env.APP_NAME }}/build/artifacts
140
148
tar -xvf ${{ env.APP_NAME }}.tar.gz
141
- cd ../../../../
149
+ cd ../../../
142
150
# Setting up keys
143
- echo " ${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
151
+ echo ' ${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
144
152
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
145
153
# Signing
146
- 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 }}
154
+ 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 }}
147
155
# Rebuilding archive
148
- cd ${{ env.APP_NAME }}/build/artifacts/appstore
156
+ cd ${{ env.APP_NAME }}/build/artifacts
149
157
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150
158
151
159
- name : Attach tarball to github release
152
- uses : svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
160
+ uses : svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
153
161
id : attach_to_release
154
162
with :
155
163
repo_token : ${{ secrets.GITHUB_TOKEN }}
156
- file : ${{ env.APP_NAME }}/build/artifacts/appstore/ ${{ env.APP_NAME }}.tar.gz
164
+ file : ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
157
165
asset_name : ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz
158
166
tag : ${{ github.ref }}
159
167
overwrite : true
0 commit comments