Skip to content

musl build?

musl build? #55

Workflow file for this run

name: '🏦 Build'
env:
VERSION: 1.6.2
# PACKAGE_SUFFIX: '-pre.1'
PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
BUILD_TYPE: Release
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
# builds native codecs binary for all supported OSes
build-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
name: Linux x64
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-x64
- os: ubuntu-22.04
name: Linux x64 musl
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-musl-x64
cmake_options: -D CMAKE_C_FLAGS="-static -Os"
- os: ubuntu-20.04
name: Linux ARM
arch: arm64
vcpkg_triplet: arm64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-arm64
no_native_tests: true
cmake_options: -D CMAKE_SYSTEM_PROCESSOR=aarch64 -D CMAKE_C_COMPILER=$(which aarch64-linux-gnu-gcc) -D CMAKE_CXX_COMPILER=$(which aarch64-linux-gnu-g++)
- os: windows-latest
name: Windows x64
arch: x64
vcpkg_triplet: x64-windows-static
vcpkg_config: Release
dotnet_rid: win-x64
# Still can't make this build
# - os: windows-latest
# arch: x86
# vcpkg_triplet: x86-windows-static
# vcpkg_config: Release
# dotnet_rid: win-x86
# cmake_options: -D CMAKE_GENERATOR_PLATFORM=x86
- os: macos-latest
name: MacOS ARM
arch: arm64
vcpkg_triplet: arm64-osx
vcpkg_config: RelWithDebInfo
dotnet_rid: osx-arm64
cmake_options: -D CMAKE_OSX_ARCHITECTURES=arm64
fail-fast: false
name: 'build: ${{ matrix.name }}'
env:
VCPKG_DEFAULT_VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_CONFIG: ${{ matrix.vcpkg_config }}
DOTNET_RID: ${{ matrix.dotnet_rid }}
NO_NATIVE_SNAPPY: ${{ matrix.no_native_snappy }}
NO_NATIVE_ZSTD: ${{ matrix.no_native_zstd }}
CMAKE_OPTIONS: ${{ matrix.cmake_options }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Linux ARM
if: runner.os == 'Linux' && matrix.arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get --yes install g++-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
- uses: friendlyanon/setup-vcpkg@v1
# seems like the absense of commit hash expects vcpkg submodule, i don't want that
with:
committish: ${{ env.VCPKG_HASH }}
# set to false to clear any cache in case of build errors
cache: false
- name: configure
run: cmake -B build -S . -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -D "CMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" -D "VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }}" ${{ env.CMAKE_OPTIONS }}
working-directory: native
- name: build
run: cmake --build build --config ${{ env.VCPKG_CONFIG }}
working-directory: native
- name: debug
run: ls -R
working-directory: native/build
- name: test
if: runner.os != 'Windows' && !matrix.no_native_tests
run: ctest
working-directory: native/build
- name: test (windows .exe)
if: runner.os == 'Windows' && !matrix.no_native_tests
run: |
ls -R
pwd
.\tests.exe
working-directory: native/build/Release
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: native-${{ matrix.dotnet_rid }}
path: |
native/ubin/**/*
if-no-files-found: error
# create a unified fat native binary
make-fat-native:
runs-on: ubuntu-latest
needs: build-native
name: '🎡 fat artifact'
steps:
- uses: actions/download-artifact@v4
with:
pattern: native-*
path: native/ubin/
merge-multiple: true
- name: debug
run: ls -R
working-directory: .
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: native-fat
compression-level: 9
if-no-files-found: error
path: |
native/ubin/**/*
test-managed:
runs-on: ${{ matrix.os }}
needs: make-fat-native
strategy:
matrix:
include:
- os: ubuntu-20.04
dotnet_rid: linux-x64
- os: ubuntu-22.04
dotnet_rid: linux-x64
- os: windows-2022
dotnet_rid: win-x64
- os: macos-latest
dotnet_rid: osx-arm64
fail-fast: false
name: 'managed test on ${{ matrix.os }}'
#env:
# LD_DEBUG: libs
# DYLD_PRINT_LIBRARIES: 1
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: native-fat
path: native/ubin/
- name: debug1
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: build
run: dotnet build managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
- name: debug2
run: ls -R
working-directory: .
- name: Test
run: dotnet test managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
build-managed:
needs: make-fat-native
runs-on: ubuntu-latest
name: 'Build managed + nuget'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: native-fat
path: native/ubin/
- name: debug
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build
run: dotnet build managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
- name: version
run: echo $VERSION >> docs/version.txt
- name: 🔢 prep release notes
run: |
grep -m 2 -B 1000 '^## ' docs/release-notes.md | tail -n +3 | head -n -2 > docs/version-notes.md
cat docs/version-notes.md
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: managed
compression-level: 9
if-no-files-found: error
path: |
managed/IronCompress/bin/Release/**/*nupkg
docs/release-notes.md
docs/version-notes.md
docs/version.txt