1- # This workflow is adjusted compared to the one from the template to setup rust+cross
1+ # This workflow is provided via the organization template repository
2+ #
3+ # https://github.com/nextcloud/.github
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
28
39name : Build and publish app release
410
511on :
612 release :
713 types : [published]
814
9- env :
10- PHP_VERSION : 8.1
15+ permissions :
16+ contents : write
1117
1218jobs :
1319 build_and_publish :
@@ -17,25 +23,14 @@ jobs:
1723 if : ${{ github.repository_owner == 'nextcloud-releases' }}
1824
1925 steps :
20- # ## Adjustments start ###
21- - name : musl-tools
22- run : |
23- sudo apt-get install musl-tools
24- - name : Checkout code
25- uses : actions/checkout@v3
26- - uses : actions-rs/toolchain@v1
26+ - uses : cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
27+ - uses : cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
2728 with :
28- profile : minimal
29- toolchain : stable
30- override : true
31- target : x86_64-unknown-linux-musl
32- - name : cross
33- run : |
34- cargo install cross --locked
35- # ## Adjustments end ###
29+ name : notify-push
30+ authToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
3631
3732 - name : Check actor permission
38- uses : skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
33+ uses : skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
3934 with :
4035 require : write
4136
@@ -46,50 +41,69 @@ jobs:
4641 echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
4742
4843 - name : Checkout
49- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
44+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5045 with :
46+ persist-credentials : false
5147 path : ${{ env.APP_NAME }}
48+ fetch-depth : 0
49+
50+ - name : Get app version number
51+ id : app-version
52+ uses : skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
53+ with :
54+ filename : ${{ env.APP_NAME }}/appinfo/info.xml
55+ expression : " //info//version/text()"
56+
57+ - name : Validate app version against tag
58+ run : |
59+ [ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
5260
5361 - name : Get appinfo data
5462 id : appinfo
55- uses : skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
63+ uses : skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
5664 with :
5765 filename : ${{ env.APP_NAME }}/appinfo/info.xml
5866 expression : " //info//dependencies//nextcloud/@min-version"
5967
6068 - name : Read package.json node and npm engines version
61- uses : skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
69+ uses : skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6270 id : versions
6371 # Continue if no package.json
6472 continue-on-error : true
6573 with :
6674 path : ${{ env.APP_NAME }}
67- fallbackNode : " ^16 "
68- fallbackNpm : " ^7 "
75+ fallbackNode : ' ^20 '
76+ fallbackNpm : ' ^10 '
6977
7078 - name : Set up node ${{ steps.versions.outputs.nodeVersion }}
7179 # Skip if no package.json
7280 if : ${{ steps.versions.outputs.nodeVersion }}
73- uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
81+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7482 with :
7583 node-version : ${{ steps.versions.outputs.nodeVersion }}
7684
7785 - name : Set up npm ${{ steps.versions.outputs.npmVersion }}
7886 # Skip if no package.json
7987 if : ${{ steps.versions.outputs.npmVersion }}
80- run : npm i -g npm@" ${{ steps.versions.outputs.npmVersion }}"
88+ run : npm i -g ' npm@${{ steps.versions.outputs.npmVersion }}'
8189
82- - name : Set up php ${{ env.PHP_VERSION }}
83- uses : shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
90+ - name : Get php version
91+ id : php-versions
92+ uses : icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
8493 with :
85- php-version : ${{ env.PHP_VERSION }}
94+ filename : ${{ env.APP_NAME }}/appinfo/info.xml
95+
96+ - name : Set up php ${{ steps.php-versions.outputs.php-min }}
97+ uses : shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
98+ with :
99+ php-version : ${{ steps.php-versions.outputs.php-min }}
86100 coverage : none
87101 env :
88102 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89103
90104 - name : Check composer.json
91105 id : check_composer
92- uses : andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
106+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
93107 with :
94108 files : " ${{ env.APP_NAME }}/composer.json"
95109
@@ -102,14 +116,16 @@ jobs:
102116 - name : Build ${{ env.APP_NAME }}
103117 # Skip if no package.json
104118 if : ${{ steps.versions.outputs.nodeVersion }}
119+ env :
120+ CYPRESS_INSTALL_BINARY : 0
105121 run : |
106122 cd ${{ env.APP_NAME }}
107123 npm ci
108- npm run build
124+ npm run build --if-present
109125
110126 - name : Check Krankerl config
111127 id : krankerl
112- uses : andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
128+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
113129 with :
114130 files : ${{ env.APP_NAME }}/krankerl.toml
115131
@@ -135,14 +151,15 @@ jobs:
135151 continue-on-error : true
136152 id : server-checkout
137153 run : |
138- NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
154+ NCVERSION=' ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
139155 wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
140156 unzip latest-$NCVERSION.zip
141157
142158 - name : Checkout server master fallback
143- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
159+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
144160 if : ${{ steps.server-checkout.outcome != 'success' }}
145161 with :
162+ persist-credentials : false
146163 submodules : true
147164 repository : nextcloud/server
148165 path : nextcloud
@@ -154,7 +171,7 @@ jobs:
154171 tar -xvf ${{ env.APP_NAME }}.tar.gz
155172 cd ../../../
156173 # Setting up keys
157- echo " ${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
174+ echo ' ${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
158175 wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
159176 # Signing
160177 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 }}
@@ -163,7 +180,7 @@ jobs:
163180 tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
164181
165182 - name : Attach tarball to github release
166- uses : svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
183+ uses : svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2
167184 id : attach_to_release
168185 with :
169186 repo_token : ${{ secrets.GITHUB_TOKEN }}
@@ -173,7 +190,7 @@ jobs:
173190 overwrite : true
174191
175192 - name : Upload app to Nextcloud appstore
176- uses : nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
193+ uses : nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1.0.3
177194 with :
178195 app_name : ${{ env.APP_NAME }}
179196 appstore_token : ${{ secrets.APPSTORE_TOKEN }}
0 commit comments