@@ -39,17 +39,22 @@ jobs:
3939 build :
4040 needs : [test-pfcon, test-cube]
4141 runs-on : ubuntu-24.04
42+ env :
43+ PIXI_COLOR : always
4244 steps :
43- - uses : actions/checkout@v4
45+ - name : Checkout
46+ uses : actions/checkout@v4
47+ - name : Install micromamba
48+ uses : mamba-org/setup-micromamba@v2
49+ with :
50+ cache-downloads : true
4451 - name : Install pixi
45- id : install-pixi
46- if : startsWith(github.ref, 'refs/tags/v')
4752 uses :
prefix-dev/[email protected] 4853 with :
4954 pixi-version : v0.38.0
5055 run-install : false
5156 - name : Set version
52- if : steps.install-pixi.outcome == 'success'
57+ if : startsWith(github.ref, 'refs/tags/v')
5358 run : |
5459 ref_name='${{ github.ref_name }}'
5560 version_number="${ref_name:1}"
6772 type=pep440,pattern={{version}}
6873 type=pep440,pattern={{major}}.{{minor}}
6974 type=raw,value=latest,enable={{is_default_branch}}
75+
76+ # pixi and micromamba don't have ppc64le images available, so to build
77+ # images for ppc64le, we create conda environments using micromamba
78+ # which are then copied into the container images. This also happens
79+ # to be more efficient than running a package manager during docker
80+ # build using QEMU.
81+ - name : Export conda-explicit-spec
82+ run : pixi project export conda-explicit-spec --frozen --ignore-pypi-errors conda-specs
83+ - name : Create env for linux/amd64
84+ run : micromamba create --platform linux-64 --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-64_conda_spec.txt -p ./envs/linux/amd64
85+ - name : Create env for linux/arm64
86+ run : micromamba create --platform linux-aarch64 --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-aarch64_conda_spec.txt -p ./envs/linux/arm64
87+ - name : Create env for linux/ppc64le
88+ run : micromamba create --platform linux-ppc64le --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-ppc64le_conda_spec.txt -p ./envs/linux/ppc64le
89+ - name : Build wheel
90+ run : pixi run build
91+
7092 - uses : docker/setup-qemu-action@v3
7193 - uses : docker/setup-buildx-action@v3
7294 - name : Login to DockerHub
@@ -84,15 +106,13 @@ jobs:
84106 registry : ghcr.io
85107 username : ${{ github.repository_owner }}
86108 password : ${{ secrets.GITHUB_TOKEN }}
87-
88109 - name : Build and push
89110 uses : docker/build-push-action@v6
90111 with :
91- build-args : ENVIRONMENT=prod
92112 push : ${{ steps.login-dockerhub.outcome == 'success' && steps.login-ghcr.outcome == 'success' }}
93113 context : .
94- file : ./Dockerfile
95- platforms : linux/amd64,linux/arm64
114+ file : ./prod. Dockerfile
115+ platforms : linux/amd64,linux/arm64,linux/ppc64le
96116 tags : ${{ steps.meta.outputs.tags }}
97117 labels : ${{ steps.meta.outputs.labels }}
98118 cache-from : type=gha
0 commit comments