Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"rollForward": false
}
}
}
}
220 changes: 110 additions & 110 deletions .github/workflows/build-docker-task.yml
Original file line number Diff line number Diff line change
@@ -1,110 +1,110 @@
name: Build Docker image task

# Builds the multi-arch image (linux/amd64,arm64) and, on a main publish, pushes it plus the Docker Hub overview.
# Branch drives config and tags: main => Release/`latest`, else Debug/`develop`, plus the `:SemVer2` tag. Smoke builds
# amd64 only and never pushes; registry buildcache is branch-scoped. The orchestrator passes `branch` explicitly
# (the publisher builds one branch per run - the trigger ref - and smoke passes github.ref_name).
on:
workflow_call:
inputs:
# Push the built image and the Docker Hub overview.
push:
required: false
type: boolean
default: false
# Git ref to check out / version (empty = default checkout ref).
ref:
required: false
type: string
default: ''
# Logical branch: main => Release/`latest`, else Debug/`develop`. Required (see header).
branch:
required: true
type: string
# Smoke: build linux/amd64 only, never push, skip the shared cache-to. Fast PR feedback.
smoke:
required: false
type: boolean
default: false
# Version from the orchestrator's single NBGV run (threaded). This task does not
# re-run NBGV on the detached commit, which could classify the branch differently.
semver2:
required: true
type: string
assembly_version:
required: true
type: string
assembly_file_version:
required: true
type: string
assembly_informational_version:
required: true
type: string

jobs:

build-docker:
name: Build Docker image job
runs-on: ubuntu-latest

steps:

- name: Checkout step
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ inputs.ref }}

# QEMU only emulates arm64; smoke is amd64-only, so skip it to save setup cost.
- name: Setup QEMU step
if: ${{ !inputs.smoke }}
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
platforms: linux/amd64,linux/arm64

- name: Setup Buildx step
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
with:
platforms: ${{ inputs.smoke && 'linux/amd64' || 'linux/amd64,linux/arm64' }}

# Always login (even on smoke) for higher pull/cache-read rate limits; the credentials are in both the
# Actions and Dependabot secret stores so a Dependabot push CI run can log in too. Forks cannot push here.
- name: Login to Docker Hub step
uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Docker build and push step
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
push: ${{ inputs.push }}
file: ./Docker/Dockerfile
tags: |
docker.io/ptr727/plexcleaner:${{ inputs.branch == 'main' && 'latest' || 'develop' }}
docker.io/ptr727/plexcleaner:${{ inputs.semver2 }}
platforms: ${{ inputs.smoke && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
# Read both branches' caches (near-identical layers), write only this branch's tag and only when pushing.
# mode=max caches the builder publish; ignore-error keeps a cache hiccup from failing a publish.
cache-from: |
type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-main
type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-develop
cache-to: ${{ inputs.push && format('type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-{0},mode=max,ignore-error=true', inputs.branch) || '' }}
build-args: |
LABEL_VERSION=${{ inputs.semver2 }}
BUILD_CONFIGURATION=${{ inputs.branch == 'main' && 'Release' || 'Debug' }}
BUILD_VERSION=${{ inputs.assembly_version }}
BUILD_FILE_VERSION=${{ inputs.assembly_file_version }}
BUILD_ASSEMBLY_VERSION=${{ inputs.assembly_version }}
BUILD_INFORMATION_VERSION=${{ inputs.assembly_informational_version }}
BUILD_PACKAGE_VERSION=${{ inputs.semver2 }}

# Push the trimmed Docker Hub overview from Docker/README.md, main only (one overview, no per-branch context).
- name: Update Docker Hub description step
if: ${{ inputs.push && inputs.branch == 'main' }}
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
repository: ptr727/plexcleaner
readme-filepath: ./Docker/README.md
name: Build Docker image task
# Builds the multi-arch image (linux/amd64,arm64) and, on a main publish, pushes it plus the Docker Hub overview.
# Branch drives config and tags: main => Release/`latest`, else Debug/`develop`, plus the `:SemVer2` tag. Smoke builds
# amd64 only and never pushes; registry buildcache is branch-scoped. The orchestrator passes `branch` explicitly
# (the publisher builds one branch per run - the trigger ref - and smoke passes github.ref_name).
on:
workflow_call:
inputs:
# Push the built image and the Docker Hub overview.
push:
required: false
type: boolean
default: false
# Git ref to check out / version (empty = default checkout ref).
ref:
required: false
type: string
default: ''
# Logical branch: main => Release/`latest`, else Debug/`develop`. Required (see header).
branch:
required: true
type: string
# Smoke: build linux/amd64 only, never push, skip the shared cache-to. Fast PR feedback.
smoke:
required: false
type: boolean
default: false
# Version from the orchestrator's single NBGV run (threaded). This task does not
# re-run NBGV on the detached commit, which could classify the branch differently.
semver2:
required: true
type: string
assembly_version:
required: true
type: string
assembly_file_version:
required: true
type: string
assembly_informational_version:
required: true
type: string
jobs:
build-docker:
name: Build Docker image job
runs-on: ubuntu-latest
steps:
- name: Checkout step
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ inputs.ref }}
# QEMU only emulates arm64; smoke is amd64-only, so skip it to save setup cost.
- name: Setup QEMU step
if: ${{ !inputs.smoke }}
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
platforms: linux/amd64,linux/arm64
- name: Setup Buildx step
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
with:
platforms: ${{ inputs.smoke && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
# Always login (even on smoke) for higher pull/cache-read rate limits; the credentials are in both the
# Actions and Dependabot secret stores so a Dependabot push CI run can log in too. Forks cannot push here.
- name: Login to Docker Hub step
uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker build and push step
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
push: ${{ inputs.push }}
file: ./Docker/Dockerfile
tags: |
docker.io/ptr727/plexcleaner:${{ inputs.branch == 'main' && 'latest' || 'develop' }}
docker.io/ptr727/plexcleaner:${{ inputs.semver2 }}
platforms: ${{ inputs.smoke && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
# Read both branches' caches (near-identical layers), write only this branch's tag and only when pushing.
# mode=max caches the builder publish; ignore-error keeps a cache hiccup from failing a publish.
cache-from: |
type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-main
type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-develop
cache-to: ${{ inputs.push && format('type=registry,ref=docker.io/ptr727/plexcleaner:buildcache-{0},mode=max,ignore-error=true', inputs.branch) || '' }}
build-args: |
LABEL_VERSION=${{ inputs.semver2 }}
BUILD_CONFIGURATION=${{ inputs.branch == 'main' && 'Release' || 'Debug' }}
BUILD_VERSION=${{ inputs.assembly_version }}
BUILD_FILE_VERSION=${{ inputs.assembly_file_version }}
BUILD_ASSEMBLY_VERSION=${{ inputs.assembly_version }}
BUILD_INFORMATION_VERSION=${{ inputs.assembly_informational_version }}
BUILD_PACKAGE_VERSION=${{ inputs.semver2 }}
# Push the trimmed Docker Hub overview from Docker/README.md, main only (one overview, no per-branch context).
- name: Update Docker Hub description step
if: ${{ inputs.push && inputs.branch == 'main' }}
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
repository: ptr727/plexcleaner
readme-filepath: ./Docker/README.md
Loading