1
+ name : Prepare OpenEMS Release
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " *.*.*"
7
+
8
+ jobs :
9
+ build-java :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v3
13
+
14
+ - name : Setup Java 17
15
+ uses : actions/setup-java@v3
16
+ with :
17
+ distribution : ' temurin'
18
+ java-version : ' 17'
19
+ cache : gradle
20
+
21
+ - uses : kiancross/checkstyle-annotations-action@v1
22
+
23
+ - name : Validate BackendApp.bndrun and EdgeApp.bndrun
24
+ run : git diff --exit-code io.openems.backend.application/BackendApp.bndrun io.openems.edge.application/EdgeApp.bndrun
25
+
26
+ - name : Clean Edge+Backend assets
27
+ run : ./gradlew cleanEdge cleanBackend
28
+
29
+ - name : Prepare Edge+Backend assets
30
+ run : ./gradlew buildEdge buildBackend
31
+
32
+ - name : Save build-artifacts
33
+ uses : actions/upload-artifact@v3
34
+ with :
35
+ name : build-artifacts
36
+ path : |
37
+ build/openems-edge.jar
38
+ build/openems-backend.jar
39
+
40
+ build-ui :
41
+ runs-on : ubuntu-latest
42
+ steps :
43
+ - uses : actions/checkout@v3
44
+
45
+ - name : Setup Node.js
46
+ uses : actions/setup-node@v3
47
+ with :
48
+ node-version : ' 16'
49
+
50
+ - name : Setup Cache for Node.js
51
+ uses : actions/cache@v3
52
+ with :
53
+ path : |
54
+ ~/.npm
55
+ ~/.ng
56
+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
57
+ restore-keys : ${{ runner.os }}-node-
58
+
59
+ - name : Build OpenEMS UI
60
+ run : |
61
+ cd ui
62
+ npm install
63
+ npm ci --prefer-offline --cache ~/.npm
64
+ node_modules/.bin/ng config cli.cache.path "~/.ng"
65
+ node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
66
+
67
+ - name : Prepare UI asset
68
+ run : |
69
+ mkdir build
70
+ cd ui/target
71
+ zip -r ../../build/openems-ui.zip ./*
72
+
73
+ - name : Save build-artifacts
74
+ uses : actions/upload-artifact@v3
75
+ with :
76
+ name : build-artifacts
77
+ path : build/openems-ui.zip
78
+
79
+ release :
80
+ runs-on : ubuntu-latest
81
+ needs : [build-java, build-ui]
82
+ steps :
83
+ - name : Load build-artifacts
84
+ uses : actions/download-artifact@v3
85
+ with :
86
+ name : build-artifacts
87
+ path : build
88
+
89
+ - name : Create draft Release
90
+ uses : softprops/action-gh-release@v1
91
+ with :
92
+ draft : true
93
+ files : |
94
+ build/openems-edge.jar
95
+ build/openems-backend.jar
96
+ build/openems-ui.zip
0 commit comments