mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix(ci): publish stable image tags directly (#6436)
This commit is contained in:
@@ -119,7 +119,7 @@ jobs:
|
|||||||
${{ secrets.DOCKER_USERNAME }}/moviepilot-v3
|
${{ secrets.DOCKER_USERNAME }}/moviepilot-v3
|
||||||
ghcr.io/${{ github.repository }}-v3
|
ghcr.io/${{ github.repository }}-v3
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=beta-${{ github.run_id }}-${{ github.run_attempt }}
|
type=raw,value=beta
|
||||||
|
|
||||||
- name: Docker Meta free-threaded
|
- name: Docker Meta free-threaded
|
||||||
id: meta_ft
|
id: meta_ft
|
||||||
@@ -129,7 +129,7 @@ jobs:
|
|||||||
${{ secrets.DOCKER_USERNAME }}/moviepilot-v3t
|
${{ secrets.DOCKER_USERNAME }}/moviepilot-v3t
|
||||||
ghcr.io/${{ github.repository }}-v3t
|
ghcr.io/${{ github.repository }}-v3t
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=beta-${{ github.run_id }}-${{ github.run_attempt }}
|
type=raw,value=beta
|
||||||
|
|
||||||
- name: Set Up QEMU
|
- name: Set Up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -338,18 +338,3 @@ jobs:
|
|||||||
cache-from: |
|
cache-from: |
|
||||||
type=gha,scope=moviepilot-v3t-docker-amd64,version=2
|
type=gha,scope=moviepilot-v3t-docker-amd64,version=2
|
||||||
type=gha,scope=moviepilot-v3t-docker-arm64,version=2
|
type=gha,scope=moviepilot-v3t-docker-arm64,version=2
|
||||||
|
|
||||||
- name: Promote beta image pair
|
|
||||||
env:
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
run: |
|
|
||||||
candidate="beta-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
|
||||||
for image in \
|
|
||||||
"${DOCKER_USERNAME}/moviepilot-v3" \
|
|
||||||
"ghcr.io/${GITHUB_REPOSITORY}-v3" \
|
|
||||||
"${DOCKER_USERNAME}/moviepilot-v3t" \
|
|
||||||
"ghcr.io/${GITHUB_REPOSITORY}-v3t"; do
|
|
||||||
docker buildx imagetools create \
|
|
||||||
--tag "${image}:beta" \
|
|
||||||
"${image}:${candidate}"
|
|
||||||
done
|
|
||||||
|
|||||||
@@ -367,16 +367,17 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
run: |
|
run: |
|
||||||
|
ghcr_repository="${GITHUB_REPOSITORY,,}"
|
||||||
for image in \
|
for image in \
|
||||||
"${DOCKER_USERNAME}/moviepilot-v3" \
|
"${DOCKER_USERNAME}/moviepilot-v3" \
|
||||||
"ghcr.io/${GITHUB_REPOSITORY}-v3"; do
|
"ghcr.io/${ghcr_repository}-v3"; do
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
--tag "${image}:latest" \
|
--tag "${image}:latest" \
|
||||||
"${image}:${app_version}"
|
"${image}:${app_version}"
|
||||||
done
|
done
|
||||||
for image in \
|
for image in \
|
||||||
"${DOCKER_USERNAME}/moviepilot-v3t" \
|
"${DOCKER_USERNAME}/moviepilot-v3t" \
|
||||||
"ghcr.io/${GITHUB_REPOSITORY}-v3t"; do
|
"ghcr.io/${ghcr_repository}-v3t"; do
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
--tag "${image}:latest" \
|
--tag "${image}:latest" \
|
||||||
"${image}:${app_version}"
|
"${image}:${app_version}"
|
||||||
|
|||||||
@@ -223,6 +223,10 @@ def test_release_promotes_latest_only_after_both_versioned_images() -> None:
|
|||||||
)
|
)
|
||||||
promote = indexed["Promote latest image pair"]["run"]
|
promote = indexed["Promote latest image pair"]["run"]
|
||||||
assert "moviepilot-v3:latest" not in promote
|
assert "moviepilot-v3:latest" not in promote
|
||||||
|
assert 'ghcr_repository="${GITHUB_REPOSITORY,,}"' in promote
|
||||||
|
assert "ghcr.io/${GITHUB_REPOSITORY}" not in promote
|
||||||
|
assert "ghcr.io/${ghcr_repository}-v3" in promote
|
||||||
|
assert "ghcr.io/${ghcr_repository}-v3t" in promote
|
||||||
assert '"${image}:latest"' in promote
|
assert '"${image}:latest"' in promote
|
||||||
assert '"${image}:${app_version}"' in promote
|
assert '"${image}:${app_version}"' in promote
|
||||||
|
|
||||||
@@ -263,11 +267,8 @@ def test_beta_applies_the_same_variant_scan_and_publish_contract() -> None:
|
|||||||
assert "MOVIEPILOT_PYTHON_VARIANT=free-threaded" in indexed[publish_names[1]]["with"]["build-args"]
|
assert "MOVIEPILOT_PYTHON_VARIANT=free-threaded" in indexed[publish_names[1]]["with"]["build-args"]
|
||||||
assert "scope=moviepilot-v3-standard-docker-amd64" in indexed[publish_names[0]]["with"]["cache-from"]
|
assert "scope=moviepilot-v3-standard-docker-amd64" in indexed[publish_names[0]]["with"]["cache-from"]
|
||||||
assert "scope=moviepilot-v3t-docker-amd64" in indexed[publish_names[1]]["with"]["cache-from"]
|
assert "scope=moviepilot-v3t-docker-amd64" in indexed[publish_names[1]]["with"]["cache-from"]
|
||||||
assert "value=beta-${{ github.run_id }}-${{ github.run_attempt }}" in indexed["Docker Meta"]["with"]["tags"]
|
assert "value=beta" in indexed["Docker Meta"]["with"]["tags"]
|
||||||
assert "value=beta-${{ github.run_id }}-${{ github.run_attempt }}" in indexed[
|
assert "value=beta" in indexed["Docker Meta free-threaded"]["with"]["tags"]
|
||||||
"Docker Meta free-threaded"
|
assert "github.run_id" not in indexed["Docker Meta"]["with"]["tags"]
|
||||||
]["with"]["tags"]
|
assert "github.run_id" not in indexed["Docker Meta free-threaded"]["with"]["tags"]
|
||||||
assert all(names.index(name) < names.index("Promote beta image pair") for name in publish_names)
|
assert "Promote beta image pair" not in names
|
||||||
promote = indexed["Promote beta image pair"]["run"]
|
|
||||||
assert '"${image}:beta"' in promote
|
|
||||||
assert '"${image}:${candidate}"' in promote
|
|
||||||
|
|||||||
Reference in New Issue
Block a user