snappymail/.github/workflows/docker-pr.yml
google-labs-jules[bot] d22f8d521d Nextcloud 32/33 Compatibility: Remove deprecated API usage
This commit updates the SnappyMail integration app for Nextcloud to support version 32 and the upcoming version 33.

Key changes:
- Updated `info.xml` to allow `max-version="33"`.
- Refactored `AdminSettings`, `Application`, `FetchController`, `PageController`, `Settings` (command), and `InstallStep` to use Dependency Injection instead of the deprecated `\OC::$server` service container.
- Replaced deprecated `OC_User`, `OC_Util` (e.g. `addScript`), and `OC_App` calls with their `OCP` (public API) counterparts or modern equivalents.
- Updated `SnappyMailHelper` to use `\OCP\Server::get()` for static context access where DI is not possible.
- Moved script and style registration from Controllers (using deprecated `Util::addScript`) to templates using `script()` and `style()` helpers.
- Updated `Settings` console command to extend `Symfony\Component\Console\Command\Command` instead of deprecated `OC\Core\Command\Base`.
- Addressed PHP 8.4+ compatibility by adding explicit property types and nullable types where necessary in the integration code.

Co-authored-by: nextgen-networks <21206978+nextgen-networks@users.noreply.github.com>
2026-02-03 16:04:29 +00:00

93 lines
2.7 KiB
YAML

name: docker-pr
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# This step generates the docker tags
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
env:
# This env var ensures {{sha}} is a real commit SHA for type=ref,event=pr
DOCKER_METADATA_PR_HEAD_SHA: 'true'
with:
images: |
djmaze/snappymail
ghcr.io/${{ github.repository }}
# type=ref,event=pr generates tag(s) on PRs only. E.g. 'pr-123', 'pr-123-abc0123'
tags: |
type=ref,event=pr
type=ref,suffix=-{{sha}},event=pr
# The rest of the org.opencontainers.image.xxx labels are dynamically generated
labels: |
org.opencontainers.image.description=SnappyMail
org.opencontainers.image.licenses=AGPLv3
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# See: https://github.com/docker/buildx/issues/59
- name: Build
id: build
uses: docker/build-push-action@v3
with:
context: '.'
file: ./.docker/release/Dockerfile
platforms: linux/amd64
push: false
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Docker images
run: |
docker images
- name: Test
run: |
TAG=$( echo "${{ steps.meta.outputs.tags }}" | head -n1 )
.docker/release/test/test.sh "$TAG"
- name: Build all archs
uses: docker/build-push-action@v3
with:
context: '.'
file: ./.docker/release/Dockerfile
platforms: linux/386,linux/amd64,linux/arm64
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache