-
Notifications
You must be signed in to change notification settings - Fork 4
224 lines (176 loc) · 7.37 KB
/
release.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
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
218
219
220
221
222
223
224
env:
INSTALLBUILDER_DIR: ../ib
INSTALLBUILDER_URL: https://storage.googleapis.com/pollination-public/plugins/installerAssets/installbuilder-enterprise-21.12.0-windows-x64-installer.exe
name: CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Build_windows:
name: "Build for windows"
runs-on: windows-latest
continue-on-error: false
strategy:
fail-fast: true
steps:
- name: "Checkout Master Branch"
uses: actions/checkout@v3
- name: Setup MSbuild
uses: microsoft/setup-msbuild@v1.0.2
# this is for fixing semantic-release-action
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Semantic Release - dry run for getting version
if: github.ref == 'refs/heads/master'
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Set test version
shell: bash
run: |
echo "ReleaseVersion=0.0.1" >> $GITHUB_ENV
- name: Set real version
if: github.ref == 'refs/heads/master'
shell: bash
run: |
echo "ReleaseVersion=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_ENV
- name: MSBuild GH Plugin
run: |
echo ${{ env.ReleaseVersion }}
msbuild src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=${{ env.ReleaseVersion }} /restore
mkdir installer/plugin
mv src/Ironbug.Grasshopper/bin/x64/Release/* installer/plugin
mkdir installer/HVACTemplates
cp doc/HVAC_GHTemplates/* installer/HVACTemplates -r
ls installer -r
- name: Build Ironbug.Console
run: |
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Configuration=Release /p:Platform=x64 /p:TargetFramework=NET48 /p:Version=${{ env.ReleaseVersion }}
ls ./src/Ironbug.Console/bin/x64/Release/
7z a -tzip ironbug.console.win.zip ./src/Ironbug.Console/bin/x64/Release/
cp ./src/Ironbug.Console/bin/x64/Release/Ironbug.Console.exe installer/plugin
- name: Unit tests
run: |
dotnet test src\Ironbug.HVAC_Tests --arch x64
- name: Console test
run: |
echo "Test standalone console with sample model"
cp "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/FourOfficeBuilding.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test.osm"
./src/Ironbug.Console/bin/x64/Release/Ironbug.Console.exe "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/Sys01_PTAC_AllElec.json"
echo "Test console with GH plugin"
mkdir "C:/Program Files/ladybug_tools/openstudio/CSharp/openstudio"
cp ./src/Ironbug.Console/bin/x64/Release/openstudio* "C:/Program Files/ladybug_tools/openstudio/CSharp/openstudio"
cp "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/FourOfficeBuilding.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test2.osm"
./src/Ironbug.Console/bin/x64/Release/Ironbug.Console.exe "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test2.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/Sys01_PTAC_AllElec.json"
- name: zip plugin
shell: bash
run: |
mkdir ./ironbug
cp ./installer/plugin/* ./ironbug -r
cp ./installer/HVACTemplates ./ironbug -r
7z a -tzip ironbug.zip ./ironbug
ls
- name: Install the InstalBuilder
shell: bash
env:
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }}
run: |
curl -L ${{ env.INSTALLBUILDER_URL }} --output ib.exe
./ib.exe --mode unattended --prefix ${{ env.INSTALLBUILDER_DIR }}
${{ env.INSTALLBUILDER_DIR }}/bin/builder-cli.exe --version
echo "$IB_LICENSE" > lic.xml
- name: Create installer package
shell: bash
run: |
${{ env.INSTALLBUILDER_DIR }}/bin/builder-cli.exe build installer/Ironbug.xml \
--license lic.xml \
--setvars project.outputDirectory=$(pwd) \
--setvars project.version=${{ env.ReleaseVersion }} \
--verbose
cp ./*-installer.exe ./installer.exe
ls -l
- name: Upload Installer
uses: actions/upload-artifact@v3
with:
name: windows
path: |
ironbug.zip
installer.exe
ironbug.console.win.zip
Build_ubuntu:
name: "Build for ubuntu"
runs-on: ubuntu-latest
steps:
- name: "Checkout Master Branch"
uses: actions/checkout@v3
- name: Unit tests
run: |
cd ./src/Ironbug.HVAC_Tests
dotnet restore Ironbug.HVAC_Tests.csproj
dotnet test Ironbug.HVAC_Tests.csproj --arch x64
ls
# this is for fixing semantic-release-action
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Semantic Release - dry run for getting version
if: github.ref == 'refs/heads/master'
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Set test version
shell: bash
run: |
echo "ReleaseVersion=0.0.1" >> $GITHUB_ENV
- name: Set real version
if: github.ref == 'refs/heads/master'
shell: bash
run: |
echo "ReleaseVersion=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_ENV
- name: Build
run: |
dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj -a x64 /p:Configuration=Release /p:TargetFramework=NET7 /p:Version=${{ env.ReleaseVersion }}
ls ./src/Ironbug.Console/bin/Release/linux-x64
zip -r ironbug.console.linux.zip ./src/Ironbug.Console/bin/Release/linux-x64
- name: Console test
run: |
echo "Test standalone console with sample model"
cp "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/FourOfficeBuilding.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test.osm"
./src/Ironbug.Console/bin/Release/linux-x64/Ironbug.Console "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/test.osm" "./src/Ironbug.HVAC_Tests/TestSource/Integration Testing/Sys01_PTAC_AllElec.json"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: linux
path: ironbug.console.linux.zip
release:
name: deploy installers
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [Build_windows, Build_ubuntu]
steps:
- name: "Checkout Master Branch"
uses: actions/checkout@v3
- name: Download all installers
uses: actions/download-artifact@v3
- name: list files
run: |
cp ./windows/* .
cp ./linux/* .
ls -l
- uses: actions/setup-node@v3
if: github.ref == 'refs/heads/master'
with:
node-version: 14
- uses: cycjimmy/semantic-release-action@v3
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}