Skip to content

trying win-x86

trying win-x86 #21

Workflow file for this run

name: 'Build'
env:
VERSION: 1.6.1
PACKAGE_SUFFIX: '-pre.1'
# PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
BUILD_TYPE: Release
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
# Indicates the location of the vcpkg as a Git submodule of the project repository.
#VCPKG_ROOT: ${{ github.workspace }}/vcpkg
# Tells vcpkg where binary packages are stored.
# VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
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
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-x64
- os: ubuntu-20.04
arch: arm64
vcpkg_triplet: arm64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-arm64
no_native_tests: true
- os: windows-latest
arch: x64
vcpkg_triplet: x64-windows-static
vcpkg_config: Release
dotnet_rid: win-x64
# Looks like there is no native port of Snappy for windows x86
- os: windows-latest
arch: x86
vcpkg_triplet: x86-windows-static
vcpkg_config: Release
dotnet_rid: win-x86
no_native_snappy: true
no_native_tests: true # why is there no GTest for x86?
- os: macos-latest
arch: arm64
vcpkg_triplet: arm64-osx
vcpkg_config: RelWithDebInfo
dotnet_rid: osx-arm64
fail-fast: false
name: 'build: ${{ matrix.os }} (${{ matrix.arch }})'
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_TESTS: ${{ matrix.no_native_tests }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Windows x86
if: runner.os == 'Windows' && matrix.arch == 'x86'
run: |
echo "NO_SNAPPY=1" >> $env:GITHUB_ENV
- 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
echo "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++)" >> $GITHUB_ENV
- name: OSX M1
if: runner.os == 'macOS' && matrix.arch == 'arm64'
run: |
echo "CMAKE_OPTIONS=-D CMAKE_OSX_ARCHITECTURES=arm64" >> $GITHUB_ENV
- 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: test
if: '!matrix.no_native_tests'
run: ctest
working-directory: native/build/test
- name: debug
run: ls -R
working-directory: native
- 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
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
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: 'test: ${{ 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
path: native/ubin/
- name: debug1
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v3
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
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: native
path: native/ubin/
- name: debug
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v1
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
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: managed
path: |
managed/IronCompress/bin/Release/*
publish:
needs: [test-managed, build-managed]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
environment: nuget
steps:
- uses: actions/download-artifact@v4
with:
name: managed
path: pub/managed/
- name: push to nuget.org
run: dotnet nuget push pub/managed/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: create gh release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/master'
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
files: "pub/managed/*.nupkg"
generate_release_notes: true