Skip to content

Build Perl

Build Perl #39

Workflow file for this run

name: Build Perl
permissions:
contents: read
packages: write
on:
workflow_call:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: "0 14 * * 2" # 2pm Patch Tuesday
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
PLATFORMS: linux/amd64,linux/arm64
jobs:
perl-build:
name: "Build Perl"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ubuntu:
- focal
- jammy
#- lunar
#- mantic
#- noble
#- devel
#- rolling
#- latest
steps:
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: "Setup: Login to Docker Hub"
uses: docker/login-action@v3
with:
username: matthewbaggett
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: "Setup: Login to GHCR"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: matthewbaggett
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
name: "Build: Build & Push"
with:
context: .
target: release
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
ghcr.io/benzine-framework/perl:${{ matrix.ubuntu }}
matthewbaggett/perl:${{ matrix.ubuntu }}
benzine/perl:${{ matrix.ubuntu }}
build-args: |
${{ steps.build_args.outputs.result }}
cache-from: ${{ !env.ACT && 'type=gha' || '' }}
cache-to: ${{ !env.ACT && 'type=gha,mode=max' || '' }}
build-contexts: |
marshall:build=docker-image://ghcr.io/benzine-framework/marshall:${{ matrix.ubuntu }}
- name: "Get perl binary version"
id: perl_version
run: echo "perl_version=$(docker run --rm ghcr.io/benzine-framework/perl:${{ matrix.ubuntu }} perl -v | grep "This is perl" | cut -d'(' -f2 | cut -d')' -f1 | sed 's/[^0-9.]*//g')" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v5
name: "Build: Build & Push (Versioned)"
with:
context: .
target: release
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
ghcr.io/benzine-framework/perl:${{ steps.perl_version.outputs.perl_version }}-${{ matrix.ubuntu }}
matthewbaggett/perl:${{ steps.perl_version.outputs.perl_version }}-${{ matrix.ubuntu }}
${{ matrix.ubuntu == 'focal' || matrix.ubuntu == 'jammy' || matrix.ubuntu == 'lunar' && 'ghcr.io/benzine-framework/perl:${{ steps.perl_version.outputs.perl_version }}' || '' }}
${{ matrix.ubuntu == 'focal' || matrix.ubuntu == 'jammy' || matrix.ubuntu == 'lunar' && 'matthewbaggett/perl:${{ steps.perl_version.outputs.perl_version }}' || '' }}
build-args: |
${{ steps.build_args.outputs.result }}
cache-from: ${{ !env.ACT && 'type=gha' || '' }}
cache-to: ${{ !env.ACT && 'type=gha,mode=max' || '' }}
build-contexts: |
marshall:build=docker-image://ghcr.io/benzine-framework/marshall:${{ matrix.ubuntu }}