1
+ # Changing the workflow name will reset the run number
2
+ name : Build Nightly 12.1
3
+
4
+ on :
5
+ workflow_dispatch :
6
+ schedule :
7
+ - cron : ' 0 2 * * *'
8
+
9
+ env :
10
+ MAJOR : 12
11
+ MINOR : 1
12
+ RUN : ${{ github.run_number }}
13
+ TARGET_FRAMEWORK : net8
14
+
15
+ jobs :
16
+ get-latest-commit-timespan :
17
+ runs-on : ubuntu-latest
18
+ outputs :
19
+ LATEST_COMMIT_TIMESPAN : ${{ steps.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN}}
20
+ steps :
21
+ - name : Checkout code
22
+ uses : actions/checkout@v4
23
+ with :
24
+ fetch-depth : 0
25
+
26
+ - name : Get the previous commit timespan
27
+ id : get-latest-commit-timespan
28
+ shell : bash
29
+ run : |
30
+ commit=$(git log origin/develop -1 --format="%at")
31
+ echo $commit
32
+ now=$(date +%s)
33
+ echo $now
34
+ timespan=$[now - commit]
35
+ echo "Timespan: ${timespan}"
36
+ echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_ENV
37
+ echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_OUTPUT
38
+
39
+ build-nightly :
40
+ needs : get-latest-commit-timespan
41
+ if : needs.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN < 86400
42
+ runs-on : windows-latest
43
+ steps :
44
+ - name : Checkout code
45
+ uses : actions/checkout@v4
46
+ with :
47
+ submodules : ' true'
48
+
49
+ - name : Add msbuild to PATH
50
+ uses : microsoft/setup-msbuild@v2
51
+
52
+ - name : Restore dependencies
53
+ run : |
54
+ nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
55
+ nuget sources add -name bddhelper -source https://ci.appveyor.com/nuget/ospsuite-bddhelper
56
+ nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
57
+ nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
58
+ nuget sources add -name databinding -source https://ci.appveyor.com/nuget/ospsuite-databinding
59
+ nuget sources add -name texreporting -source https://ci.appveyor.com/nuget/ospsuite-texreporting
60
+ nuget sources add -name databinding-devexpress -source https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
61
+ nuget restore
62
+
63
+ - name : define env variables
64
+ run : |
65
+ echo "APP_VERSION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.RUN }}" | Out-File -FilePath $env:GITHUB_ENV -Append
66
+
67
+ - name : Build
68
+ run : |
69
+ rake "update_go_license[ApplicationStartup.cs, ${{ secrets.GO_DIAGRAM_KEY }}]"
70
+ msbuild PKSim.sln /p:Version=${{env.APP_VERSION}}
71
+
72
+ - name : Test
73
+ run : dotnet test .\tests\**\bin\Debug\net472\PKSim*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
74
+
75
+ - name : Create Setup
76
+ run : |
77
+ rake "create_setup[${{env.APP_VERSION}}, Debug]"
78
+ rake "create_portable_setup[${{env.APP_VERSION}}, Debug, pk-sim-portable-setup.zip]"
79
+
80
+ - name : Create R dependency artifact
81
+ run : |
82
+ pushd .
83
+ cd src\PKSimRDependencyResolution\bin\Debug\${{env.TARGET_FRAMEWORK}}
84
+ 7z.exe a pk-sim-r-dependencies.zip -x@"excludedFiles.txt" * -xr!runtimes
85
+ popd
86
+
87
+ - name : Push test log as artifact
88
+ uses : actions/upload-artifact@v4
89
+ with :
90
+ name : testLog_Windows
91
+ path : ./testLog*.html
92
+
93
+ - name : Push nightly installer as artifact
94
+ uses : actions/upload-artifact@v4
95
+ with :
96
+ name : PKSim Installer ${{env.APP_VERSION}}
97
+ path : setup\deploy\*.msi
98
+
99
+ - name : Push nightly portable as artifact
100
+ uses : actions/upload-artifact@v4
101
+ with :
102
+ name : PKSim Portable ${{env.APP_VERSION}}
103
+ path : setup\PK-Sim ${{env.APP_VERSION}}
104
+
105
+ - name : Push R dependencies as artifact
106
+ uses : actions/upload-artifact@v4
107
+ with :
108
+ name : PKSim R Dependencies
109
+ path : src\PKSimRDependencyResolution\bin\Debug\${{env.TARGET_FRAMEWORK}}\pk-sim-r-dependencies.zip
0 commit comments