-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (165 loc) · 6.27 KB
/
maven.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build SNAPSHOT
on: [ workflow_dispatch, push, pull_request ]
env:
JAVA_VERSION: 1.8
SERVER_ID: au-artifactory-snapshots
PYTHON_VERSION: '3.9.9'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, macos-latest, windows-latest ] # ubuntu-latest, , macos-latest
platform: [ x64 ] #x32, x64 ]
exclude:
- os: macos-latest
platform: x32
# config:
# - {
# name: "Windows Latest MinGW", artifact: "Windows-MinGW.tar.xz",
# os: windows-latest,
# build_type: "Release", cc: "mingw32-gcc.exe", cxx: "mingw32-c++.exe",
# generators: "Unix Makefiles"
# }
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: ubuntu add 32bit compiler
run: sudo apt-get update && sudo apt-get install gcc-multilib
if: matrix.platform == 'x32' && matrix.os == 'ubuntu-20.04'
- name: Set up Java x64
if: matrix.platform == 'x64'
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
architecture: x64
- name: Set up Java x32
if: matrix.platform == 'x86'
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
architecture: x32
- name: Put MSYS2_MinGW64 on PATH for windows
if: matrix.os == 'windows-latest'
# there is not yet an environment variable for this path from msys2/setup-msys2
# We need this to get a gcc 11.2 that is new enough to compile the reference FMU3
run: echo "C:\msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Maven download
run: mvn validate dependency:resolve-plugins -B --quiet
# - name: Alter path
# run: echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
- name: Maven Build x32
run: mvn -B package --file pom.xml -Pmake32
if: matrix.platform == 'x32'
- name: Maven Build x64
run: mvn -B package --file pom.xml -Pmake
if: matrix.platform == 'x64'
- name: artifact
uses: actions/upload-artifact@v2
with:
name: lib
path: |
jnifmuapi/target/classes/lib/**/libfmuapi.so
jnifmuapi/target/classes/lib/**/libfmuapi.dylib
jnifmuapi/target/classes/lib/**/fmuapi.dll
retention-days: 1
- name: artifact
uses: actions/upload-artifact@v2
with:
name: lib-test-fmus
path: |
jnifmuapi/target/fmus/**/*.so
jnifmuapi/target/fmus/**/*.dylib
jnifmuapi/target/fmus/**/*.dll
retention-days: 1
- name: List windows dependencies
if: matrix.os == 'windows-latest'
shell: bash
run: find . -name *.dll -exec echo {} \; -exec bash -c "objdump -p {} | grep 'DLL Name:'" \;
- name: artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: jvm_crash_logs
path: |
**/hs_err*
retention-days: 1
# - name: artifact
# if: always() && matrix.os == 'windows-latest'
# uses: actions/upload-artifact@v2
# with:
# name: bblog
# path: |
#
# jnifmuapi/target/fmus/*
# retention-days: 1
final:
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Environment variables
run: echo ${{ env.SERVER_ID }}
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
name: lib
path: jnifmuapi/target/classes/lib
- name: Set up Java x64
if: matrix.platform == 'x64'
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
architecture: x64
- name: Set up Java x32
if: matrix.platform == 'x86'
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
architecture: x32
- name: Deploy server
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
server-id: ${{ env.SERVER_ID }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Maven download
run: mvn validate dependency:resolve-plugins -B --quiet
- name: Maven Build Final
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
# - name: Maven Deploy
# if: github.event_name == 'push' && (github.ref != 'refs/heads/development' && github.ref != 'refs/heads/master' )
# run: mvn -P au -B deploy -Dsha1=-`git rev-parse --abbrev-ref HEAD | sed "s|/|-|g"` -Dmaven.test.skip=true -DskipITs -fae -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Prelease
# env:
# MAVEN_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
# MAVEN_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Maven Deploy SNAPSHOT to SONATYPE
if: github.ref == 'refs/heads/development'
run: mvn -B deploy -Dsha1= -Dchangelist=-SNAPSHOT -Dmaven.test.skip=true -DskipITs -fae -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Prelease
env:
MAVEN_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: upload jnifmuapi
uses: actions/upload-artifact@v2
with:
name: jnifmuapi
path: |
jnifmuapi/target/jnifmuapi-*-SNAPSHOT.jar
fmi2/target/fmi2-*-SNAPSHOT.jar
retention-days: 5