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
49 changes: 40 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
include:
- platform: linux/amd64
runner: ubuntu-24.04
- platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -66,6 +68,7 @@ jobs:
name: Build/push the arch-specific image
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
build-args: |
BUILD_TIMESTAMP=${{ github.event.repository.updated_at }}
BUILD_URL=${{ steps.set_build_url.outputs.build_url }}
Expand All @@ -86,14 +89,16 @@ jobs:
echo "image-${RUNNER_ARCH,,}=${{ steps.get-registry.outputs.registry }}@${{ steps.build.outputs.digest }}" | tee -a "$GITHUB_OUTPUT"

merge:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs:
- build
env:
DOCKER_APP_IMAGE_ARM64: ${{ needs.build.outputs.build-image-arm }}
DOCKER_APP_IMAGE_X64: ${{ needs.build.outputs.build-image-x64 }}
outputs:
build-image: ${{ steps.meta.outputs.tags }}
build-image-arm: ${{ needs.build.outputs.build-image-arm }}
build-image-x64: ${{ needs.build.outputs.build-image-x64 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -123,7 +128,7 @@ jobs:
"$DOCKER_APP_IMAGE_ARM64" "$DOCKER_APP_IMAGE_X64"

test:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs:
- merge
env:
Expand All @@ -143,6 +148,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set ARTIFACTS_DIR
run: echo "ARTIFACTS_DIR=${RUNNER_TEMP}/artifacts" >> $GITHUB_ENV

- name: Create the artifacts directory
run: mkdir -p "$ARTIFACTS_DIR"

- name: Run the test script
env:
LIT_TIND_API_KEY: ${{ secrets.LIT_TIND_API_KEY }}
Expand All @@ -151,17 +162,38 @@ jobs:
docker compose up --detach --wait
docker compose exec app bin/test

- name: Copy out artifacts
if: ${{ always() }}
run: |
docker compose cp app:/opt/app/artifacts "${ARTIFACTS_DIR}/"
docker compose logs | tee "${ARTIFACTS_DIR}/docker-services.log"
docker compose config | tee "${ARTIFACTS_DIR}/docker-compose.merged.yml"
docker events --json --since $TEST_START --until `date +%s` | tee "${ARTIFACTS_DIR}/docker-events.json"

- name: Upload test report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: avplayer Test Report (${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }})
path: ${{ env.ARTIFACTS_DIR }}
if-no-files-found: error

push:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs:
- merge
- test
env:
DOCKER_APP_IMAGE: ${{ needs.merge.outputs.build-image }}
DOCKER_APP_IMAGE_ARM64: ${{ needs.merge.outputs.build-image-arm }}
DOCKER_APP_IMAGE_X64: ${{ needs.merge.outputs.build-image-x64 }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -181,6 +213,5 @@ jobs:

- name: Retag and push the image
run: |
docker pull "$DOCKER_APP_IMAGE"
echo "$DOCKER_METADATA_OUTPUT_TAGS" | tr ' ' '\n' | xargs -n1 docker tag "$DOCKER_APP_IMAGE"
docker push --all-tags "$(echo "$DOCKER_APP_IMAGE" | cut -f1 -d:)"
docker buildx imagetools create \
$(jq -cr '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") $DOCKER_APP_IMAGE_ARM64 $DOCKER_APP_IMAGE_X64
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -41,7 +38,7 @@ jobs:
env:
BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }}
run: |
docker pull "$BASE_IMAGE"
docker manifest inspect "$BASE_IMAGE"

- name: Produce release tags
id: tag-meta
Expand All @@ -59,5 +56,6 @@ jobs:
env:
BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }}
run: |
echo "$DOCKER_METADATA_OUTPUT_TAGS" | tr ' ' '\n' | xargs -n1 docker tag "$BASE_IMAGE"
docker push --all-tags "$(echo "$BASE_IMAGE" | cut -f1 -d:)"
docker buildx imagetools create \
$(jq -cr '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
"$(echo "$BASE_IMAGE" | cut -f1 -d:)"