Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Build cross openssl images #89

Build cross openssl images

Build cross openssl images #89

Workflow file for this run

name: Build cross openssl images
on:
push:
branches: [ main ]
paths: [ .github/workflows/cross-openssl.yml, cross-openssl/** ]
pull_request:
branches: [ main ]
paths: [ .github/workflows/cross-openssl.yml, cross-openssl/** ]
workflow_dispatch:
schedule:
- cron: '0 3 * * 0'
jobs:
cross-openssl:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
build_combo: linux-x86_64
- target: x86_64-unknown-linux-musl
build_combo: linux-x86_64
- target: aarch64-unknown-linux-gnu
build_combo: linux-aarch64
- target: aarch64-unknown-linux-musl
build_combo: linux-aarch64
- target: x86_64-unknown-freebsd
build_combo: BSD-x86_64
- target: x86_64-unknown-netbsd
build_combo: BSD-x86_64
- target: x86_64-unknown-illumos
build_combo: solaris64-x86_64-gcc
- target: x86_64-sun-solaris
build_combo: solaris64-x86_64-gcc
- target: riscv64gc-unknown-linux-gnu
build_combo: linux64-riscv64
- target: powerpc64-unknown-linux-gnu
build_combo: linux-ppc64
- target: powerpc64le-unknown-linux-gnu
build_combo: linux-ppc64le
- target: s390x-unknown-linux-gnu
build_combo: linux64-s390x
- target: mips64-unknown-linux-gnuabi64
build_combo: linux64-mips64
- target: mips64-unknown-linux-muslabi64
build_combo: linux64-mips64
- target: mips64el-unknown-linux-gnuabi64
build_combo: linux64-mips64
- target: mips64el-unknown-linux-muslabi64
build_combo: linux64-mips64
- target: i686-unknown-linux-gnu
build_combo: linux-elf
- target: i686-unknown-linux-musl
build_combo: linux-elf
- target: i686-unknown-freebsd
build_combo: BSD-x86-elf
- target: armv7-unknown-linux-gnueabihf
build_combo: linux-armv4
- target: armv7-unknown-linux-musleabihf
build_combo: linux-armv4
- target: powerpc-unknown-linux-gnu
build_combo: linux-ppc
- target: mips-unknown-linux-gnu
build_combo: linux-mips32
- target: mips-unknown-linux-musl
build_combo: linux-mips32
- target: mipsel-unknown-linux-gnu
build_combo: linux-mips32
- target: mipsel-unknown-linux-musl
build_combo: linux-mips32
- target: x86_64-pc-windows-gnu
build_combo: mingw64
- target: i686-pc-windows-gnu
build_combo: mingw
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker Login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get latest openssl
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./cross-openssl
run: echo "OPENSSL_VERSION=$(gh release view -R openssl/openssl --json tagName --jq '.tagName')" >> $GITHUB_ENV
- name: Download openssl
working-directory: ./cross-openssl
run: curl --retry 3 -fsSL https://www.openssl.org/source/${{ env.OPENSSL_VERSION }}.tar.gz -o openssl.tar.gz
- name: Move openssl
working-directory: ./cross-openssl
run: |
mkdir openssl
tar -xzvf openssl.tar.gz -C openssl --strip-components=1
- name: Vars
run: |
echo "BUILD_DATE=$(date --utc)" >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: ./cross-openssl
file: ./cross-openssl/Dockerfile
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/cargo-prebuilt/cross-openssl:${{ matrix.target }}
labels: |
tech.harmless.cargo-prebuilt.name="cross-openssl"
tech.harmless.cargo-prebuilt.target="${{ matrix.target }}"
tech.harmless.cargo-prebuilt.openssl="${{ env.OPENSSL_VERSION }}"
tech.harmless.cargo-prebuilt.pull_request_build="${{ github.event_name == 'pull_request' }}"
tech.harmless.cargo-prebuilt.run_number="${{ github.run_number }}"
tech.harmless.cargo-prebuilt.repo="${{ github.repositoryUrl }}"
tech.harmless.cargo-prebuilt.build_date="${{ env.BUILD_DATE }}"
org.opencontainers.image.authors="cross-rs, harmless-tech, cargo-prebuilt"
build-args: |
TARGET=${{ matrix.target }}
BUILD_COMBO=${{ matrix.build_combo }}
platforms: linux/amd64
builder: ${{ steps.buildx.outputs.name }}