-
Notifications
You must be signed in to change notification settings - Fork 3
166 lines (139 loc) · 4.44 KB
/
mrd_build.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build
on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
branches: [main]
workflow_dispatch:
env:
# Increase this to manually reset the conda environment cache
CONDA_CACHE_NUMBER: 0
YARDL_VERSION: 0.6.1
defaults:
run:
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: bash -el {0}
jobs:
build:
name: Build and Test C++, Python, MATLAB SDKs
runs-on: ubuntu-latest
strategy:
matrix:
cppVersion: [17, 20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Build Environment
uses: ./.github/actions/configure-mrd-build-environment
- name: Build and Test
run: just cpp_version=${{ matrix.cppVersion }} matlab=enabled validate-with-no-changes
- name: Package MATLAB toolbox
run: just build-matlab-toolbox
- name: Store MATLAB Toolbox
uses: actions/upload-artifact@v4
with:
name: matlab-toolbox
path: matlab/release/mrd*.mltbx
overwrite: true
- name: Generate CMake FetchContent source archive
run: just build-cmake-fetch-src
- name: Store CMake FetchContent source archive
uses: actions/upload-artifact@v4
with:
name: mrd-cmake-src
path: mrd-cmake-src*.tar.gz
overwrite: true
docker:
name: Build and Test Docker images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and test Docker images
run: |
./docker/build-images.sh
./docker/test-docker-images.sh
publishDocs:
name: Publish Documentation
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ismrmrd/mrd'
needs: [build, docker]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up just command runner
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6
- name: Build static page
run: just build-docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/.vitepress/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
name: Publish Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build, docker]
runs-on: ubuntu-latest
environment:
name: github-release
url: https://github.com/ismrmrd/mrd/releases
permissions:
contents: write
packages: write
steps:
- name: Retrieve MATLAB Toolbox
uses: actions/download-artifact@v4
with:
name: matlab-toolbox
- name: Retrieve CMake FetchContent source archive
uses: actions/download-artifact@v4
with:
name: mrd-cmake-src
- name: Generate Checksums
run: |
sha256sum mrd*.mltbx > sha256-checksums.txt
sha256sum mrd-cmake-src*.tar.gz >> sha256-checksums.txt
- name: Publish Artifacts
uses: softprops/action-gh-release@v2
with:
files: |
sha256-checksums.txt
mrd-cmake-src*.tar.gz
mrd*.mltbx
fail_on_unmatched_files: true
body: |
See also:
- [MRD Conda C++ SDK](https://anaconda.org/ismrmrd/mrd)
- [MRD Conda Python SDK](https://anaconda.org/ismrmrd/mrd-python)
- [PyPi](https://pypi.org/project/mrd-python/)
- [Docker image](https://ghcr.io/ismrmrd/mrd-tools)
append_body: true
- name: Log into ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Push Docker images
run: ./docker/build-images.sh --tag "${GITHUB_REF_NAME}" --push