Skip to content

27.0.2, 26.0.5 and 25.0.10 Finals #695

27.0.2, 26.0.5 and 25.0.10 Finals

27.0.2, 26.0.5 and 25.0.10 Finals #695

Workflow file for this run

name: Upgrades
on:
pull_request:
push:
branches:
- master
jobs:
changes:
runs-on: ubuntu-latest
outputs:
config: ${{ steps.changes.outputs.config }}
steps:
- uses: actions/checkout@v2
# If the config has not changed, we skip
# It allows us to still have a summary result
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
config:
- 'config/config.php'
configs:
if: needs.changes.outputs.config == 'true'
runs-on: ubuntu-latest
needs: changes
outputs:
configs: ${{ steps.build-config.outputs.configs }}
name: Initializing ${{matrix.channel}} configs
steps:
- uses: actions/checkout@v2
- name: Getting config
id: get-config
run: |
# Retrieving non-EOL configs from the matrix channel
CONFIGS=$(php -r "echo(json_encode(include 'config/config.php'));" | jq -c)
echo "::set-output name=configs::$CONFIGS"
- name: Parse configs
uses: nextcloud/updater_server@action
id: build-config
with:
# Edit the following line to install packages required to run your script.
configs: ${{ steps.get-config.outputs.configs }}
upgrades:
runs-on: ubuntu-latest
needs: configs
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.configs.outputs.configs) }}
name: Upgrade from ${{ matrix.config.base }} to ${{ matrix.config.latest }}
steps:
- name: Set up php ${{ matrix.config.minPHPVersion }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.config.minPHPVersion }}
extensions: ctype,curl,dom,fileinfo,gd,iconv,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
- name: Fetch release
run: |
# Check if we have a full version like xx.x.x
if ${{ contains(matrix.config.base, '.') }};
then wget --quiet https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.config.base }}.zip -O nextcloud-base.zip \
|| wget --quiet https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}.zip -O nextcloud-base.zip \
|| (
i=5;
while [ $i -gt -0 ]; do
# try to find RC5 to RC1
wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc$i.zip" -O nextcloud-base.zip && break
i=$(( i - 1 ));
done
);
else wget --quiet https://download.nextcloud.com/server/releases/latest-${{ matrix.config.base }}.zip -O nextcloud-base.zip;
fi
unzip -q nextcloud-base.zip
- name: Setup nextcloud
run: |
cd nextcloud
mkdir data
php occ maintenance:install --verbose --admin-user admin --admin-pass admin
- name: Fetch upgrade
run: |
mv nextcloud nextcloud.old
wget --quiet ${{ matrix.config.downloadUrl }} -O nextcloud-update.zip
unzip -q nextcloud-update.zip
- name: Copy necessary files
run: |
mv nextcloud.old/config/config.php nextcloud/config/config.php
mv nextcloud.old/data nextcloud/data
- name: Perform upgrade
run: |
cd nextcloud
php occ upgrade
- name: Integrity check
run: |
cd nextcloud
php occ integrity:check-core
summary:
runs-on: ubuntu-latest
needs: [changes, upgrades]
if: always()
name: upgrades-summary
steps:
- name: Summary status
run: if ${{ needs.changes.result == 'success' && needs.upgrades.result != 'success' && needs.upgrades.result != 'skipped' }}; then exit 1; fi