From 25cb7a8a7936a39f5366d3e0b9ef799804cec7fb Mon Sep 17 00:00:00 2001 From: "1537100607@qq.com" <1537100607@qq.com> Date: Sun, 4 Aug 2024 15:07:43 +0800 Subject: [PATCH] update tinyexr --- .github/workflows/build.yml | 85 ++++++++++++++++++++++++ .github/workflows/publish.yml | 119 ---------------------------------- TinyEXR.Native/tinyexr | 2 +- 3 files changed, 86 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5b1933c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,85 @@ +name: 'Build' + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + BUILD_TYPE: Release + NuGetDirectory: ${{github.workspace}}/nuget + +jobs: + build-native: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-13, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: 'Configure CMake' + run: cmake -B ${{github.workspace}}/TinyEXR.Native/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/TinyEXR.Native + - name: 'Build' + run: cmake --build ${{github.workspace}}/TinyEXR.Native/build --config ${{env.BUILD_TYPE}} + - name: 'Upload win' + if: ${{ startsWith(matrix.os, 'windows') }} + uses: actions/upload-artifact@v4 + with: + name: TinyEXR.Native.dll + if-no-files-found: error + path: TinyEXR.Native/build/Release/TinyEXR.Native.dll + - name: 'Upload linux' + if: ${{ startsWith(matrix.os, 'ubuntu') }} + uses: actions/upload-artifact@v4 + with: + name: libTinyEXR.Native.so + if-no-files-found: error + path: TinyEXR.Native/build/libTinyEXR.Native.so + - name: 'Upload macos' + if: ${{ startsWith(matrix.os, 'macos') }} + uses: actions/upload-artifact@v4 + with: + name: ${{ format('libTinyEXR.Native-{0}.dylib', matrix.os) }} + if-no-files-found: error + path: TinyEXR.Native/build/libTinyEXR.Native.dylib + + build-tinyexr-net: + name: Build TinyEXR.NET + runs-on: windows-latest + needs: [build-native] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: TinyEXR.Native.dll + path: TinyEXR.NET/Assets/runtimes/win-x64/native + - uses: actions/download-artifact@v4 + with: + name: libTinyEXR.Native.so + path: TinyEXR.NET/Assets/runtimes/linux-x64/native + - uses: actions/download-artifact@v4 + with: + name: libTinyEXR.Native-macos-13.dylib + path: TinyEXR.NET/Assets/runtimes/osx-x64/native + - uses: actions/download-artifact@v4 + with: + name: libTinyEXR.Native-macos-latest.dylib + path: TinyEXR.NET/Assets/runtimes/osx-arm64/native + - name: Rename osx-x64 + run: Rename-Item -Path ${{github.workspace}}/TinyEXR.NET/Assets/runtimes/osx-x64/native/libTinyEXR.Native-macos-13.dylib -NewName libTinyEXR.Native.dylib + - name: Rename osx-arm64 + run: Rename-Item -Path ${{github.workspace}}/TinyEXR.NET/Assets/runtimes/osx-arm64/native/libTinyEXR.Native-macos-latest.dylib -NewName libTinyEXR.Native.dylib + - name: Setup .NET + uses: actions/setup-dotnet@v4 + - name: Build + run: dotnet build ${{github.workspace}}/TinyEXR.NET --configuration Release + - name: Pack + run: dotnet pack ${{github.workspace}}/TinyEXR.NET --configuration Release --output ${{env.NuGetDirectory}} + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + path: ${{env.NuGetDirectory}}/*.nupkg diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index ee673e2..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: 'Build and publish to NuGet' - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - BUILD_TYPE: Release - NuGetDirectory: ${{github.workspace}}/nuget - -jobs: - build-native-win-x64: - name: 'Build native win-x64' - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: 'Configure CMake' - run: cmake -B ${{github.workspace}}/TinyEXR.Native/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/TinyEXR.Native - - name: 'Build' - run: cmake --build ${{github.workspace}}/TinyEXR.Native/build --config ${{env.BUILD_TYPE}} - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: TinyEXR.Native.dll - if-no-files-found: error - path: TinyEXR.Native/build/Release/TinyEXR.Native.dll - retention-days: 1 - - build-native-linux-x64: - name: Build native linux-x64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Configure CMake - run: cmake -B ${{github.workspace}}/TinyEXR.Native/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/TinyEXR.Native - - name: Build - run: cmake --build ${{github.workspace}}/TinyEXR.Native/build --config ${{env.BUILD_TYPE}} - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: libTinyEXR.Native.so - if-no-files-found: error - path: TinyEXR.Native/build/libTinyEXR.Native.so - retention-days: 1 - - build-native-osx-x64: - name: Build native osx-x64 - runs-on: macos-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Configure CMake - run: cmake -B ${{github.workspace}}/TinyEXR.Native/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/TinyEXR.Native - - name: Build - run: cmake --build ${{github.workspace}}/TinyEXR.Native/build --config ${{env.BUILD_TYPE}} - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: libTinyEXR.Native.dylib - if-no-files-found: error - path: TinyEXR.Native/build/libTinyEXR.Native.dylib - retention-days: 1 - - build-tinyexr-net: - name: Build TinyEXR.NET - runs-on: windows-latest - needs: [build-native-win-x64, build-native-linux-x64, build-native-osx-x64] - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: TinyEXR.Native.dll - path: TinyEXR.NET/Assets/runtimes/win-x64/native - - uses: actions/download-artifact@v3 - with: - name: libTinyEXR.Native.so - path: TinyEXR.NET/Assets/runtimes/linux-x64/native - - uses: actions/download-artifact@v3 - with: - name: libTinyEXR.Native.dylib - path: TinyEXR.NET/Assets/runtimes/osx-x64/native - - name: Setup .NET - uses: actions/setup-dotnet@v3 - - name: Build - run: dotnet build ${{github.workspace}}/TinyEXR.NET --configuration Release - - name: Pack - run: dotnet pack ${{github.workspace}}/TinyEXR.NET --configuration Release --output ${{env.NuGetDirectory}} - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: nupkg - if-no-files-found: error - path: ${{env.NuGetDirectory}}/*.nupkg - retention-days: 1 - - publish: - name: Publish to nuget - runs-on: windows-latest - needs: build-tinyexr-net - steps: - - uses: actions/download-artifact@v3 - with: - name: nupkg - path: ${{env.NuGetDirectory}} - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - - name: Publish NuGet package - run: | - foreach($file in (Get-ChildItem "${{env.NuGetDirectory}}" -Recurse -Include *.nupkg)) { - dotnet nuget push $file --api-key "${{secrets.NUGET_APIKEY}}" --source https://api.nuget.org/v3/index.json --skip-duplicate - } - diff --git a/TinyEXR.Native/tinyexr b/TinyEXR.Native/tinyexr index 6c8742c..5fcb4dc 160000 --- a/TinyEXR.Native/tinyexr +++ b/TinyEXR.Native/tinyexr @@ -1 +1 @@ -Subproject commit 6c8742cc8145c8f629698cd8248900990946d6b1 +Subproject commit 5fcb4dcb6e3abf96214b67e5c54db1ceec6a455c