Skip to content

Commit

Permalink
Added replacement for pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Sep 22, 2024
1 parent 02b35ff commit 62c9fc1
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#############################################
Expand Down Expand Up @@ -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
#############################################
Expand Down

0 comments on commit 62c9fc1

Please sign in to comment.