Skip to content

Commit

Permalink
Switch from qemu to runners
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Bozarth <[email protected]>
  • Loading branch information
ajbozarth committed Dec 9, 2024
1 parent 822e30f commit cfa3cfc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/openssl3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ env:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
include:
- arch: arm64
runner: oqs-arm64
- arch: x86_64
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: env.push == 'true'
with:
Expand All @@ -65,7 +65,6 @@ jobs:
with:
load: true
context: openssl3
platforms: ${{ matrix.platform }}
build-args: |
MAKE_DEFINES=-j4
${{ (inputs.build_main == 'true') && env.build-args || null }}
Expand All @@ -82,10 +81,19 @@ jobs:
with:
push: true
context: openssl3
platforms: ${{ matrix.platform }}
build-args: |
MAKE_DEFINES=-j4
${{ (inputs.build_main == 'true') && env.build-args || null }}
tags: |
ghcr.io/${{ github.repository_owner }}/openssl3:${{ inputs.release_tag || 'latest' }}
openquantumsafe/openssl3:${{ inputs.release_tag || 'latest' }}
ghcr.io/${{ github.repository_owner }}/openssl3:${{ inputs.release_tag || 'latest' }}-${{ matrix.arch }}
openquantumsafe/openssl3:${{ inputs.release_tag || 'latest' }}-${{ matrix.arch }}
push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/manifest
if: env.push == 'true'
with:
image_name: openssl3
release_tag: ${{ inputs.release_tag || 'latest' }}
41 changes: 41 additions & 0 deletions .github/workflows/push-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: push-manifest

on:
workflow_call:
inputs:
image_name:
description: "Which docker image to push to"
required: true
type: string
release_tag:
description: "Which docker tag to push to"
required: false
type: string

jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push multiarch image to ghcr.io
run: |
docker manifest create ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }} \
--amend ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}-x86_64 \
--amend ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}-arm64 &&
docker manifest push ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}
- name: Push multiarch image to DockerHub
run: |
docker manifest create openquantumsafe/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }} \
--amend openquantumsafe/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}-x86_64 \
--amend openquantumsafe/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}-arm64 &&
docker manifest push openquantumsafe/${{ inputs.image_name }}:${{ inputs.release_tag || 'latest' }}

0 comments on commit cfa3cfc

Please sign in to comment.