From 2d0e29039ff9551e1593436884baacf83d46bd54 Mon Sep 17 00:00:00 2001 From: Christophe Meynard Date: Thu, 30 Mar 2023 17:32:18 +0200 Subject: [PATCH] GitHub: build/publish linux/windows mmv1 binaries --- .github/workflows/cmake.yml | 44 ------------------- .github/workflows/release_bin.yml | 71 +++++++++++++++++++++++++++++++ README-GitHub-release.txt | 6 ++- 3 files changed, 75 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/cmake.yml create mode 100644 .github/workflows/release_bin.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index a8e01460f0..0000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: CMake - -on: - push: - tags: - - 'v*' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - multi_os: - strategy: - matrix: - os: [ubuntu-latest] - # os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - - name: Install Qt - run: sudo apt install qtbase5-dev - - - - name: Configure CMake - run: cmake -B build -DWITH_CCACHE=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_QT5=ON - - #- name: Build - #run: cmake --build build --config ${{env.BUILD_TYPE}} -j 4 - - - name: Build - run: make -C build install -j 4 - - - name: Package - run: bash -c "cd build && ../script_create_bin_dist.sh linux" - - - name: Upload binaries to release - uses: softprops/action-gh-release@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: build/micmac_linux.tgz - diff --git a/.github/workflows/release_bin.yml b/.github/workflows/release_bin.yml new file mode 100644 index 0000000000..30cfe060de --- /dev/null +++ b/.github/workflows/release_bin.yml @@ -0,0 +1,71 @@ +name: Build Bin + +on: + push: + tags: + - 'v*' + +jobs: + build_linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Qt + run: sudo apt install qtbase5-dev + + - name: Configure CMake + run: cmake -B build -DWITH_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_QT5=ON + + - name: Build + run: make -C build install -j 4 + + - name: Create Archive + run: bash -c "cd build && ../script_create_bin_dist.sh linux" + + - name: Upload binaries to release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: build/micmac_linux.tgz + + build_win: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + cache: true + + - name: Configure CMake + run: cmake -B build -DWITH_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_QT5=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}} + + - name: Build + run: cmake --build build --config Release --target INSTALL -j 4 + - name: Package + shell: bash + run: | + env + mkdir -p bin/platforms bin/imageformats + DEST=$(pwd)/bin + cd $Qt5_Dir/bin + cp Qt5Core.dll Qt5Gui.dll Qt5Xml.dll Qt5OpenGL.dll Qt5Widgets.dll $DEST/ + cd $Qt5_Dir/plugins + cp platforms/qwindows.dll $DEST/platforms/ + cp imageformats/*.dll $DEST/imageformats/ + cd $GITHUB_WORKSPACE + ls -lrt bin + + - name: Create Zip + run: 7z a micmac_windows.zip bin\ binaire-aux\ include\XML_MicMac\ include\XML_GEN\ include\qt + + - name: Upload binaries to release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: micmac_windows.zip + diff --git a/README-GitHub-release.txt b/README-GitHub-release.txt index 6dbf38e1a2..8192cae535 100644 --- a/README-GitHub-release.txt +++ b/README-GitHub-release.txt @@ -1,8 +1,10 @@ - To publish a release on GitHub with a compiled version of MicMac (v1, linux), + To publish a release on GitHub with a compiled version of MicMac (v1, linux/Windows), use one the two following methods: - Create a git tag starting with 'v' and then push it on GitHub ( git tag v2.01 ; git push origin --tag ) - Use GitHub Release creation feature with a new tag starting with 'v' The release Assets will contain, in addition to the source code, -a linux compiled version of micmac v1 : micmac_linux.tgz. +two compiled versions of micmac v1 : +- micmac_linux.tgz. +- micmac_windows.zip