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 464c314
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#############################################
Expand Down Expand Up @@ -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
#############################################
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 "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
#############################################
Expand Down

0 comments on commit 464c314

Please sign in to comment.