Build in debug mode too #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-host: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
arch-name: linuxx86-64 | |
BUILD_TYPE: Release | |
publish-type: "" | |
- os: ubuntu-22.04 | |
arch-name: linuxx86-64 | |
BUILD_TYPE: Debug | |
publish-type: "debug" | |
runs-on: ${{ matrix.os }} | |
name: "mrcal-jni - Build - ${{ matrix.arch-name }}/${{matrix.publish-type}}" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --tags --force | |
- run: git describe --tags | |
- name: Install Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
- name: Install deps | |
run: | | |
sudo bash -c "echo 'deb [trusted=yes] http://mrcal.secretsauce.net/packages/jammy/public/ jammy main' >> /etc/apt/sources.list" | |
sudo apt update | |
sudo apt-get install -y cmake gcc g++ mrbuild libsuitesparse-dev liblist-moreutils-perl | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: cmake -B ${{github.workspace}}/cmake_build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DOPENCV_ARCH=${{ matrix.arch-name }} | |
- name: Build shared mrcal_jni | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/cmake_build --config ${{matrix.BUILD_TYPE}} ${{ (startsWith(matrix.arch-name, 'windowx86-64') && '--config Release') || '' }} -j --target mrcal_jni | |
- name: Gradle build | |
# Build your program with the given configuration | |
run: ./gradlew build | |
- run: ./gradlew publish -PPublishType=${{ matrix.publish-type }} | |
name: Publish | |
env: | |
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} | |
if: github.event_name == 'push' | |
- uses: actions/upload-artifact@master | |
with: | |
name: libmrcal-jar-${{ matrix.arch-name }}-${{matrix.BUILD_TYPE}} | |
path: | | |
${{ github.workspace }}/build/libs/*.jar | |
build-raspi: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- BUILD_TYPE: Release | |
publish-type: "" | |
- BUILD_TYPE: Debug | |
publish-type: "debug" | |
name: "mrcal-jni - Build - ${{ matrix.BUILD_TYPE }}/${{ matrix.publish-type }}" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --tags --force | |
- run: git describe --tags | |
- uses: pguyot/arm-runner-action@v2 | |
with: | |
base_image: raspios_lite_arm64:latest | |
cpu: cortex-a7 | |
image_additional_mb: 2500 | |
bind_mount_repository: true | |
commands: | | |
sudo bash -c "echo 'deb [trusted=yes] http://mrcal.secretsauce.net/packages/jammy/public/ jammy main' >> /etc/apt/sources.list" | |
sudo apt update | |
sudo apt install cmake default-jdk default-jre git gcc g++ libmrcal-dev mrbuild libsuitesparse-dev liblist-moreutils-perl -y | |
cmake -B cmake_build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DOPENCV_ARCH=linuxarm64 | |
cmake --build cmake_build --config ${{matrix.BUILD_TYPE}} -j --target mrcal_jni | |
- run: | | |
./gradlew build ${{ (startsWith(github.event_name, 'push') && 'publish') || '' }} -PArchOverride=linuxarm64 -PPublishType=${{ matrix.publish-type }} | |
env: | |
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} | |
- uses: actions/upload-artifact@v3 | |
name: Upload jar | |
with: | |
name: libmrcal-jar-pi-${{matrix.BUILD_TYPE}} | |
path: ${{ github.workspace }}/build/libs/*.jar | |
build-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- BUILD_TYPE: Release | |
publish-type: "" | |
- BUILD_TYPE: Debug | |
publish-type: "debug" | |
name: "mrcal-jni - Build Windows - ${{ matrix.BUILD_TYPE }}/${{matrix.publish-type}}" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --tags --force | |
- run: git describe --tags | |
- name: Install Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
- name: Setup anew (or from cache) vcpkg (and does not build any package) | |
uses: lukka/run-vcpkg@v11 # Always specify the specific _version_ of the | |
# action you need, `v10` in this case to stay up | |
# to date with fixes on the v11 branch. | |
with: | |
runVcpkgInstall: true | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/cmake_build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DOPENCV_ARCH=windowsx86-64 -T ClangCl -A x64 -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake" | |
- name: Build shared mrcal_jni | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/cmake_build --config ${{matrix.BUILD_TYPE}} -j --target mrcal_jni | |
- name: Gradle build | |
# Build your program with the given configuration | |
run: ./gradlew build | |
- run: ./gradlew publish -PPublishType=${{ matrix.publish-type }} | |
name: Publish | |
env: | |
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} | |
if: github.event_name == 'push' | |
- uses: actions/upload-artifact@master | |
with: | |
name: libmrcal-jar-windowsx64-${{matrix.BUILD_TYPE}} | |
path: ${{ github.workspace }}/build/libs/*.jar | |
release: | |
needs: [build-host, build-raspi] | |
runs-on: ubuntu-22.04 | |
steps: | |
# Download literally every single artifact. This also downloads client and docs, | |
# but the filtering below won't pick these up (I hope) | |
- uses: actions/download-artifact@v2 | |
- run: find | |
# Push to dev release on pushes to master | |
- uses: pyTooling/Actions/releaser@r0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: 'Dev' | |
rm: true | |
files: | | |
**/* | |
if: github.event_name == 'push' | |
# Push to actual release, if tagged | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
**/* | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |