diff --git a/.github/workflows/ci-win.yml b/.github/workflows/ci-win.yml index a822b3d3a9..59415cd971 100644 --- a/.github/workflows/ci-win.yml +++ b/.github/workflows/ci-win.yml @@ -106,3 +106,43 @@ jobs: cmake --build . --target=deploy cmake --build . --target=pack working-directory: ${{runner.workspace}}/build + + - name: Archive Artifacts + uses: actions/upload-artifact@v2 + with: + name: VNote-${{env.VNOTE_VER}}-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip + path: ${{env.workspace}}/build/VNote*.zip + + - name: Archive Installer + uses: actions/upload-artifact@v2 + with: + name: VNote-${{env.VNOTE_VER}}-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.msi + path: ${{runner.workspace}}/build/VNote*.msi + + - name: Update Tag + if: github.ref == 'refs/heads/master' + shell: bash + run: | + git tag --force continuous-build ${GITHUB_SHA} + git push --force --tags + + - name: Update Continuous Build Release + if: github.ref == 'refs/heads/master' && ${{!startsWith(matrix.config.qt, '5.15')}} + uses: johnwbyrd/update-release@v1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: ${{runner.workspace}}/build/VNote*.zip + release: Continuous Build + tag: continuous-build + + - name: Release + if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]') + uses: ncipollo/release-action@v1.11.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # We need hard code here. + artifacts: "D:/a/vnote/build/VNote*.zip + commit: master + tag: v${{env.VNOTE_VER}} + allowUpdates: true + draft: true diff --git a/src/Packaging.cmake b/src/Packaging.cmake index 08201c97a4..a392c6f6ab 100644 --- a/src/Packaging.cmake +++ b/src/Packaging.cmake @@ -22,10 +22,12 @@ function(windeployqt target) # Bundle Library Files string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) - if(CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG") - set(WINDEPLOYQT_ARGS --debug) - else() - set(WINDEPLOYQT_ARGS --release) + if ((QT_DEFAULT_MAJOR_VERSION GREATER 5)) + if(CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG") + set(WINDEPLOYQT_ARGS --debug) + else() + set(WINDEPLOYQT_ARGS --release) + endif() endif() add_custom_target(deploy