chore: update workflows from templates

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ
2023-05-27 09:45:38 +02:00
parent 8d395186fd
commit 050df0577e
10 changed files with 70 additions and 51 deletions

View File

@@ -32,7 +32,7 @@ jobs:
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
path: ${{ env.APP_NAME }} path: ${{ env.APP_NAME }}
@@ -44,7 +44,7 @@ jobs:
expression: "//info//dependencies//nextcloud/@min-version" expression: "//info//dependencies//nextcloud/@min-version"
- name: Read package.json node and npm engines 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@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
id: versions id: versions
# Continue if no package.json # Continue if no package.json
continue-on-error: true continue-on-error: true
@@ -66,7 +66,7 @@ jobs:
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Set up php ${{ env.PHP_VERSION }} - name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@2.25.2 # v2 uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with: with:
php-version: ${{ env.PHP_VERSION }} php-version: ${{ env.PHP_VERSION }}
coverage: none coverage: none
@@ -126,9 +126,10 @@ jobs:
unzip latest-$NCVERSION.zip unzip latest-$NCVERSION.zip
- name: Checkout server master fallback - name: Checkout server master fallback
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
if: ${{ steps.server-checkout.outcome != 'success' }} if: ${{ steps.server-checkout.outcome != 'success' }}
with: with:
submodules: true
repository: nextcloud/server repository: nextcloud/server
path: nextcloud path: nextcloud
@@ -148,7 +149,7 @@ jobs:
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
- name: Attach tarball to github release - name: Attach tarball to github release
uses: svenstaro/upload-release-action@58d525808845e4c8ff229ea1d5d7c496504a79bc # v2 uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 # v2
id: attach_to_release id: attach_to_release
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -31,13 +31,13 @@ jobs:
reaction-type: "+1" reaction-type: "+1"
- name: Checkout the latest code - name: Checkout the latest code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
fetch-depth: 0 fetch-depth: 0
token: ${{ secrets.COMMAND_BOT_PAT }} token: ${{ secrets.COMMAND_BOT_PAT }}
- name: Automatic Rebase - name: Automatic Rebase
uses: cirrus-actions/rebase@6e572f08c244e2f04f9beb85a943eb618218714d # 1.7 uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
env: env:
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}

View File

@@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github # https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Pull request checks name: Block fixup and squash commits
on: on:
pull_request: pull_request:

View File

@@ -6,7 +6,7 @@
# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions # Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks # https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
name: Lint name: Lint eslint
on: on:
pull_request: pull_request:
@@ -38,10 +38,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Read package.json node and npm engines 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@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
id: versions id: versions
with: with:
fallbackNode: '^16' fallbackNode: '^16'

View File

@@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github # https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Lint name: Lint php-cs
on: pull_request on: pull_request
@@ -22,13 +22,14 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up php - name: Set up php
uses: shivammathur/setup-php@2.25.2 # v2 uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with: with:
php-version: 8.1 php-version: 8.1
coverage: none coverage: none
ini-file: development
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github # https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Lint name: Lint php
on: on:
pull_request: pull_request:
@@ -31,13 +31,14 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up php ${{ matrix.php-versions }} - name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@2.25.2 # v2 uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
coverage: none coverage: none
ini-file: development
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github # https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Lint name: Lint stylelint
on: pull_request on: pull_request
@@ -22,10 +22,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Read package.json node and npm engines 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@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
id: versions id: versions
with: with:
fallbackNode: '^16' fallbackNode: '^16'

View File

@@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github # https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: npm audit fix and compile name: Npm audit fix and compile
on: on:
workflow_dispatch: workflow_dispatch:
@@ -18,18 +18,18 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
branches: ["main", "master", "stable26", "stable25", "stable24"] branches: ["main", "master", "stable27", "stable26", "stable25", "stable24"]
name: npm-audit-fix-${{ matrix.branches }} name: npm-audit-fix-${{ matrix.branches }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
ref: ${{ matrix.branches }} ref: ${{ matrix.branches }}
- name: Read package.json node and npm engines 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@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
id: versions id: versions
with: with:
fallbackNode: '^16' fallbackNode: '^16'
@@ -55,7 +55,7 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
if: always() if: always()
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3 uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5
with: with:
token: ${{ secrets.COMMAND_BOT_PAT }} token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: "chore(deps): fix npm audit" commit-message: "chore(deps): fix npm audit"

View File

@@ -24,13 +24,14 @@ jobs:
name: Nextcloud name: Nextcloud
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up php - name: Set up php
uses: shivammathur/setup-php@2.25.2 # v2 uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with: with:
php-version: 8.1 php-version: 8.1
coverage: none coverage: none
ini-file: development
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -17,21 +17,22 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
branches: ["master", "stable27", "stable26", "stable25", "stable24"] branches: ["main", "master", "stable27", "stable26", "stable25"]
name: update-nextcloud-ocp-${{ matrix.branches }} name: update-nextcloud-ocp-${{ matrix.branches }}
steps: steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
ref: ${{ matrix.branches }} ref: ${{ matrix.branches }}
submodules: true submodules: true
- name: Set up php8.1 - name: Set up php8.1
uses: shivammathur/setup-php@2.25.2 # v2 uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with: with:
php-version: 8.1 php-version: 8.1
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none coverage: none
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -40,19 +41,33 @@ jobs:
run: composer install run: composer install
- name: Composer update nextcloud/ocp - name: Composer update nextcloud/ocp
if: matrix.branches != 'main'
run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }} run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }}
continue-on-error: true
- name: Reset checkout dirs - name: Composer update nextcloud/ocp
if: matrix.branches == 'main'
run: composer require --dev nextcloud/ocp:dev-master
- name: Reset checkout 3rdparty
run: | run: |
git clean -f 3rdparty git clean -f 3rdparty
git checkout 3rdparty
continue-on-error: true
- name: Reset checkout vendor
run: |
git clean -f vendor git clean -f vendor
git checkout vendor
continue-on-error: true
- name: Reset checkout vendor-bin
run: |
git clean -f vendor-bin git clean -f vendor-bin
git checkout 3rdparty vendor vendor-bin git checkout vendor-bin
continue-on-error: true continue-on-error: true
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3 uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3
with: with:
token: ${{ secrets.COMMAND_BOT_PAT }} token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: "chore(dev-deps): Bump nextcloud/ocp package" commit-message: "chore(dev-deps): Bump nextcloud/ocp package"