Skip to content

AMICI v0.26.0

AMICI v0.26.0 #52

Workflow file for this run

name: Deploy
on:
release:
types:
- published
jobs:
pypi:
name: Deploy PyPI
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.11"]
environment:
name: pypi
url: https://pypi.org/p/amici
permissions:
id-token: write
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Set up SWIG
uses: ./.github/actions/setup-swig
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- name: Remove direct dependencies from setup.cfg
# Remove any "git+https"-based dependencies that are not supported
# by PyPI and are only required for testing.
run: sed -i '/git+https/d' python/sdist/pyproject.toml
- name: sdist
run: scripts/buildSdist.sh
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/sdist/dist
bioSimulatorsUpdateCliAndDockerImage:
name: Release to BioSimulators
needs: pypi
runs-on: ubuntu-22.04
env:
# Owner/repository-id for the GitHub repository for the downstream command-line interface and Docker image
DOWNSTREAM_REPOSITORY: biosimulators/Biosimulators_AMICI
# Username/token to use the GitHub API to trigger an action on the GitHub repository for the downstream
# command-line interface and Docker image. Tokens can be generated at https://github.com/settings/tokens.
# The token should have the scope `repo`
GH_ISSUE_USERNAME: ${{ secrets.BIOSIMULATORS_USERNAME }}
GH_ISSUE_TOKEN: ${{ secrets.BIOSIMULATORS_TOKEN }}
steps:
- name: Trigger GitHub action that will build and release the downstream command-line interface and Docker image
run: |
PACKAGE_VERSION="${GITHUB_REF/refs\/tags\/v/}"
WORKFLOW_FILE=ci.yml
curl \
-X POST \
-u ${GH_ISSUE_USERNAME}:${GH_ISSUE_TOKEN} \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${DOWNSTREAM_REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/dispatches \
-d "{\"ref\": \"dev\", \"inputs\": {\"simulatorVersion\": \"${PACKAGE_VERSION}\", \"simulatorVersionLatest\": \"true\"}}"
dockerhub:
name: Release to Docker Hub
runs-on: ubuntu-22.04
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v4
- run: git archive -o container/amici.tar.gz --format=tar.gz HEAD
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: dweindl/amici
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: container/
dockerfile: Dockerfile
tag_semver: true
platforms: linux/amd64,linux/arm64