Skip to content

Commit

Permalink
Create Github workflow to build CPAN binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger committed Nov 4, 2022
1 parent b4d1b61 commit e40b3fc
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/actions/buildCPAN/action.yaml
Original file line number Diff line number Diff line change
@@ -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/
14 changes: 14 additions & 0 deletions .github/workflows/buildCPANDebian.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/buildCPANFedora.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion CPAN/Docker/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions CPAN/Docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 2 additions & 6 deletions CPAN/Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ 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

```
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
```

0 comments on commit e40b3fc

Please sign in to comment.