Skip to content

Commit 7526cbb

Browse files
authored
Major Enhancements.
● Fixed. - Pipeline From Rebuilding On Every Push. - Mermaid Graph In ReadMe. - Temporary Disabled Docker Cache. - Typo In Some Contexts. ● Added. - Dependabot Configuration For Weekly Updates. - Dependabot Configuration For Docker. - Force Rebuild For Security Reasons. - Updated Docker Image To Forky-Slim. - Updated Actions/Checkout To v7. - Updated Runner To Ubuntu v26.04 - Updated The Cleanup Logic For Force Build. - Updated Build Schedule At 11:50 PM UTC On Tuesdays, Thursdays & Saturdays. - Defensive Check Inside GitHub Release To Prevent Race Condition Issues. ★ Signed-Off-By: Oliver ★ ★ Co-Authored-By: Subhasish, James, Mark, Steffen ★
1 parent 730ffd6 commit 7526cbb

5 files changed

Lines changed: 72 additions & 45 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@ updates:
33
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "monthly"
6+
interval: "weekly"
7+
groups:
8+
everything:
9+
patterns: ["*"]
10+
11+
- package-ecosystem: "docker"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
groups:
16+
everything:
17+
patterns: ["*"]

.github/workflows/mediainfo-builder.yml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Build MediaInfo
33
on:
44
push:
55
schedule:
6-
# Runs at 00:00 UTC on Tuesdays, Thursdays, and Saturdays
7-
- cron: '0 0 * * 2,4,6'
6+
# Runs Every Week At 11:50 PM UTC On Tuesdays, Thursdays & Saturdays.
7+
- cron: '50 23 * * 2,4,6'
88
workflow_dispatch:
99

1010
permissions:
@@ -13,14 +13,14 @@ permissions:
1313
jobs:
1414
check-version:
1515
name: Safety Measure & Version Check
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-26.04
1717
timeout-minutes: 140
1818
outputs:
1919
build_needed: ${{ steps.check.outputs.build_needed }}
2020
version: ${{ steps.check.outputs.version }}
2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@v7
2424

2525
- name: Check Upstream Version vs Latest Release
2626
id: check
@@ -39,35 +39,36 @@ jobs:
3939
echo "💡 Current repository latest release: $LATEST_RELEASE"
4040
4141
if [ "v$MI_URL" == "$LATEST_RELEASE" ]; then
42-
echo "✅ Version v$MI_URL is already built. Exiting workflow early with success."
43-
echo "build_needed=false" >> $GITHUB_OUTPUT
42+
echo "✅ Version v$MI_URL is already built. Forcing rebuild for security updates. 💚"
43+
echo "build_needed=true" >> $GITHUB_OUTPUT
44+
echo "version=$MI_URL" >> $GITHUB_OUTPUT
4445
else
4546
echo "🚀 New version detected! Proceeding to build v$MI_URL."
4647
echo "build_needed=true" >> $GITHUB_OUTPUT
4748
echo "version=$MI_URL" >> $GITHUB_OUTPUT
4849
fi
4950
5051
build-binaries:
51-
# Uses the visual_arch for human readability (x64 and ARM64)
52+
# Uses the visual_arch (x64 and ARM64)
5253
name: Compile Binaries (${{ matrix.visual_arch }})
5354
needs: check-version
54-
if: needs.check-version.outputs.build_needed == 'true'
55+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.check-version.outputs.build_needed == 'true'
5556
runs-on: ${{ matrix.runner }}
5657
timeout-minutes: 240 # 4-hour safety net for heavy compilation
5758
strategy:
5859
matrix:
5960
include:
6061
- arch: amd64
6162
visual_arch: x64
62-
runner: ubuntu-latest
63+
runner: ubuntu-26.04
6364
ext_name: linux64
6465
- arch: arm64
6566
visual_arch: ARM64
66-
runner: ubuntu-24.04-arm
67+
runner: ubuntu-26.04-arm
6768
ext_name: linuxarm64
6869
steps:
6970
- name: Checkout code
70-
uses: actions/checkout@v6
71+
uses: actions/checkout@v7
7172

7273
- name: Set up Docker Buildx
7374
uses: docker/setup-buildx-action@v4
@@ -77,12 +78,13 @@ jobs:
7778
set -euo pipefail
7879
mkdir -p ./output ./artifacts
7980
81+
# 🔜 Disabled Docker Cache, Re-Enable Later If Needed.
82+
# --cache-to type=gha,mode=max,scope=mediainfo-${{ matrix.arch }} \
83+
# --cache-from type=gha,scope=mediainfo-${{ matrix.arch }} \
8084
docker buildx build \
8185
--platform linux/${{ matrix.arch }} \
8286
--build-arg MI_VERSION=${{ needs.check-version.outputs.version }} \
8387
--output type=local,dest=./output \
84-
--cache-to type=gha,mode=max,scope=mediainfo-${{ matrix.arch }} \
85-
--cache-from type=gha,scope=mediainfo-${{ matrix.arch }} \
8688
-f Dockerfile .
8789
8890
# Navigate to output, make executable, and compress into a real tar.xz archive
@@ -102,12 +104,12 @@ jobs:
102104
release-and-cleanup:
103105
name: Publish Release & Purge Old
104106
needs: [check-version, build-binaries]
105-
if: needs.check-version.outputs.build_needed == 'true'
106-
runs-on: ubuntu-latest
107+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.check-version.outputs.build_needed == 'true'
108+
runs-on: ubuntu-26.04
107109
timeout-minutes: 72 # Safety net for GitHub API uploads
108110
steps:
109111
- name: Checkout code
110-
uses: actions/checkout@v6
112+
uses: actions/checkout@v7
111113
with:
112114
fetch-depth: 2 # Required to fetch the previous commit hash
113115

@@ -147,13 +149,19 @@ jobs:
147149
set -euo pipefail
148150
149151
TAG_NAME="v$VERSION"
152+
# Defensive check: Ensure release doesn't already exist to prevent race conditions
153+
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
154+
echo "♻️ Release $TAG_NAME already exists. Deleting to recreate a fresh build... ☣️"
155+
gh release delete "$TAG_NAME" --cleanup-tag -y
156+
sleep 5
157+
fi
150158
151159
# Generate dynamic text variables
152160
DATE_STR=$(date -u +'%d/%m/%Y At %H:%M')
153161
COMMIT_MSG=$(git log -1 --pretty=%B | head -n 1)
154162
PREV_HASH=$(git log -2 --pretty=%H | tail -n 1)
155163
156-
# Create the exact release body you requested
164+
# Create The Release Body.
157165
cat <<EOF > release_notes.txt
158166
This Latest Stable Automated Build Of MediaInfo Created On $DATE_STR
159167
$COMMIT_MSG
@@ -188,12 +196,12 @@ jobs:
188196
189197
keepalive:
190198
name: Repository Keepalive
191-
runs-on: ubuntu-latest
199+
runs-on: ubuntu-26.04
192200
if: github.event_name == 'schedule'
193201
timeout-minutes: 61 # Safety net for git push
194202
steps:
195203
- name: Checkout code
196-
uses: actions/checkout@v6
204+
uses: actions/checkout@v7
197205
with:
198206
fetch-depth: 0
199207

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM debian:trixie-slim AS builder
1+
FROM debian:forky-slim AS builder
22

3-
# Enforce strict error handling. Instantly aborts on any hidden failure.
3+
# Enforce Strict Error Handling. Instantly Aborts On Any Hidden Failure.
44
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
55

6-
# Set non-interactive frontend for apt to prevent hanging prompts
6+
# Set Non-Interactive Frontend For Apt To Prevent Hanging Prompts.
77
ENV DEBIAN_FRONTEND=noninteractive
8-
# Accept MediaInfo version as a dynamic build argument
8+
# Accept MediaInfo Version As A Dynamic Build Argument.
99
ARG MI_VERSION
10-
# Install prerequisites required for MediaInfo compilation
11-
# Intentionally omit extra libraries to ensure the binary remains highly portable.
10+
# Intentionally Omit Extra Libraries To Ensure The Binary Remains Highly Portable.
11+
# 1. Install Prerequisites Required For MediaInfo Compilation.
1212
RUN apt-get update && apt-get install -y --no-install-recommends \
1313
build-essential \
1414
curl \
@@ -22,19 +22,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222
zlib1g-dev \
2323
&& rm -rf /var/lib/apt/lists/*
2424

25-
# Download and extract MediaInfo source safely with CI-friendly wget progress
25+
# 2. Download & Extract Mediainfo Source Safely With CI-Friendly wget Progress.
2626
RUN wget --progress=dot:giga "https://mediaarea.net/download/binary/mediainfo/${MI_VERSION}/MediaInfo_CLI_${MI_VERSION}_GNU_FromSource.tar.xz" -O mediainfo_src.tar.xz && \
2727
tar -xf mediainfo_src.tar.xz
2828

2929
WORKDIR /MediaInfo_CLI_GNU_FromSource
3030

31-
# Compile with multi-core support to cut build time in half
31+
# 3. Compile With Multi-Core Support To Cut Build Time In Half.
3232
RUN export MAKEFLAGS="-j$(nproc)" && \
3333
./CLI_Compile.sh
3434

35-
# Strip debugging symbols. --strip-all is the correct standard for final executables.
35+
# 4. Strip Debugging Symbols From The Actual Binaries To Shrink The Final Size.
3636
RUN strip --strip-all MediaInfo/Project/GNU/CLI/mediainfo
3737

38-
# Use a scratch image to export ONLY the compiled binary back to the host
38+
# 5. Use A Scratch Image To Export ONLY The Portable Directory Structure Back To The Host.
3939
FROM scratch AS export-stage
4040
COPY --from=builder /MediaInfo_CLI_GNU_FromSource/MediaInfo/Project/GNU/CLI/mediainfo /

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright Copyright (c) 2026 Oliver <oliver@nanoskin.vn>
3+
Copyright (c) 2026 Oliver <oliver@nanoskin.vn>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ An optimized, cloud-native automation pipeline that monitors upstream releases o
1111

1212
* **Native Multi-Architecture Compilation**: Avoids slow QEMU emulation overhead by utilizing GitHub’s native AMD64 and ARM64 runners.
1313
* **Minimalistic & Highly Portable**: Compiled exclusively against critical system dependencies (`zlib1g-dev`) to maximize static binary portability across various Linux environments.
14-
* **Robust Docker Remote Caching**: Implements `--cache-to/from type=gha` layers to guarantee subsequent code builds complete within minutes.
14+
<!-- ❌ Delete This Block Later, When Re-Enable Caching. ❌
15+
* **Robust Docker Remote Caching**: Implements `--cache-to/from type=gha` layers to guarantee subsequent code builds complete within minutes. -->
1516
* **Automatic Security Checksums**: Every build dynamically computes and attaches an authoritative `SHA256SUMS` verification manifest to the GitHub Release.
1617
* **Autonomous Pipeline Maintenance**: Integrated self-cleaning logic stores only the latest 4 production releases while automated keepalive protocols prevent GitHub Actions from sleeping.
1718

@@ -20,8 +21,8 @@ An optimized, cloud-native automation pipeline that monitors upstream releases o
2021
## ⚙️ Automated Pipeline Policies
2122

2223
### 🕒 Build Schedule
23-
* **Execution Interval**: Builds trigger automatically at **00:00 UTC on Tuesdays, Thursdays, and Saturdays**, as well as on manual execution via `workflow_dispatch`.
24-
* **Smart Verification**: The compiler checks upstream releases first. A compilation run triggers **only** if a brand-new upstream version of MediaInfo is detected. If no updates exist, the workflow safely exits early to save system resources.
24+
* **Execution Interval**: Builds trigger automatically every week at **11:50 PM UTC On Tuesdays, Thursdays & Saturdays**, as well as on manual execution via `workflow_dispatch`.
25+
* **Smart Verification**: The compiler checks upstream releases first. If a brand-new upstream version of `MediaInfo` is detected, a **Clean Build** is triggered. If no upstream updates exist, the workflow automatically force-rebuilds the current version to apply the latest security patches to all bundled dependencies.
2526

2627
### 💻 Target Architectures
2728
This project focuses explicitly on delivering high-performance, optimized **64-bit Linux environments**.
@@ -41,19 +42,26 @@ To prevent repository bloat while maintaining quick access to stable historical
4142
```mermaid
4243
graph TD
4344
A[Cron Schedule / Manual Dispatch] --> B{Version Check}
44-
B -- Upstream == Local Tag --> C[Skip Execution]
45-
B -- New Version Found --> D[Parallel Build Matrix]
46-
47-
subgraph Build Platforms
48-
D --> E[linux/amd64 <br> ubuntu-latest]
49-
D --> F[linux/arm64 <br> ubuntu-24.04-arm64]
45+
B -- Upstream == Local Tag --> C[Force Rebuild <br> Security Updates]
46+
B -- New Version Found --> D[New Release <br> Clean Build]
47+
C --> M[Parallel Build Matrix]
48+
D --> M
49+
50+
subgraph Build Platforms.
51+
M --> E[linux/amd64 <br> ubuntu-26.04]
52+
M --> F[linux/arm64 <br> ubuntu-26.04-arm]
5053
end
51-
54+
5255
E --> G[Generate Hashes <br> sha256sum]
5356
F --> G
54-
G --> H[GitHub Release <br> Publishes Assets & Purges Old Releases]
55-
56-
style C fill:#f9f,stroke:#333,stroke-width:2px
57-
style H fill:#bbf,stroke:#333,stroke-width:2px
57+
G --> H[Overwrites Old Tag <br> If Rebuilding]
58+
H --> I[Publishes Assets]
59+
I --> J[Purges Old Releases]
60+
61+
style C fill:#ffeb99,stroke:#333,stroke-width:2px
62+
style D fill:#baffc9,stroke:#333,stroke-width:2px
63+
style H fill:#e3a6c3,stroke:#333,stroke-width:2px
64+
style I fill:#e3a6c3,stroke:#333,stroke-width:2px
65+
style J fill:#e3a6c3,stroke:#333,stroke-width:2px
5866
```
5967
---

0 commit comments

Comments
 (0)