Skip to content

Commit

Permalink
Merge branch 'BtbN:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pendy99 authored Jun 18, 2023
2 parents 16220e0 + 3e75fcc commit 49f81e8
Show file tree
Hide file tree
Showing 115 changed files with 552 additions and 396 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,24 @@ env:
HAVE_CLEANUP_PAT: ${{ secrets.CLEANUP_PAT != '' }}

jobs:
pre_check:
name: Pre Checks
if: ${{ github.event.inputs.buildOnly != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Repo Check
run: |
if [[ "$GITHUB_REPOSITORY" != "BtbN/FFmpeg-Builds" ]]; then
echo "When forking this repository to make your own builds, you have to adjust this check."
echo "When doing so make sure to randomize the scheduled cron time above, in order to spread out the various build times as much as possible."
echo "This has been put in place due to the enormous amounts of traffic hundreds/thousands of parallel builds can cause on external infrastructure."
exit 1
fi
exit 0
build_base:
name: Build base image
if: ${{ github.event.inputs.buildOnly != 'true' }}
needs: pre_check
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -46,8 +61,11 @@ jobs:
id: imagename
run: |
IMG="${GITHUB_REPOSITORY,,}/base"
DLIMG="${GITHUB_REPOSITORY,,}/dl_cache"
echo "name=ghcr.io/${IMG/ /-}" >> $GITHUB_OUTPUT
echo "rawname=${IMG/ /-}" >> $GITHUB_OUTPUT
echo "dlname=ghcr.io/${DLIMG/ /-}" >> $GITHUB_OUTPUT
echo "dlrawname=${DLIMG/ /-}" >> $GITHUB_OUTPUT
- name: Stop Commands
run: T="$(echo -n ${{ github.token }} | sha256sum | head -c 64)" && echo -e "::add-mask::${T}\n::stop-commands::${T}"
- name: Build target base image
Expand All @@ -59,6 +77,18 @@ jobs:
tags: ${{ steps.imagename.outputs.name }}:latest
cache-to: type=registry,mode=max,ref=${{ steps.imagename.outputs.name }}:cache
cache-from: type=registry,ref=${{ steps.imagename.outputs.name }}:cache
- name: Generate download cache Dockerfile
run: ./generate.sh dl only
- name: Build download cache image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.dl
pull: true
push: true
tags: ${{ steps.imagename.outputs.dlname }}:latest
cache-to: type=registry,mode=max,ref=${{ steps.imagename.outputs.dlname }}:cache
cache-from: type=registry,ref=${{ steps.imagename.outputs.dlname }}:cache
- name: Cleanup
if: ${{ env.HAVE_CLEANUP_PAT == 'true' }}
continue-on-error: true
Expand All @@ -70,6 +100,17 @@ jobs:
repository: ${{ github.repository }}
owner_type: user
untagged_only: true
- name: Cleanup Download Cache
if: ${{ env.HAVE_CLEANUP_PAT == 'true' }}
continue-on-error: true
uses: BtbN/delete-untagged-ghcr-action@main
with:
token: ${{ secrets.CLEANUP_PAT }}
package_name: ${{ steps.imagename.outputs.dlrawname }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
owner_type: user
untagged_only: true
build_target_bases:
name: Build target base image
if: ${{ github.event.inputs.buildOnly != 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/Dockerfile
/Dockerfile*
/ffbuild/
/artifacts/
/.cache/
71 changes: 65 additions & 6 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,76 @@ set -e
cd "$(dirname "$0")"
source util/vars.sh

rm -f Dockerfile
rm -f Dockerfile Dockerfile.{dl,final,dl.final}

layername() {
printf "layer-"
basename "$1" | sed 's/.sh$//'
}

to_df() {
_of="${TODF:-Dockerfile}"
printf "$@" >> "$_of"
echo >> "$_of"
}

default_dl() {
to_df "RUN git-mini-clone \"$SCRIPT_REPO\" \"$SCRIPT_COMMIT\" \"$1\""
}

###
### Generate download Dockerfile
###

exec_dockerstage_dl() {
SCRIPT="$1"
(
SELF="$SCRIPT"
SELFLAYER="$(layername "$STAGE")"
source "$SCRIPT"
ffbuild_dockerdl || exit $?
TODF="Dockerfile.dl.final" ffbuild_dockerlayer_dl || exit $?
)
}

export TODF="Dockerfile.dl"

to_df "FROM ${REGISTRY}/${REPO}/base:latest AS base"
to_df "ENV TARGET=$TARGET VARIANT=$VARIANT REPO=$REPO ADDINS_STR=$ADDINS_STR"
to_df "WORKDIR \$FFBUILD_DLDIR"

PREVLAYER="base"
for ID in $(ls -1d scripts.d/??-* | sed -s 's|^.*/\(..\).*|\1|' | sort -u); do
LAYER="layer-$ID"

for STAGE in scripts.d/$ID-*; do
if [[ -f "$STAGE" ]]; then
to_df "FROM $PREVLAYER AS $(layername "$STAGE")"
exec_dockerstage_dl "$STAGE"
else
for STAGE in "${STAGE}"/??-*; do
to_df "FROM $PREVLAYER AS $(layername "$STAGE")"
exec_dockerstage_dl "$STAGE"
done
fi
done
done

to_df "FROM base AS intermediate"
cat Dockerfile.dl.final >> "$TODF"
rm Dockerfile.dl.final

to_df "FROM base"
to_df "COPY --from=intermediate \$FFBUILD_DLDIR/. \$FFBUILD_DLDIR"

if [[ "$TARGET" == "dl" && "$VARIANT" == "only" ]]; then
exit 0
fi

###
### Generate main Dockerfile
###

exec_dockerstage() {
SCRIPT="$1"
(
Expand All @@ -20,11 +83,7 @@ exec_dockerstage() {
)
}

to_df() {
_of="${TODF:-Dockerfile}"
printf "$@" >> "$_of"
echo >> "$_of"
}
export TODF="Dockerfile"

to_df "FROM ${REGISTRY}/${REPO}/base-${TARGET}:latest AS base"
to_df "ENV TARGET=$TARGET VARIANT=$VARIANT REPO=$REPO ADDINS_STR=$ADDINS_STR"
Expand Down
30 changes: 20 additions & 10 deletions images/base-linux64/ct-ng-config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG 1.25.0.152_89671bf Configuration
# crosstool-NG 1.25.0.196_227d99d Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
Expand Down Expand Up @@ -28,7 +28,7 @@ CT_CONFIGURE_has_sha1sum=y
CT_CONFIGURE_has_sha256sum=y
CT_CONFIGURE_has_sha512sum=y
CT_CONFIGURE_has_install_with_strip_program=y
CT_VERSION="1.25.0.152_89671bf"
CT_VERSION="1.25.0.196_227d99d"
CT_VCHECK=""
CT_CONFIG_VERSION_ENV="4"
CT_CONFIG_VERSION_CURRENT="4"
Expand Down Expand Up @@ -269,6 +269,8 @@ CT_LINUX_PATCH_GLOBAL=y
# CT_LINUX_PATCH_LOCAL_BUNDLED is not set
# CT_LINUX_PATCH_NONE is not set
CT_LINUX_PATCH_ORDER="global"
# CT_LINUX_V_6_3 is not set
# CT_LINUX_V_6_2 is not set
# CT_LINUX_V_6_1 is not set
# CT_LINUX_V_6_0 is not set
# CT_LINUX_V_5_19 is not set
Expand Down Expand Up @@ -475,6 +477,8 @@ CT_GLIBC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GLIBC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GLIBC_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_GLIBC_SIGNATURE_FORMAT="packed/.sig"
CT_GLIBC_2_37_or_older=y
CT_GLIBC_older_than_2_37=y
CT_GLIBC_2_36_or_older=y
CT_GLIBC_older_than_2_36=y
CT_GLIBC_2_34_or_older=y
Expand Down Expand Up @@ -579,7 +583,8 @@ CT_GCC_PATCH_GLOBAL=y
# CT_GCC_PATCH_LOCAL_BUNDLED is not set
# CT_GCC_PATCH_NONE is not set
CT_GCC_PATCH_ORDER="global"
CT_GCC_V_12=y
CT_GCC_V_13=y
# CT_GCC_V_12 is not set
# CT_GCC_V_11 is not set
# CT_GCC_V_10 is not set
# CT_GCC_V_9 is not set
Expand All @@ -588,12 +593,14 @@ CT_GCC_V_12=y
# CT_GCC_V_6 is not set
# CT_GCC_V_5 is not set
# CT_GCC_V_4_9 is not set
CT_GCC_VERSION="12.2.0"
CT_GCC_VERSION="13.1.0"
CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})"
CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GCC_SIGNATURE_FORMAT=""
CT_GCC_later_than_13=y
CT_GCC_13_or_later=y
CT_GCC_later_than_12=y
CT_GCC_12_or_later=y
CT_GCC_later_than_11=y
Expand Down Expand Up @@ -766,7 +773,8 @@ CT_ISL_PATCH_GLOBAL=y
# CT_ISL_PATCH_LOCAL_BUNDLED is not set
# CT_ISL_PATCH_NONE is not set
CT_ISL_PATCH_ORDER="global"
CT_ISL_V_0_25=y
CT_ISL_V_0_26=y
# CT_ISL_V_0_25 is not set
# CT_ISL_V_0_24 is not set
# CT_ISL_V_0_23 is not set
# CT_ISL_V_0_22 is not set
Expand All @@ -778,7 +786,7 @@ CT_ISL_V_0_25=y
# CT_ISL_V_0_16 is not set
# CT_ISL_V_0_15 is not set
# CT_ISL_V_0_11 is not set
CT_ISL_VERSION="0.25"
CT_ISL_VERSION="0.26"
CT_ISL_MIRRORS="https://libisl.sourceforge.io"
CT_ISL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down Expand Up @@ -875,10 +883,11 @@ CT_NCURSES_PATCH_GLOBAL=y
# CT_NCURSES_PATCH_LOCAL_BUNDLED is not set
# CT_NCURSES_PATCH_NONE is not set
CT_NCURSES_PATCH_ORDER="global"
CT_NCURSES_V_6_2=y
CT_NCURSES_V_6_4=y
# CT_NCURSES_V_6_2 is not set
# CT_NCURSES_V_6_1 is not set
# CT_NCURSES_V_6_0 is not set
CT_NCURSES_VERSION="6.2"
CT_NCURSES_VERSION="6.4"
CT_NCURSES_MIRRORS="https://invisible-mirror.net/archives/ncurses $(CT_Mirrors GNU ncurses)"
CT_NCURSES_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down Expand Up @@ -927,8 +936,9 @@ CT_ZSTD_PATCH_GLOBAL=y
# CT_ZSTD_PATCH_LOCAL_BUNDLED is not set
# CT_ZSTD_PATCH_NONE is not set
CT_ZSTD_PATCH_ORDER="global"
CT_ZSTD_V_1_5_2=y
CT_ZSTD_VERSION="1.5.2"
CT_ZSTD_V_1_5_5=y
# CT_ZSTD_V_1_5_2 is not set
CT_ZSTD_VERSION="1.5.5"
CT_ZSTD_MIRRORS="https://github.com/facebook/zstd/releases/download/v${CT_ZSTD_VERSION} https://www.zstd.net/"
CT_ZSTD_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down
30 changes: 20 additions & 10 deletions images/base-linuxarm64/ct-ng-config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG 1.25.0.152_89671bf Configuration
# crosstool-NG 1.25.0.196_227d99d Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
Expand Down Expand Up @@ -28,7 +28,7 @@ CT_CONFIGURE_has_sha1sum=y
CT_CONFIGURE_has_sha256sum=y
CT_CONFIGURE_has_sha512sum=y
CT_CONFIGURE_has_install_with_strip_program=y
CT_VERSION="1.25.0.152_89671bf"
CT_VERSION="1.25.0.196_227d99d"
CT_VCHECK=""
CT_CONFIG_VERSION_ENV="4"
CT_CONFIG_VERSION_CURRENT="4"
Expand Down Expand Up @@ -276,6 +276,8 @@ CT_LINUX_PATCH_GLOBAL=y
# CT_LINUX_PATCH_LOCAL_BUNDLED is not set
# CT_LINUX_PATCH_NONE is not set
CT_LINUX_PATCH_ORDER="global"
# CT_LINUX_V_6_3 is not set
# CT_LINUX_V_6_2 is not set
# CT_LINUX_V_6_1 is not set
# CT_LINUX_V_6_0 is not set
# CT_LINUX_V_5_19 is not set
Expand Down Expand Up @@ -481,6 +483,8 @@ CT_GLIBC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GLIBC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GLIBC_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz"
CT_GLIBC_SIGNATURE_FORMAT="packed/.sig"
CT_GLIBC_2_37_or_older=y
CT_GLIBC_older_than_2_37=y
CT_GLIBC_2_36_or_older=y
CT_GLIBC_older_than_2_36=y
CT_GLIBC_2_34_or_older=y
Expand Down Expand Up @@ -591,7 +595,8 @@ CT_GCC_PATCH_GLOBAL=y
# CT_GCC_PATCH_LOCAL_BUNDLED is not set
# CT_GCC_PATCH_NONE is not set
CT_GCC_PATCH_ORDER="global"
CT_GCC_V_12=y
CT_GCC_V_13=y
# CT_GCC_V_12 is not set
# CT_GCC_V_11 is not set
# CT_GCC_V_10 is not set
# CT_GCC_V_9 is not set
Expand All @@ -600,12 +605,14 @@ CT_GCC_V_12=y
# CT_GCC_V_6 is not set
# CT_GCC_V_5 is not set
# CT_GCC_V_4_9 is not set
CT_GCC_VERSION="12.2.0"
CT_GCC_VERSION="13.1.0"
CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})"
CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_GCC_ARCHIVE_FORMATS=".tar.xz .tar.gz"
CT_GCC_SIGNATURE_FORMAT=""
CT_GCC_later_than_13=y
CT_GCC_13_or_later=y
CT_GCC_later_than_12=y
CT_GCC_12_or_later=y
CT_GCC_later_than_11=y
Expand Down Expand Up @@ -778,7 +785,8 @@ CT_ISL_PATCH_GLOBAL=y
# CT_ISL_PATCH_LOCAL_BUNDLED is not set
# CT_ISL_PATCH_NONE is not set
CT_ISL_PATCH_ORDER="global"
CT_ISL_V_0_25=y
CT_ISL_V_0_26=y
# CT_ISL_V_0_25 is not set
# CT_ISL_V_0_24 is not set
# CT_ISL_V_0_23 is not set
# CT_ISL_V_0_22 is not set
Expand All @@ -790,7 +798,7 @@ CT_ISL_V_0_25=y
# CT_ISL_V_0_16 is not set
# CT_ISL_V_0_15 is not set
# CT_ISL_V_0_11 is not set
CT_ISL_VERSION="0.25"
CT_ISL_VERSION="0.26"
CT_ISL_MIRRORS="https://libisl.sourceforge.io"
CT_ISL_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ISL_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down Expand Up @@ -887,10 +895,11 @@ CT_NCURSES_PATCH_GLOBAL=y
# CT_NCURSES_PATCH_LOCAL_BUNDLED is not set
# CT_NCURSES_PATCH_NONE is not set
CT_NCURSES_PATCH_ORDER="global"
CT_NCURSES_V_6_2=y
CT_NCURSES_V_6_4=y
# CT_NCURSES_V_6_2 is not set
# CT_NCURSES_V_6_1 is not set
# CT_NCURSES_V_6_0 is not set
CT_NCURSES_VERSION="6.2"
CT_NCURSES_VERSION="6.4"
CT_NCURSES_MIRRORS="https://invisible-mirror.net/archives/ncurses $(CT_Mirrors GNU ncurses)"
CT_NCURSES_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_NCURSES_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down Expand Up @@ -939,8 +948,9 @@ CT_ZSTD_PATCH_GLOBAL=y
# CT_ZSTD_PATCH_LOCAL_BUNDLED is not set
# CT_ZSTD_PATCH_NONE is not set
CT_ZSTD_PATCH_ORDER="global"
CT_ZSTD_V_1_5_2=y
CT_ZSTD_VERSION="1.5.2"
CT_ZSTD_V_1_5_5=y
# CT_ZSTD_V_1_5_2 is not set
CT_ZSTD_VERSION="1.5.5"
CT_ZSTD_MIRRORS="https://github.com/facebook/zstd/releases/download/v${CT_ZSTD_VERSION} https://www.zstd.net/"
CT_ZSTD_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZSTD_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
Expand Down
Loading

0 comments on commit 49f81e8

Please sign in to comment.