diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 89708906..3e2d0ca7 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -23,6 +23,8 @@ on: description: 'Force full rebuild (no cache)' type: boolean default: false + release: + types: [published] jobs: build-and-push: @@ -35,11 +37,23 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Extract branch name - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + #- name: Extract branch name + # run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/underworldcode/underworld3 + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} - name: Login to GHCR uses: docker/login-action@v3 @@ -54,8 +68,12 @@ jobs: context: . push: true file: container/Containerfile - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 no-cache: ${{ inputs.force_rebuild || false }} - tags: | - ghcr.io/underworldcode/underworld3:${{ env.BRANCH }} - ghcr.io/underworldcode/underworld3:latest + build-args: | + SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.meta.outputs.version }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + # tags: | + # ghcr.io/underworldcode/underworld3:${{ env.BRANCH }} + # ghcr.io/underworldcode/underworld3:latest diff --git a/container/Containerfile b/container/Containerfile index e4233f8e..c586c03d 100644 --- a/container/Containerfile +++ b/container/Containerfile @@ -37,16 +37,21 @@ RUN micromamba install -y -v -n base -f /tmp/env.yaml && \ # activate mamba env during podman build ARG MAMBA_DOCKERFILE_ACTIVATE=1 -# pyvista - taken from pyvista docker files +# pyvista - vtk-osmesa only available for amd64; arm64 falls back to conda-forge vtk # see https://github.com/pyvista/pyvista/tree/main/docker -RUN pip install --no-cache-dir --extra-index-url https://wheels.vtk.org vtk-osmesa +ARG TARGETARCH +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + pip install --no-cache-dir --extra-index-url https://wheels.vtk.org vtk-osmesa; \ + fi # install UW3 COPY --chown=$MAMBA_USER:$MAMBA_USER \ --exclude=**/.git \ . /home/$MAMBA_USER/underworld3 WORKDIR /home/$MAMBA_USER/underworld3 -RUN pip install --no-build-isolation --no-cache-dir . +ARG SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0+unknown +RUN SETUPTOOLS_SCM_PRETEND_VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION} \ + pip install --no-build-isolation --no-cache-dir . # allow jupyterlab for ipyvtk ENV PYVISTA_OFF_SCREEN=true diff --git a/src/underworld3/_version.py b/src/underworld3/_version.py deleted file mode 100644 index 51fa7207..00000000 --- a/src/underworld3/_version.py +++ /dev/null @@ -1,2 +0,0 @@ -## On initial, official release, let __version__ for underworld3 move to 3.0 (of underworld) -__version__ = "0.99.0b"