From e40b3fc708f8039c1a6ba10f0b28cb8a5253a318 Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Fri, 4 Nov 2022 07:34:14 +0100 Subject: [PATCH] Create Github workflow to build CPAN binaries --- .github/actions/buildCPAN/action.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/buildCPANDebian.yaml | 14 ++++++++++++++ .github/workflows/buildCPANFedora.yaml | 14 ++++++++++++++ CPAN/Docker/Dockerfile.debian | 3 ++- CPAN/Docker/Dockerfile.fedora | 1 + CPAN/Docker/README.md | 8 ++------ 6 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 .github/actions/buildCPAN/action.yaml create mode 100644 .github/workflows/buildCPANDebian.yaml create mode 100644 .github/workflows/buildCPANFedora.yaml diff --git a/.github/actions/buildCPAN/action.yaml b/.github/actions/buildCPAN/action.yaml new file mode 100644 index 000000000..512e7367f --- /dev/null +++ b/.github/actions/buildCPAN/action.yaml @@ -0,0 +1,26 @@ +name: Build Perl CPAN modules for Logitech Media Server + +inputs: + flavour: + description: The Linux flavour we're building for. Currently 'debian' or 'fedora' only. + default: 'debian' + +runs: + using: "composite" + + steps: + - name: Run Build Script + shell: bash + run: | + cd CPAN + docker build --rm -f "Docker/Dockerfile.${{ inputs.flavour }}" -t slimservervendor:${{ inputs.flavour }} . + # TODO - make platform configurable + docker run --rm --platform=linux/amd64 -v `pwd`:/cpan slimservervendor:debian ./buildme.sh + + # TODO - run LMS smoke test + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: CPAN-${{ inputs.flavour }} + path: CPAN/build/arch/5.*/*/auto/ diff --git a/.github/workflows/buildCPANDebian.yaml b/.github/workflows/buildCPANDebian.yaml new file mode 100644 index 000000000..d4095f1fd --- /dev/null +++ b/.github/workflows/buildCPANDebian.yaml @@ -0,0 +1,14 @@ +name: 'Build Perl CPAN modules for Debian' +on: [workflow_dispatch] + +jobs: + linux: + name: Build Perl CPAN modules + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/buildCPAN + with: + flavour: debian diff --git a/.github/workflows/buildCPANFedora.yaml b/.github/workflows/buildCPANFedora.yaml new file mode 100644 index 000000000..6728b3317 --- /dev/null +++ b/.github/workflows/buildCPANFedora.yaml @@ -0,0 +1,14 @@ +name: 'Build Perl CPAN modules for Fedora' +on: [workflow_dispatch] + +jobs: + linux: + name: Build Perl CPAN modules + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/buildCPAN + with: + flavour: fedora diff --git a/CPAN/Docker/Dockerfile.debian b/CPAN/Docker/Dockerfile.debian index 921ffb157..98fff2211 100644 --- a/CPAN/Docker/Dockerfile.debian +++ b/CPAN/Docker/Dockerfile.debian @@ -1,8 +1,9 @@ # adjust base image to whatever version you want to build with -FROM --platform=linux/amd64 debian:unstable +FROM --platform=linux/amd64 debian:testing RUN apt-get update && apt-get install -y nasm make gcc g++ rsync patch libc-bin zlib1g-dev libgd-dev unzip perl bzip2 RUN mkdir /cpan +WORKDIR /cpan CMD ["/bin/bash"] \ No newline at end of file diff --git a/CPAN/Docker/Dockerfile.fedora b/CPAN/Docker/Dockerfile.fedora index 33b90ce8f..2a965ee95 100644 --- a/CPAN/Docker/Dockerfile.fedora +++ b/CPAN/Docker/Dockerfile.fedora @@ -6,5 +6,6 @@ RUN dnf install -y nasm make gcc gcc-c++ rsync patch glibc zlib-devel gd-devel u rm -rf /var/cache/yum RUN mkdir /cpan +WORKDIR /cpan CMD ["/bin/bash"] \ No newline at end of file diff --git a/CPAN/Docker/README.md b/CPAN/Docker/README.md index e737fd52c..fc0ffca9c 100644 --- a/CPAN/Docker/README.md +++ b/CPAN/Docker/README.md @@ -12,9 +12,7 @@ Don't forget to adjust platform and base image versions to cover your needs. ``` cd CPAN docker build --rm -f "Docker/Dockerfile.fedora" -t slimservervendor:fedora . -docker run --rm -it --platform=linux/amd64 -v `pwd`:/cpan slimservervendor:fedora -cd cpan -./buildme.sh +docker run --rm --platform=linux/amd64 -v `pwd`:/cpan slimservervendor:fedora ./buildme.sh ``` ## Building for Debian @@ -22,7 +20,5 @@ cd cpan ``` cd CPAN docker build --rm -f "Docker/Dockerfile.debian" -t slimservervendor:debian . -docker run --rm -it --platform=linux/amd64 -v `pwd`:/cpan slimservervendor:debian -cd cpan -./buildme.sh +docker run --rm --platform=linux/amd64 -v `pwd`:/cpan slimservervendor:debian ./buildme.sh ``` \ No newline at end of file