2024.11.0 #186
Workflow file for this run
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: "JH Publish" | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- master-jethub | |
jobs: | |
publish: | |
name: Publish builder | |
runs-on: ${{ vars.RUNNER }} | |
strategy: | |
fail-fast: False | |
matrix: | |
abi: ["cp312", "cp313"] | |
tag: ["musllinux_1_2"] | |
arch: ["aarch64", "armhf", "armv7", "amd64", "i386"] | |
include: | |
- abi: cp312 | |
tag: musllinux_1_2 | |
base: 3.12-alpine3.20 | |
- abi: cp313 | |
tag: musllinux_1_2 | |
base: 3.13-alpine3.20 | |
steps: | |
- name: Checkout the repository | |
uses: actions/[email protected] | |
- shell: bash | |
id: info | |
run: | | |
declare -a docker | |
name="ghcr.io/jethub-homeassistant/wheels/${{ matrix.arch }}/${{ matrix.tag }}/${{ matrix.abi }}" | |
version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}' ) | |
if [ "${version}" = "master" ]; then | |
version=dev | |
fi | |
base="ghcr.io/jethub-homeassistant/${{ matrix.arch }}-base-python:${{ matrix.base }}" | |
if [ "${{ matrix.arch }}" = "armhf" ]; then | |
docker+=("--build-arg QEMU_CPU=arm1176") | |
fi | |
if docker pull "$name:dev" > /dev/null 2>&1; then | |
docker+=("--cache-from $name:dev") | |
fi | |
echo "name=$name" >> $GITHUB_OUTPUT | |
echo "version=$version" >> $GITHUB_OUTPUT | |
echo "base=$base" >> $GITHUB_OUTPUT | |
echo "docker=${docker[@]}" >> $GITHUB_OUTPUT | |
- name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- shell: bash | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- shell: bash | |
run: | | |
docker build \ | |
-t ${{ steps.info.outputs.name }}:${{ steps.info.outputs.version }} \ | |
${{ steps.info.outputs.docker }} \ | |
--build-arg "BUILD_FROM=${{ steps.info.outputs.base }}" \ | |
--build-arg "BUILD_ARCH=${{ matrix.arch }}" \ | |
--build-arg "CPYTHON_ABI=${{ matrix.abi }}" \ | |
. | |
- shell: bash | |
run: | | |
docker push ${{ steps.info.outputs.name }}:${{ steps.info.outputs.version }} |