-
Notifications
You must be signed in to change notification settings - Fork 31
97 lines (81 loc) · 2.89 KB
/
deploy_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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: 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