forked from IDEMSInternational/R-Instat
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (172 loc) · 6.98 KB
/
CreateInstaller.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: Create 32 bit and 64 bit Installers
on:
workflow_dispatch:
inputs:
major_version:
description: 'Major Version'
required: true
minor_version:
description: 'Minor Version'
required: true
revision_no:
description: 'Revision'
required: true
jobs:
build:
# running on 2019 so that .NET version 4.5 and lower can be used
runs-on: windows-2019
# set variables
env:
Solution_Name: Instat.sln
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# check out r-instat
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
# set up and restore NuGet packages
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet
run: nuget restore $env:Solution_Name
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=Release
# increment build number
- name: Generate build number
uses: einaregilsson/build-number@v3
with:
token: ${{secrets.github_token}}
#update version numbers in assembley
- name: set-version-assemblyinfo
uses: dannevesdantas/[email protected]
with:
# Folder location to search for AssemblyInfo.cs/.vb files
path: instat\My Project\AssemblyInfo.vb
# optional, default is ${{ github.workspace }}
# Version number to set on [AssemblyVersion] and [AssemblyFileVersion] attributes of AssemblyInfo.cs/.vb files
version: "${{ inputs.major_version }}.${{ inputs.minor_version }}.${{ inputs.revision_no }}.${env:BUILD_NUMBER}"
# Create the app package by building and packaging the Windows Application Packaging project
# 32 bit
- name: Create the app package 32bit
run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform=x86 /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
env:
Appx_Bundle: Always
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
# Create the app package by building and packaging the Windows Application Packaging project
# 64bit
- name: Create the app package 64 bit
run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform=x64 /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
env:
Appx_Bundle: Always
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
# Build 32 bit installer without R
- name: Building the installer 32bit - No R
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_32bit.iss"
shell: cmd
# upload 32 bit installer without R
- name: Upload the 32 bit installer as an artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "Output/"
name: rinstat32NoR
- name: Remove 32 bit without R installer
run: |
del "Output/*"
# Build 64 bit installer without R
- name: Building the installer 64bit - No R
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss"
shell: cmd
# Upload 64 bit installer without R
- name: Upload the 64 bit installer as an artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "Output/"
name: rinstat64NoR
- name: Remove 64 bit without R installer
run: |
del "Output/*"
# check out R-Instat Data
- name: Checkout Instat Data
uses: actions/checkout@v3
with:
repository: ' africanmathsinitiative/R-Instat-Data'
fetch-depth: 0
path: 'InstatData'
# Create directory and copy over InstatData (64bit)
- name: Make Library directory 64 bit
run: |
MKDIR instat\bin\x64\Release\static\Library\
- name: Copy R-Instat Data 64 bit
run: |
ROBOCOPY InstatData\data\ instat\bin\x64\Release\static\Library\ /E
continue-on-error: true
# Create directory and copy over InstatData (32bit)
- name: Make Library directory 32 bit
run: |
MKDIR instat\bin\Release\static\Library\
- name: Copy R-Instat Data 32 bit
run: |
ROBOCOPY InstatData\data\*.* instat\bin\Release\static\Library\ /E
continue-on-error: true
# check out R for R-Instat
- name: Checkout R for R-Instat
uses: actions/checkout@v3
with:
repository: 'ChrisMarsh82/R-RInstat'
fetch-depth: 0
path: 'R-RInstat'
- name: Copy R 64 bit
run: |
ROBOCOPY R-RInstat\64Bit\ instat\bin\x64\Release\static\ /E
continue-on-error: true
- name: Copy R 32 bit
run: |
ROBOCOPY R-RInstat\32Bit\ instat\bin\Release\static\ /E
continue-on-error: true
- name: Set R-tools
uses: r-windows/install-rtools@master
- name: Install R packages (64 bit)
run: |
"instat\bin\x64\Release\static\R\bin\Rscript.exe" "instat\static\InstatObject\R\InstallPackages.R"
shell: cmd
- name: Building the installer 64bit - With R
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss"
shell: cmd
- name: Upload the 64 bit installer with R as an artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "Output/"
name: rinstat64WithR-innosetup
- name: Remove 64 bit release files to free up space
run: |
Remove-Item "instat\bin\x64\Release\" -Recurse
- name: Remove 64 bit with R installer
run: |
del "Output/*"
- name: Install R packages (32 bit)
run: |
"instat\bin\Release\static\R\bin\Rscript.exe" "instat\static\InstatObject\R\InstallPackages.R"
shell: cmd
- name: Building the installer 32bit - With R
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_32bit.iss"
shell: cmd
- name: Upload the 32 bit installer with R as an artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "Output/"
name: rinstat32WithR-innosetup