From 31527de9dbd05a045e3ba66b8f4313bc3e6f70bd Mon Sep 17 00:00:00 2001 From: Wojciech Jarosz Date: Mon, 17 May 2021 17:50:10 -0400 Subject: [PATCH] Develop (#28) --- .github/workflows/ci-mac.yml | 19 +------ .github/workflows/ci-windows.yml | 10 +--- .github/workflows/release.yml | 91 ++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index d9a4636..d8df73c 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -51,15 +51,6 @@ jobs: path: | ${{github.workspace}}/build-metal/HDRView-Metal.dmg - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: ${{github.workspace}}/build-metal/HDRView-Metal.dmg - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - build_macos_opengl: name: Build on macOS (OpenGL backend) runs-on: macos-latest @@ -97,12 +88,4 @@ jobs: with: name: HDRView (OpenGL).dmg path: | - ${{github.workspace}}/build-opengl/HDRView-OpenGL.dmg - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: ${{github.workspace}}/build-opengl/HDRView-OpenGL.dmg - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + ${{github.workspace}}/build-opengl/HDRView-OpenGL.dmg \ No newline at end of file diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index cc9b895..8db28a9 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -54,12 +54,4 @@ jobs: with: name: HDRView.exe path: | - ${{github.workspace}}/build/${{env.BUILD_TYPE}}/HDRView.exe - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/HDRView.exe - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ${{github.workspace}}/build/${{env.BUILD_TYPE}}/HDRView.exe \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..522ca8d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +name: Publish to releases + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build_macos_metal: + name: Build on macOS (Metal backend) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + + - name: Configure CMake (Metal backend) + run: | + MACOSX_DEPLOYMENT_TARGET=10.14 + cmake -B ${{github.workspace}}/build-metal -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNANOGUI_BACKEND=Metal + cmake -B ${{github.workspace}}/build-metal -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNANOGUI_BACKEND=Metal + + - name: Build (Metal backend) + run: cmake --build ${{github.workspace}}/build-metal --parallel --config ${{env.BUILD_TYPE}} + + - name: Checking that HDRView and hdrbatch run + run: | + ${{github.workspace}}/build-metal/hdrbatch --help + ${{github.workspace}}/build-metal/HDRView.app/Contents/MacOS/HDRView --help + + - name: Installing create-dmg + run: brew install create-dmg + + - name: Creating dmg + run: | + RESULT="${{github.workspace}}/build-metal/HDRView-Metal.dmg" + test -f $RESULT && rm $RESULT + create-dmg --window-size 500 300 --icon-size 96 --volname "HDRView Mojave Installer" --app-drop-link 360 105 --icon HDRView.app 130 105 $RESULT ${{github.workspace}}/build-metal/HDRView.app + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ${{github.workspace}}/build-metal/HDRView-Metal.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + build_macos_opengl: + name: Build on macOS (OpenGL backend) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + + - name: Configure CMake (OpenGL backend) + run: | + MACOSX_DEPLOYMENT_TARGET=10.14 + cmake -B ${{github.workspace}}/build-opengl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNANOGUI_BACKEND=OpenGL + cmake -B ${{github.workspace}}/build-opengl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DNANOGUI_BACKEND=OpenGL + + - name: Build (OpenGL backend) + run: cmake --build ${{github.workspace}}/build-opengl --parallel --config ${{env.BUILD_TYPE}} + + - name: Checking that HDRView and hdrbatch run + run: | + ${{github.workspace}}/build-opengl/hdrbatch --help + ${{github.workspace}}/build-opengl/HDRView.app/Contents/MacOS/HDRView --help + + - name: Installing create-dmg + run: brew install create-dmg + + - name: Creating dmg + run: | + RESULT="${{github.workspace}}/build-opengl/HDRView-OpenGL.dmg" + test -f $RESULT && rm $RESULT + create-dmg --window-size 500 300 --icon-size 96 --volname "HDRView Mojave Installer" --app-drop-link 360 105 --icon HDRView.app 130 105 $RESULT ${{github.workspace}}/build-opengl/HDRView.app + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ${{github.workspace}}/build-opengl/HDRView-OpenGL.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file