CD Build Multiarch OpenSSL BuildEnv Docker Image #217
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
name: CD Build Multiarch OpenSSL BuildEnv Docker Image | |
on: | |
workflow_run: | |
workflows: [CD Check OpenSSL Release] | |
types: | |
- completed | |
env: | |
DOCKERHUB_SLUG: "madnuttah/openssl-buildenv" | |
jobs: | |
buildvars: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
outputs: | |
BUILDENV_BUILD_DATE: ${{ steps.IMPORT_BUILDVARS.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION: ${{ steps.IMPORT_BUILDVARS.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION: ${{ steps.IMPORT_BUILDVARS.outputs.OPENSSL_BUILDENV_VERSION }} | |
OPENSSL_SHA256: ${{ steps.IMPORT_BUILDVARS.outputs.OPENSSL_SHA256 }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Import build variables from buildvars file | |
id: IMPORT_BUILDVARS | |
run: | | |
cat buildvars | grep BUILDENV_BUILD_DATE >> $GITHUB_OUTPUT | |
cat buildvars | grep OPENSSL_VERSION >> $GITHUB_OUTPUT | |
cat buildvars | grep OPENSSL_BUILDENV_VERSION >> $GITHUB_OUTPUT | |
cat buildvars | grep OPENSSL_SHA256 >> $GITHUB_OUTPUT | |
linux_386: | |
runs-on: ubuntu-latest | |
needs: buildvars | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: linux_386 | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/386 | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: | | |
OPENSSL_SHA256=${{ needs.buildvars.outputs.OPENSSL_SHA256 }} | |
BUILDENV_BUILD_DATE=${{ needs.buildvars.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION=${{ needs.buildvars.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION=${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} | |
file: ./openssl/linux_386.Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
provenance: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-386 | |
linux_arm_v6: | |
runs-on: ubuntu-latest | |
needs: buildvars | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: linux_arm_v6 | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/arm/v6 | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: | | |
OPENSSL_SHA256=${{ needs.buildvars.outputs.OPENSSL_SHA256 }} | |
BUILDENV_BUILD_DATE=${{ needs.buildvars.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION=${{ needs.buildvars.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION=${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} | |
file: ./openssl/linux_32.Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
provenance: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-armv6 | |
linux_arm_v7: | |
runs-on: ubuntu-latest | |
needs: buildvars | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: linux_arm_v7 | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/arm/v7 | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: | | |
OPENSSL_SHA256=${{ needs.buildvars.outputs.OPENSSL_SHA256 }} | |
BUILDENV_BUILD_DATE=${{ needs.buildvars.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION=${{ needs.buildvars.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION=${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} | |
file: ./openssl/linux_32.Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
provenance: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-armv7 | |
linux_arm64: | |
runs-on: ubuntu-latest | |
needs: buildvars | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: linux_arm64 | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/arm64 | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: | | |
OPENSSL_SHA256=${{ needs.buildvars.outputs.OPENSSL_SHA256 }} | |
BUILDENV_BUILD_DATE=${{ needs.buildvars.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION=${{ needs.buildvars.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION=${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} | |
file: ./openssl/linux_64.Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
provenance: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-arm64 | |
linux_amd64: | |
runs-on: ubuntu-latest | |
needs: buildvars | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: linux_amd64 | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64 | |
builder: ${{ steps.buildx.outputs.name }} | |
build-args: | | |
OPENSSL_SHA256=${{ needs.buildvars.outputs.OPENSSL_SHA256 }} | |
BUILDENV_BUILD_DATE=${{ needs.buildvars.outputs.BUILDENV_BUILD_DATE }} | |
OPENSSL_VERSION=${{ needs.buildvars.outputs.OPENSSL_VERSION }} | |
OPENSSL_BUILDENV_VERSION=${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} | |
file: ./openssl/linux_64.Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
provenance: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-amd64 | |
create-manifest-list: | |
runs-on: ubuntu-latest | |
needs: | |
- buildvars | |
- linux_386 | |
- linux_arm_v6 | |
- linux_arm_v7 | |
- linux_arm64 | |
- linux_amd64 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Login to Dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Create and push multiarch manifests | |
if: github.event_name != 'pull_request' | |
run: | | |
docker manifest create ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} \ | |
--amend ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-386 \ | |
--amend ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-arm64 \ | |
--amend ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-amd64 \ | |
--amend ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-armv6 \ | |
--amend ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }}-armv7 | |
docker manifest push ${{ env.DOCKERHUB_SLUG }}:${{ needs.buildvars.outputs.OPENSSL_BUILDENV_VERSION }} |