This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
Build cross openssl images #128
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: 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: 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: armv7-unknown-linux-gnueabihf | |
build_combo: linux-armv4 | |
- target: armv7-unknown-linux-musleabihf | |
build_combo: linux-armv4 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Setup Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker Login | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v3 | |
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@v5 | |
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 }} |