Skip to content

AMICI v0.23.1

AMICI v0.23.1 #47

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.9]
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/setup.cfg
- 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\"}}"