From 62c9fc1475cbeba6cf2690fb5fbb236df1771d23 Mon Sep 17 00:00:00 2001 From: Logan Drescher Date: Sun, 22 Sep 2024 12:36:13 -0400 Subject: [PATCH] Added replacement for pyproject.toml --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fa7ad0..1a61e41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,27 +181,20 @@ jobs: poetry publish --no-interaction --username __token__ --password $POETRY_PYPI_TOKEN_PYPI ############################################# - ## Form-fill the versions to the container and to `biosimulators.json` + ## Form-fill the versions to the container and to `pyproject.toml` ############################################# - - name: Update versioning in "Dockerfile" and "biosimulators.json" + - name: Update versioning in "Dockerfile" and "pyproject.toml" if: steps.check-new-release.outputs.needDeploy == 'true' run: | - containerLabel=${{ steps.get-docker-image-tag.outputs.dockerImageBaseUrl }}:${{ steps.get-docker-image-tag.outputs.simulatorVersion }} - docker pull $containerLabel - imageId=docker image ls | grep ${{ steps.get-docker-image-tag.outputs.dockerImageBaseUrl }} \ - grep ${{ steps.get-docker-image-tag.outputs.simulatorVersion }} | awk '{ print $3; ]' - - - dockerDigest=docker inspect --format='{{index .RepoDigests 0}}' $imageId | cut -d '@' -f 2 copasiVersion=${{ steps.check-new-release.outputs.copasiVersion }} bioSimVersion=${{ steps.check-new-release.outputs.bioSimVersion }} - sed -i -e 's/__CONTAINER_DIGEST__/${dockerDigest}/g' biosimulators.json - sed -i -e 's/__COPASI_VERSION__/${copasiVersion}/g' biosimulators.json - sed -i -E "s/ARG SIMULATOR_VERSION=([^ \n]+|\".*?\")/ARG SIMULATOR_VERSION=\"${copasiVersion}\"/" Dockerfile sed -i -E "s/ARG VERSION=([^ \n]+|\".*?\")/ARG VERSION=\"${bioSimVersion}\"/" Dockerfile + sed -i -E "s/^version\s+=\s+(\".*?\")/version = \"${bioSimVersion}\"/mg" pyproject.toml + poetry update + ############################################# ## Build and Push Docker image ############################################# @@ -251,6 +244,23 @@ jobs: docker push ${{ steps.get-docker-image-tag.outputs.dockerImageBaseUrl }}:latest fi + ############################################# + ## Form-fill the versions to "biosimulators.json" + ############################################# + - name: Update versioning in "Dockerfile" and "pyproject.toml" + if: steps.check-new-release.outputs.needDeploy == 'true' + run: | + containerLabel=${{ steps.get-docker-image-tag.outputs.dockerImageBaseUrl }}:${{ steps.get-docker-image-tag.outputs.simulatorVersion }} + docker pull $containerLabel + imageId=docker image ls | grep ${{ steps.get-docker-image-tag.outputs.dockerImageBaseUrl }} \ + grep ${{ steps.get-docker-image-tag.outputs.simulatorVersion }} | awk '{ print $3; ]' + + dockerDigest=docker inspect --format='{{index .RepoDigests 0}}' $imageId | cut -d '@' -f 2 + copasiVersion=${{ steps.check-new-release.outputs.copasiVersion }} + + sed -i -e 's/__CONTAINER_DIGEST__/${dockerDigest}/g' biosimulators.json + sed -i -e 's/__COPASI_VERSION__/${copasiVersion}/g' biosimulators.json + ############################################# # Submit to BioSimulators registry #############################################