-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add customizable workflow which accepts information about what module…
… to build, on what platform and flavour (using available Docker tags).
- Loading branch information
Showing
1 changed file
with
61 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,61 @@ | ||
name: Build Perl CPAN modules for Logitech Media Server | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
flavour: | ||
description: The Linux flavour we're building for. Currently 'debian' or 'fedora' only. | ||
type: choice | ||
options: | ||
- debian | ||
- fedora | ||
required: true | ||
default: debian | ||
tag: | ||
description: The Docker tag to use to build. Defaults to "testing" for Debian, "latest" for Fedora if left blank. | ||
type: string | ||
required: false | ||
platform: | ||
description: The hardware platform for which to build. | ||
type: choice | ||
options: | ||
- amd64 | ||
- aarch64 | ||
- armv7 | ||
required: true | ||
default: amd64 | ||
module: | ||
description: A specific module you'd like to build. Defaults to all modules if none is specified. | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
buildCPAN: | ||
name: Build Perl CPAN modules | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set requested Docker image tag | ||
if: ${{ inputs.tag }} | ||
shell: bash | ||
run: | | ||
DOCKERFILE="CPAN/Docker/Dockerfile.${{ inputs.flavour }}" | ||
sed -Ei 's/:(latest|testing)/:${{ inputs.tag }}/g' $DOCKERFILE | ||
head $DOCKERFILE | ||
- name: Run Build Script | ||
shell: bash | ||
run: | | ||
cd CPAN | ||
docker build --rm --platform=linux/${{ inputs.platform }} -f "Docker/Dockerfile.${{ inputs.flavour }}" -t slimservervendor:${{ inputs.flavour }} . | ||
docker run --rm --platform=linux/${{ inputs.platform }} -v `pwd`:/cpan slimservervendor:${{ inputs.flavour }} ./buildme.sh ${{ inputs.module }} | ||
# TODO - run LMS smoke test | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !env.ACT }} | ||
with: | ||
name: ${{ inputs.module && inputs.module || 'CPAN'}}-${{ inputs.flavour }}${{ inputs.tag && format('-{0}', inputs.tag) || ''}}-${{ inputs.platform }} | ||
path: CPAN/build/arch/5.*/*/auto/ |