diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index 9dc06d0..a7d9bfc 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -3,7 +3,7 @@ name: Formage Container Image CI on: push: branches: [ "main","dev" ] - tags: 'v.*.*' + tags: 'v*.*' jobs: @@ -16,6 +16,7 @@ jobs: strategy: matrix: python_version: ["3.12", "3.13"] + pyfvs_version: ["main","dev","0.3.4"] steps: - name: Checkout repository @@ -32,7 +33,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/${{ github.repository }}-py${{ matrix.python_version }} + images: ghcr.io/${{ github.repository }}-py${{ matrix.python_version }}-pyfvs${{ matrix.pyfvs_version }} - name: Build and push Docker image uses: docker/build-push-action@v5 @@ -44,4 +45,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - PYTHON_VER=${{ matrix.python_version }} \ No newline at end of file + PYTHON_VER=${{ matrix.python_version }} + PYFVS_VER=${{ matrix.pyfvs_version }} \ No newline at end of file diff --git a/README.md b/README.md index 875f53d..12dd20e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ Forest Modeling Container Image Combines multiple packages used for forest modeling # Packages Included -PyFVS (main)[https://github.com/forest-modeling/PyFVS] -PyNVEL (main)[https://github.com/forest-modeling/PyNVEL] -PySiteIndex (main)[https://github.com/forest-modeling/PySiteIndex] +PyFVS - [main](https://github.com/forest-modeling/PyFVS),[v0.3.3](https://github.com/forest-modeling/PyFVS/releases/tag/v0.3.3),[v0.3.4](https://github.com/forest-modeling/PyFVS/releases/tag/v0.3.4),[dev](https://github.com/forest-modeling/PyFVS/tree/dev) +PyNVEL [main](https://github.com/forest-modeling/PyNVEL) +PySiteIndex [main](https://github.com/forest-modeling/PySiteIndex) diff --git a/formage.containerfile b/formage.containerfile index 4fc4631..e3f7721 100644 --- a/formage.containerfile +++ b/formage.containerfile @@ -4,14 +4,13 @@ ARG PYTHON_VER FROM python:${PYTHON_VER}-$OS_TAG AS builder -ARG PYFVS_VERSION=main +ARG PYFVS_VER ARG PYNVEL_VERSION=main ARG PYSITEINDEX_VERSION=main # FVS variant libraries to build, must be lowercase ARG FVS_VARIANTS=pn,wc,ca,so,op,oc,ec,nc,bm,ie,ci,ak,ws #,em,tt,cr,ut,ls,cs,sn,ne # ARG FVS_VARIANTS=pn,wc,ca,so -# ARG PYFVS_VERSION=v0.3.2 ARG ROOT=/formage @@ -43,7 +42,11 @@ RUN git clone https://github.com/forest-modeling/PyFVS.git --recurse-submodules WORKDIR "$ROOT/PyFVS" -RUN git checkout "${PYFVS_VERSION}" +# RUN if [[ "$PYFVS_VER" =~ ^[0-9] ]]; then git checkout "v$PYFVS_VER"; else git checkout "$PYFVS_VER"; fi +RUN if echo "$PYFVS_VER" | grep -q '^[0-9]'; \ + then git checkout --recurse-submodules "v$PYFVS_VER"; \ + else git checkout --recurse-submodules "$PYFVS_VER"; \ + fi RUN python -m pip install . \ --verbose --no-build-isolation \ --config-settings=setup-args="-Dfvsvariants=$FVS_VARIANTS"