From 464c314403d691d6d0e5cc7cfc09781867b4277c 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 | 54 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fa7ad0..9f2c3b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,21 @@ jobs: if: steps.check-new-release.outputs.needDeploy == 'true' run: echo 'Beginning Deploy Steps' + ############################################# + ## Form-fill the versions to the container and to `pyproject.toml` + ############################################# + - name: Update versioning in "Dockerfile" and "pyproject.toml" + if: steps.check-new-release.outputs.needDeploy == 'true' + run: | + copasiVersion=${{ steps.check-new-release.outputs.copasiVersion }} + bioSimVersion=${{ steps.check-new-release.outputs.bioSimVersion }} + + 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 + ############################################# # Create PyPI release ############################################# @@ -180,28 +195,6 @@ jobs: poetry build poetry publish --no-interaction --username __token__ --password $POETRY_PYPI_TOKEN_PYPI - ############################################# - ## Form-fill the versions to the container and to `biosimulators.json` - ############################################# - - name: Update versioning in "Dockerfile" and "biosimulators.json" - 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 - ############################################# ## 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 "biosimulators.json" + 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 #############################################