Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bump-saturn
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Dec 14, 2024
2 parents 0732c4f + 8eb3049 commit 9e7a49c
Show file tree
Hide file tree
Showing 230 changed files with 7,210 additions and 2,748 deletions.
2 changes: 1 addition & 1 deletion .github/alpine/APKBUILD-minimal.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgdesc="Swiss-army knife for multimedia streaming"
url="https://github.com/savonet/liquidsoap"
arch="all"
license="GPL-2.0-only"
install="@APK_PACKAGE@.pre-install"
install="@APK_PACKAGE@.post-install"
options="!check textrels"

package() {
Expand Down
2 changes: 1 addition & 1 deletion .github/alpine/APKBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgdesc="Swiss-army knife for multimedia streaming"
url="https://github.com/savonet/liquidsoap"
arch="all"
license="GPL-2.0-only"
install="@APK_PACKAGE@.pre-install"
install="@APK_PACKAGE@.post-install"
options="!check textrels"
depends="sdl2 sdl2_image sdl2_ttf"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ adduser -S -D -h /var/liquidsoap -s /sbin/nologin -G liquidsoap -g liquidsoap li
addgroup liquidsoap audio 2> /dev/null
mkdir -p /var/log/liquidsoap
mkdir -p /var/cache/liquidspap
chown liquidsoap:liquidsoap /var/log/liquidsoap

echo "Generating cache for the standard library.."
LIQ_CACHE_SYSTEM_DIR=/var/cache/liquidsoap liquidsoap --cache-only '()'

chown -R liquidsoap:liquidsoap /var/log/liquidsoap
chown liquidsoap:liquidsoap /var/cache/liquidsoap
chmod -R +r /var/cache/liquidsoap

exit 0
10 changes: 7 additions & 3 deletions .github/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ if ! test -d /var/cache/liquidsoap; then
mkdir -p /var/cache/liquidsoap
fi

echo "Generating cache for the standard library.."
LIQ_CACHE_SYSTEM_DIR=/var/cache/liquidsoap liquidsoap --cache-only '()'

# Fix directories ownership
chown liquidsoap:liquidsoap /var/log/liquidsoap
chown liquidsoap:liquidsoap /var/cache/liquidsoap
chown root:root /usr/share/liquidsoap
chown -R liquidsoap:liquidsoap /var/log/liquidsoap
chmod -R +r /var/log/liquidsoap
chown -R liquidsoap:liquidsoap /var/cache/liquidsoap
chown -R root:root /usr/share/liquidsoap

#DEBHELPER#

Expand Down
8 changes: 7 additions & 1 deletion .github/opam/liquidsoap-core-windows.opam
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ depends: [
"magic-mime-windows"
"menhir"
"menhirLib-windows"
"uri"
"uri-windows"
"fileutils"
"fileutils-windows"
"curl-windows"
"xml-light-windows"
"mem_usage-windows" {>= "0.1.1"}
"metadata-windows" {>= "0.3.0"}
"dune-site-windows"
Expand Down Expand Up @@ -123,7 +129,7 @@ build: [
"LIQUIDSOAP_BUILD_TARGET=standalone"
"LIQUIDSOAP_SYS_CONFIG=mingw"
"LIQUIDSOAP_ENABLE_BUILD_CONFIG=false"
"LDFLAGS=-lssp -lfdk-aac"
"LIQ_LDFLAGS=-lcurl -lwldap32 -ldl -lnghttp2 -lpsl -lssh2 -lidn2 -lzstd -lunistring -lbrotlicommon -lbrotlidec -lcrypt32 -liconv -lpthread -lz -lbcrypt -lwinmm -lksuser -link /usr/src/mxe/usr/x86_64-w64-mingw32.static/lib/libavutil.a"
"dune"
"build"
"-x"
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sed -e "s#@APK_PACKAGE@#${APK_PACKAGE}#" liquidsoap/.github/alpine/APKBUILD.in |
sed -e "s#@APK_RELEASE@#${APK_RELEASE}#" \
> APKBUILD

cp "liquidsoap/.github/alpine/liquidsoap.pre-install" "${APK_PACKAGE}.pre-install"
cp "liquidsoap/.github/alpine/liquidsoap.post-install" "${APK_PACKAGE}.post-install"

abuild-keygen -a -n
abuild
Expand Down Expand Up @@ -83,7 +83,7 @@ sed -e "s#@APK_PACKAGE@#${APK_PACKAGE}-minimal#" liquidsoap/.github/alpine/APKBU
sed -e "s#@APK_RELEASE@#${APK_RELEASE}#" \
> APKBUILD

cp "liquidsoap/.github/alpine/liquidsoap.pre-install" "${APK_PACKAGE}-minimal.pre-install"
cp "liquidsoap/.github/alpine/liquidsoap.post-install" "${APK_PACKAGE}-minimal.post-install"

abuild-keygen -a -n
abuild
Expand Down
14 changes: 4 additions & 10 deletions .github/scripts/build-details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,20 @@ if [[ "${IS_FORK}" != "true" && ("${BRANCH}" =~ ^rolling-release\-v[0-9]\.[0-9]\
echo "Branch is release branch"
IS_RELEASE=true

echo "Building on all architectures"
BUILD_OS='["debian_trixie", "debian_bookworm", "ubuntu_oracular", "ubuntu_noble", "alpine"]'
BUILD_PLATFORM='["amd64", "arm64"]'
BUILD_INCLUDE='[{"platform": "amd64", "runs-on": "ubuntu-latest", "alpine-arch": "x86_64", "docker-platform": "linux/amd64", "docker-debian-os": "bookworm"}, {"platform": "arm64", "runs-on": ["self-hosted", "build"], "alpine-arch": "aarch64", "docker-platform": "linux/arm64", "docker-debian-os": "bookworm"}]'

echo "Branch has a docker release"
DOCKER_RELEASE=true
else
echo "Branch is not release branch"
IS_RELEASE=

echo "Building on amd64 only"
BUILD_OS='["debian_trixie", "debian_bookworm", "ubuntu_oracular", "ubuntu_noble", "alpine"]'
BUILD_PLATFORM='["amd64"]'
BUILD_INCLUDE='[{"platform": "amd64", "runs-on": "ubuntu-latest", "alpine-arch": "x86_64", "docker-platform": "linux/amd64", "docker-debian-os": "bookworm"}]'

echo "Branch does not have a docker release"
DOCKER_RELEASE=
fi

BUILD_OS='["debian_trixie", "debian_bookworm", "ubuntu_oracular", "ubuntu_noble", "alpine"]'
BUILD_PLATFORM='["amd64", "arm64"]'
BUILD_INCLUDE='[{"platform": "amd64", "runs-on": "ubuntu-latest", "alpine-arch": "x86_64", "docker-debian-os": "bookworm"}, {"platform": "arm64", "runs-on": "depot-ubuntu-22.04-arm-4", "alpine-arch": "aarch64", "docker-debian-os": "bookworm"}]'

SHA=$(git rev-parse --short HEAD)

if [[ "${BRANCH}" =~ "rolling-release-" ]]; then
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/build-docker-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ TAG="$2"
USER="$3"
PASSWORD="$4"
ARCHITECTURE="$5"
DOCKER_PLATFORM="$6"

cp "$APK_FILE" .

docker login -u "$USER" -p "$PASSWORD"

docker buildx build \
docker build \
--pull \
--platform "${DOCKER_PLATFORM}" \
--no-cache \
--provenance false \
--build-arg "APK_FILE=$APK_FILE" \
--file .github/docker/Dockerfile.production-alpine \
--tag "savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" \
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ TAG="$3"
USER="$4"
PASSWORD="$5"
ARCHITECTURE="$6"
DOCKER_PLATFORM="$7"

cp "$DEB_FILE" "$DEB_DEBUG_FILE" .

DOCKERFILE=.github/docker/Dockerfile.production

docker login -u "$USER" -p "$PASSWORD"

docker buildx build \
docker build \
--pull \
--platform "${DOCKER_PLATFORM}" \
--no-cache \
--provenance false \
--build-arg "DEB_FILE=$DEB_FILE" \
--build-arg "DEB_DEBUG_FILE=$DEB_DEBUG_FILE" \
--file "${DOCKERFILE}" \
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/build-posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ echo "::endgroup::"

echo "::group::Setting up specific dependencies"

opam install -y xml-light

cd /tmp/liquidsoap-full/liquidsoap

./.github/scripts/checkout-deps.sh
Expand All @@ -50,7 +52,7 @@ cd ..

opam update
opam remove -y jemalloc
opam install -y tls.0.17.4 saturn_lockfree.0.5.0 ppx_hash
opam install -y tls.1.0.2 ca-certs mirage-crypto-rng cstruct saturn_lockfree.0.5.0 ppx_hash memtrace

cd /tmp/liquidsoap-full

Expand Down
7 changes: 0 additions & 7 deletions .github/scripts/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@ export CC=""
echo "::group::Installing deps"

eval "$(opam config env)"
opam repository set-url default https://github.com/ocaml/opam-repository.git
opam repository set-url windows https://github.com/ocaml-cross/opam-cross-windows.git
opam update windows
# shellcheck disable=SC2046
opam upgrade -y $(echo "$OPAM_DEPS" | sed -e 's#,# #g') ffmpeg-windows ffmpeg-avutil-windows
opam remove -y pcre-windows

# Debug
opam reinstall -y cry-windows

echo "::endgroup::"

Expand Down
20 changes: 0 additions & 20 deletions .github/scripts/push-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,6 @@ COMMIT_SHORT=$(echo "${GITHUB_SHA}" | cut -c-7)$(echo "${GITHUB_SHA}" | cut -d'-
docker login -u "$USER" -p "$PASSWORD"
# Something is odd with the docker repo
## REMOVE WHEN FIXED ##
docker login ghcr.io -u "$GHCR_USER" -p "$GHCR_PASSWORD"
docker pull "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_amd64"
docker tag "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_amd64" "savonet/liquidsoap-ci-build:${TAG}_amd64"
docker push "savonet/liquidsoap-ci-build:${TAG}_amd64"
docker pull "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_arm64"
docker tag "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_arm64" "savonet/liquidsoap-ci-build:${TAG}_arm64"
docker push "savonet/liquidsoap-ci-build:${TAG}_arm64"
docker pull "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_amd64"
docker tag "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_amd64" "savonet/liquidsoap-ci-build:${TAG}_alpine_amd64"
docker push "savonet/liquidsoap-ci-build:${TAG}_alpine_amd64"
docker pull "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_arm64"
docker tag "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_arm64" "savonet/liquidsoap-ci-build:${TAG}_alpine_arm64"
docker push "savonet/liquidsoap-ci-build:${TAG}_alpine_arm64"
docker manifest create "savonet/liquidsoap:${TAG}" --amend "savonet/liquidsoap-ci-build:${TAG}_amd64" --amend "savonet/liquidsoap-ci-build:${TAG}_arm64"
docker manifest push "savonet/liquidsoap:${TAG}"
Expand Down
35 changes: 23 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
- main
- rolling-release-*
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-*
paths:
- ".github/workflows/ci.yml"
- "**/*.ml"
- "**/*.liq"
- "**/dune"
- "**/dune.inc"
- "doc/**"
- "dune-project"
- scripts/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -42,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
needs: build_details
container:
image: savonet/liquidsoap-ci:debian_bookworm_amd64
image: savonet/liquidsoap-ci:debian_bookworm
options: --user opam
env:
HOME: /home/opam
Expand Down Expand Up @@ -91,7 +101,7 @@ jobs:
build_js:
runs-on: ubuntu-latest
container:
image: savonet/liquidsoap-ci:debian_bookworm_amd64
image: savonet/liquidsoap-ci:debian_bookworm
options: --user opam
env:
HOME: /home/opam
Expand All @@ -111,7 +121,7 @@ jobs:
cd /tmp/liquidsoap-full/liquidsoap
eval "$(opam config env)"
opam update
opam install -y saturn_lockfree.0.5.0
opam install -y xml-light saturn_lockfree.0.5.0
dune build --profile release ./src/js/interactive_js.bc.js
tree_sitter_parse:
Expand Down Expand Up @@ -155,7 +165,7 @@ jobs:
needs: build_details
if: github.event_name != 'pull_request' && github.repository_owner == 'savonet' && needs.build_details.outputs.branch == 'main'
container:
image: savonet/liquidsoap-ci:debian_bookworm_amd64
image: savonet/liquidsoap-ci:debian_bookworm
options: --user root -v ${{ github.workspace }}/${{ github.run_number }}:/tmp/${{ github.run_number }}
env:
HOME: /home/opam
Expand Down Expand Up @@ -209,7 +219,7 @@ jobs:
runs-on: ubuntu-latest
needs: build_details
container:
image: savonet/liquidsoap-ci:debian_bookworm_amd64
image: savonet/liquidsoap-ci:debian_bookworm
options: --user root --privileged --ulimit core=-1 --security-opt seccomp=unconfined -v ${{ github.workspace }}/${{ github.run_number }}:/tmp/${{ github.run_number }}
strategy:
fail-fast: false
Expand All @@ -236,6 +246,7 @@ jobs:
sudo -u opam -E git checkout ${{ github.sha }}
- name: Install sqlite
run: |
sudo apt-get -y update
sudo apt-get -y install libsqlite3-dev
sudo -u opam -E opam install -y sqlite3
- name: Install pandoc
Expand Down Expand Up @@ -367,7 +378,7 @@ jobs:
platform: ${{ fromJson(needs.build_details.outputs.build_platform) }}
include: ${{ fromJson(needs.build_details.outputs.build_include) }}
container:
image: savonet/liquidsoap-ci:${{ matrix.os }}_${{ matrix.platform }}
image: savonet/liquidsoap-ci:${{ matrix.os }}
options: --user root --privileged -v ${{ github.workspace }}/${{ github.run_number }}:/tmp/${{ github.run_number }}
env:
HOME: /home/opam
Expand Down Expand Up @@ -480,14 +491,14 @@ jobs:
path: ${{ github.workspace }}/${{ github.run_number }}/s3-artifacts

build_win32:
runs-on: ubuntu-latest
runs-on: depot-ubuntu-22.04-4
needs: build_details
strategy:
fail-fast: false
matrix:
system: [x64]
container:
image: savonet/liquidsoap-win32-deps-${{ matrix.system }}
image: savonet/liquidsoap-win32-${{ matrix.system }}
options: --user root -v ${{ github.workspace }}/${{ github.run_number }}:/tmp/${{ github.run_number }}
env:
OPAM_DEPS: ao-windows,lastfm-windows,camomile-windows,cry-windows,dtools-windows,duppy-windows,ffmpeg-windows,ffmpeg-avutil-windows,mm-windows,re-windows,portaudio-windows,samplerate-windows,sedlex-windows,ssl-windows,srt-windows,winsvc-windows,mem_usage-windows
Expand Down Expand Up @@ -630,7 +641,7 @@ jobs:
- name: Log in to the github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build docker image
run: .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }} ${{ matrix.docker-platform }}
run: .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}

build_docker_alpine:
runs-on: ${{ matrix.runs-on }}
Expand All @@ -657,7 +668,7 @@ jobs:
- name: Log in to the github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build docker image
run: .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }} ${{ matrix.docker-platform }}
run: .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}

build_docker_minimal:
runs-on: ${{ matrix.runs-on }}
Expand Down Expand Up @@ -688,7 +699,7 @@ jobs:
- name: Log in to the github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build docker image
run: .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }} ${{ matrix.docker-platform }}
run: .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}

build_docker_alpine_minimal:
runs-on: ${{ matrix.runs-on }}
Expand Down Expand Up @@ -719,7 +730,7 @@ jobs:
- name: Log in to the github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build docker image
run: .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ steps.alpine_dbg_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }} ${{ matrix.docker-platform }}
run: .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ steps.alpine_dbg_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}

build_docker_release:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
exclude: dune.inc

- repo: https://github.com/savonet/pre-commit-liquidsoap
rev: c5eab8dceed09fa985b3cf0ba3fe7f398fc00c04
rev: 056cf2da9d985e1915a069679f126a461206504a
hooks:
- id: liquidsoap-prettier

Expand Down
Loading

0 comments on commit 9e7a49c

Please sign in to comment.