summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNextcloud bot <bot@nextcloud.com>2024-04-26 18:09:34 +0000
committerNextcloud bot <bot@nextcloud.com>2024-04-26 18:09:34 +0000
commit2643e7fa037b24403e36de3902636ef6422e027a (patch)
tree384cceb0e8d0491d6ee5cbcf415963c6a19ace28
parent5576151d1f93df29985b44564efd68acef151ab8 (diff)
Updating appstore-build-publish.yml workflow from templatefeat/workflow-auto-update-appstore-build-publish.yml
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
-rw-r--r--.github/workflows/appstore-build-publish.yml42
1 files changed, 25 insertions, 17 deletions
diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml
index eec59474..fcb26d00 100644
--- a/.github/workflows/appstore-build-publish.yml
+++ b/.github/workflows/appstore-build-publish.yml
@@ -2,6 +2,9 @@
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+#
+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
+# SPDX-License-Identifier: MIT
name: Build and publish app release
@@ -9,9 +12,6 @@ on:
release:
types: [published]
-env:
- PHP_VERSION: 8.1
-
jobs:
build_and_publish:
runs-on: ubuntu-latest
@@ -21,7 +21,7 @@ jobs:
steps:
- name: Check actor permission
- uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
+ uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
with:
require: write
@@ -32,7 +32,7 @@ jobs:
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Checkout
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
path: ${{ env.APP_NAME }}
@@ -44,19 +44,19 @@ jobs:
expression: "//info//dependencies//nextcloud/@min-version"
- name: Read package.json node and npm engines version
- uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
# Continue if no package.json
continue-on-error: true
with:
path: ${{ env.APP_NAME }}
- fallbackNode: "^16"
- fallbackNpm: "^7"
+ fallbackNode: '^20'
+ fallbackNpm: '^10'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
+ uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
@@ -65,17 +65,23 @@ jobs:
if: ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- - name: Set up php ${{ env.PHP_VERSION }}
- uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
+ - name: Get php version
+ id: php-versions
+ uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
+ with:
+ filename: ${{ env.APP_NAME }}/appinfo/info.xml
+
+ - name: Set up php ${{ steps.php-versions.outputs.php-min }}
+ uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2
with:
- php-version: ${{ env.PHP_VERSION }}
+ php-version: ${{ steps.php-versions.outputs.php-min }}
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check composer.json
id: check_composer
- uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
+ uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: "${{ env.APP_NAME }}/composer.json"
@@ -88,14 +94,16 @@ jobs:
- name: Build ${{ env.APP_NAME }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
+ env:
+ NODE_ENV: production
run: |
cd ${{ env.APP_NAME }}
npm ci
- npm run build
+ npm run build --if-present
- name: Check Krankerl config
id: krankerl
- uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
+ uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: ${{ env.APP_NAME }}/krankerl.toml
@@ -126,7 +134,7 @@ jobs:
unzip latest-$NCVERSION.zip
- name: Checkout server master fallback
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
if: ${{ steps.server-checkout.outcome != 'success' }}
with:
submodules: true
@@ -149,7 +157,7 @@ jobs:
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
- name: Attach tarball to github release
- uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
+ uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}