-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ba0fec0
Showing
7 changed files
with
265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020-2021 BtbN <[email protected]> | ||
# | ||
# 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: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
# from: https://github.com/BtbN/FFmpeg-Builds/blob/4eb20ade1bfdd7c1ff8f23921b7c366a20157edb/util/prunetags.sh | ||
|
||
set -e | ||
git fetch --tags | ||
TAGS=( $(git tag -l "autobuild-*" | sort -r) ) | ||
|
||
KEEP_LATEST=14 | ||
KEEP_MONTHLY=12 | ||
|
||
LATEST_TAGS=() | ||
MONTHLY_TAGS=() | ||
|
||
CUR_MONTH="-1" | ||
|
||
for TAG in ${TAGS[@]}; do | ||
if [[ ${#LATEST_TAGS[@]} -lt ${KEEP_LATEST} ]]; then | ||
LATEST_TAGS+=( "$TAG" ) | ||
fi | ||
|
||
if [[ ${#MONTHLY_TAGS[@]} -lt ${KEEP_MONTHLY} ]]; then | ||
TAG_MONTH="$(echo $TAG | cut -d- -f3)" | ||
|
||
if [[ ${TAG_MONTH} != ${CUR_MONTH} ]]; then | ||
CUR_MONTH="${TAG_MONTH}" | ||
MONTHLY_TAGS+=( "$TAG" ) | ||
fi | ||
fi | ||
done | ||
|
||
for TAG in ${LATEST_TAGS[@]} ${MONTHLY_TAGS[@]}; do | ||
TAGS=( "${TAGS[@]/$TAG}" ) | ||
done | ||
|
||
for TAG in ${TAGS[@]}; do | ||
echo "Deleting ${TAG}" | ||
hub release delete "${TAG}" | ||
git tag -d "${TAG}" | ||
done | ||
|
||
git push --tags --prune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build and Publish Container Images | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
paths-ignore: | ||
- '**.rst' | ||
- '.gitignore' | ||
|
||
jobs: | ||
build_images: | ||
name: Build Container Images | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: [oldlibs] | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build image | ||
run: | | ||
docker build -t "${{ matrix.image }}" . | ||
docker save "${{ matrix.image }}":latest \ | ||
| zstd -9 > /tmp/"${{ matrix.image }}".tar.zst | ||
# Repeated uploads to the same name append to the artifact archive | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: all-images | ||
path: /tmp/${{ matrix.image }}.tar.zst | ||
|
||
publish_images: | ||
needs: build_images | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo so hub knows where to create a release | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: all-images | ||
path: /tmp/images/ | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
set -xe | ||
tag="containers-$(date +'%Y%m%d-%H%M%S')" | ||
asset_opts="$(for i in /tmp/images/*.zst ; do echo \-a "$i" ; done)" | ||
hub release create $asset_opts -m "$tag" -t master "$tag" | ||
- name: Prune Old Releases | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
bash ./.github/scripts/prunetags.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
*.old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM docker.io/library/debian:stretch-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV LC_ALL=C.UTF-8 | ||
|
||
COPY setup_root.sh / | ||
RUN /bin/dash setup_root.sh | ||
RUN /bin/rm /setup_root.sh | ||
|
||
COPY build.sh / | ||
RUN /bin/su -c '/bin/dash /build.sh' runner | ||
RUN /bin/rm /build.sh | ||
|
||
USER runner:runner | ||
CMD ["/bin/sh", "-c", "echo 'This container is supposed to run custom commands or be used interactively!'"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
=============================== | ||
Container images for libass' CI | ||
=============================== | ||
|
||
At the moment the only image is *“oldlibs”*. | ||
|
||
|
||
Containers | ||
========== | ||
|
||
oldlibs | ||
------- | ||
|
||
This container has the minimum version of all of libass' dependencies installed | ||
and otherwise an old'ish toolchain. | ||
|
||
|
||
Releases | ||
======== | ||
|
||
Releases are created automatically at every push to master | ||
to workaround the ``download-artifacts`` action only being | ||
able to use artifcats from (a different job of) the same workflow | ||
(see `action's issue <https://github.com/actions/download-artifact/issues/3>`_). | ||
|
||
As the releases only serve as a public asset storage, | ||
they may be deleted after some time. | ||
Tracking tags is a bad idea in this repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p /tmp/build | ||
set -e | ||
|
||
|
||
# Build from autotools(-like) tarballs | ||
tarball_build() ( | ||
if [ "$#" -lt 3 ] ; then | ||
echo "Usage: tarball_build <name> <url-format> <version> [configure_options...]" | ||
exit 2 | ||
fi | ||
|
||
url="$(printf "$2" "$3")" | ||
filename="tmp-${url##*/}" | ||
name="$1" | ||
version="$3" | ||
shift 3 | ||
|
||
# --insecure: Ignore cert-errors as installed certs are (too) old | ||
curl --location "$url" > "$filename" | ||
tar xf "$filename" | ||
rm "$filename" | ||
cd "$name"-"$version" | ||
|
||
./configure "$@" | ||
make -j "$(nproc)" | ||
sudo make install | ||
make clean | ||
) | ||
|
||
## FriBiDi | ||
cd /tmp/build | ||
### libass min version 0.19.0, but 0.19.1 is the first "CVS release" | ||
### and I couldn't locate a 0.19.0 tarball | ||
urlfmt='https://github.com/fribidi/fribidi/releases/download/FRIBIDI_0_19_1/fribidi-%s.tar.gz' | ||
tarball_build fribidi "$urlfmt" "0.19.1" | ||
|
||
## FreeType2 (without HarfBuzz) | ||
cd /tmp/build | ||
### Internal version 9.17.3 == external version 2.3.6 | ||
urlfmt='https://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-%s.tar.bz2' | ||
tarball_build freetype "$urlfmt" "2.3.6" | ||
|
||
## HarfBuzz | ||
cd /tmp/build | ||
urlfmt='https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-%s.tar.bz2' | ||
tarball_build harfbuzz "$urlfmt" "1.2.3" | ||
|
||
## Fontconfig | ||
cd /tmp/build | ||
urlfmt='https://www.freedesktop.org/software/fontconfig/release/fontconfig-%s.tar.bz2' | ||
tarball_build fontconfig "$urlfmt" "2.10.92" | ||
|
||
# Clean up | ||
cd / | ||
rm -fr /tmp/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Basic setup | ||
export DEBIAN_FRONTEND=noninteractive | ||
export LC_ALL=C.UTF-8 | ||
|
||
cat > /etc/apt/apt.conf.d/01_norecommend.conf <<EOF | ||
APT::Install-Recommends "0"; | ||
APT::Install-Suggests "0"; | ||
EOF | ||
|
||
# Grab LTS security updates and newer HTTPS certificates | ||
echo "deb http://security.debian.org/ stretch/updates main" >> /etc/apt/sources.list | ||
apt-get update && apt-get upgrade -y --with-new-pkgs | ||
|
||
# Basic tools and not self-built libs | ||
# to build libass-deps from tarballs | ||
# and libass itself from git | ||
apt-get install -y \ | ||
sudo bash curl ca-certificates tar gzip bzip2 \ | ||
make gcc g++ nasm pkg-config libexpat1-dev \ | ||
nasm libtool libpng-dev \ | ||
git automake1.11 autoconf2.64 | ||
apt-get clean | ||
|
||
for i in aclocal automake ; do | ||
ln -s /usr/bin/"$i"-1.11 /usr/local/bin/"$i" | ||
done | ||
for i in autoconf autoheader autom4te autoreconf autoscan ; do | ||
ln -s /usr/bin/"$i"2.64 /usr/local/bin/"$i" | ||
done | ||
|
||
# Create GitHub Actions user with matchin UID and work dir | ||
groupadd -g 1001 runner | ||
useradd -m -d /home/runner -s /bin/bash -g runner -G sudo -u 1001 runner | ||
runuser -u runner mkdir /home/runner/work | ||
|
||
sed -i -e '/^%sudo[ \t]/d' /etc/sudoers | ||
printf '%%sudo\tALL=(ALL:ALL)\tNOPASSWD:ALL\n' | EDITOR='tee -a' visudo |