Skip to content

Merge branch 'development' into add-serializeFMUstate-to-fmi2 #273

Merge branch 'development' into add-serializeFMUstate-to-fmi2

Merge branch 'development' into add-serializeFMUstate-to-fmi2 #273

Workflow file for this run

# 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: ossrh
PYTHON_VERSION: '3.12.1'
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: List linux dependencies
if: matrix.os == 'ubuntu-20.04'
shell: bash
run: find . -name *.so -exec echo {} \; -exec ldd {} \;
- name: List macos dependencies
if: matrix.os == 'macos-latest'
shell: bash
run: find . -name *.dylib -exec echo {} \; -exec otool -L {} \;
- 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: Download all workflow run test artifacts
uses: actions/download-artifact@v2
with:
name: lib-test-fmus
path: jnifmuapi/target/fmus
- 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
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- 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 -Pmake
# - 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.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_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
- name: upload test fmus
uses: actions/upload-artifact@v2
with:
name: test-fmus
path: |
jnifmuapi/target/fmus/**/*.fmu
retention-days: 5