[prod] 30.0.3rc2 #1243
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upgrades | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
concurrency: | |
group: upgrades-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
config: ${{ steps.changes.outputs.config }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
# If the config has not changed, we skip | |
# It allows us to still have a summary result | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- 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 }} (${{ matrix.config.channel }}) | |
steps: | |
- name: Set up php ${{ matrix.config.minPHPVersion }} | |
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 | |
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 \ | |
|| wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc1.zip" -O nextcloud-base.zip \ | |
|| wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc2.zip" -O nextcloud-base.zip \ | |
|| wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc3.zip" -O nextcloud-base.zip \ | |
|| wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc4.zip" -O nextcloud-base.zip \ | |
|| wget --quiet "https://download.nextcloud.com/server/prereleases/nextcloud-${{ matrix.config.base }}rc5.zip" -O nextcloud-base.zip \ | |
|| wget --quiet https://download.nextcloud.com/server/releases/latest-${{ matrix.config.major }}.zip -O nextcloud-base.zip; | |
else wget --quiet https://download.nextcloud.com/server/releases/latest-${{ matrix.config.major }}.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 -v | |
- 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 |