-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (60 loc) · 1.79 KB
/
build-profiles.yaml
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
name: Build FHIR Profiles
env:
NODE_VERSION: 20
DOTNET_VERSION: 8
defaults:
run:
shell: bash
on:
push:
paths:
- "**.fsh"
- "**/package.json"
- "**/sushi-config.yaml"
branches:
- dev
- main
pull_request:
branches:
- dev
- main
workflow_dispatch:
jobs:
build-profiles:
name: Build Profiles
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node (for SUSHI)
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install latest SUSHI
run: npm install -g fsh-sushi
- name: Install .NET SDK (for Firely Terminal)
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install latest Firely Terminal
run: dotnet tool install -g firely.terminal
- name: Get all FHIR packages
run: fhir restore
- name: Generate depended FHIR packages snapshots
run: fhir deps | tr ' ' '@' | xargs -I% fhir inflate --package % --snapshot --expand --force
- name: Build FHIR profiles
run: sushi .
- name: Push built FHIR profiles
run: |
if [[ `git status --porcelain` ]]; then
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.${{ github.repository_owner }}"
git fetch origin ${{ github.head_ref }}
git stash
git checkout ${{ github.head_ref }}
git pull origin ${{ github.head_ref }}
git stash pop
git add fsh-generated
git commit -m "[GEN] Generate FHIR profiles"
git push
fi