From 3ce23571a590fa367293008fd2cbb2a9fd76869a Mon Sep 17 00:00:00 2001 From: Leonardo Laureti <204957+leolweb@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:35:58 +0100 Subject: [PATCH] testing automated build --- .github/workflows/auto-assign.yml | 24 +++++ .github/workflows/build-macos-intel.yml | 83 ++++++++++++++++++ .github/workflows/build-win32.yml | 101 ++++++++++++++++++++++ .github/workflows/build-win64.yml | 96 ++++++++++++++++++++ .github/workflows/test-linux-appimage.yml | 88 +++++++++++++++++++ .github/workflows/test-macos-silicon.yml | 83 ++++++++++++++++++ .github/workflows/test-user-manual.yml | 25 ++++++ .github/workflows/user-manual.yml | 43 +++++++++ scripts/build-qmake.sh | 2 +- 9 files changed, 544 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-assign.yml create mode 100644 .github/workflows/build-macos-intel.yml create mode 100644 .github/workflows/build-win32.yml create mode 100644 .github/workflows/build-win64.yml create mode 100644 .github/workflows/test-linux-appimage.yml create mode 100644 .github/workflows/test-macos-silicon.yml create mode 100644 .github/workflows/test-user-manual.yml create mode 100644 .github/workflows/user-manual.yml diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml new file mode 100644 index 00000000..1d87f8e2 --- /dev/null +++ b/.github/workflows/auto-assign.yml @@ -0,0 +1,24 @@ +name: auto-assign + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + run: + + runs-on: ubuntu-latest + + permissions: + issues: write + pull-requests: write + + steps: + - name: Auto-assign issue + uses: pozil/auto-assign-issue@v1 + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + assignees: ctlcltd + numOfAssignee: 1 diff --git a/.github/workflows/build-macos-intel.yml b/.github/workflows/build-macos-intel.yml new file mode 100644 index 00000000..f7779184 --- /dev/null +++ b/.github/workflows/build-macos-intel.yml @@ -0,0 +1,83 @@ +name: build-macos-intel + +on: + workflow_dispatch: + +jobs: + user-manual: + uses: ./.github/workflows/user-manual.yml + with: + runs-on: ubuntu-latest + + build: + + runs-on: macos-12 + needs: user-manual + + env: + BUILD_TYPE: Release + + steps: + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2-sat-editor + path: e2-sat-editor + + - name: Setup Homebrew + run: brew install cmake ninja qt6 curl + + - name: Configure CMake + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: | + export PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig" + cmake \ + -G Ninja \ + -B build \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + + - name: Build + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: cmake --build build --config ${{ env.BUILD_TYPE }} + + - name: Download user-manual artifact + uses: actions/download-artifact@v4 + with: + name: user-manual + path: user-manual + run-id: ${{ needs.user-manual.outputs.run-id }} + + - name: Deploy + working-directory: ${{github.workspace}}/e2-sat-editor/src + continue-on-error: true + run: | + DESTDIR=../AppDir ninja -C build install + cp ../dist/macos/PkgInfo.in AppDir/usr/local/e2\ SAT\ Editor.app/Contents/PkgInfo + # pre actions + QMDIR=AppDir/usr/local/e2\ SAT\ Editor.app/Contents/Resources/translations + mkdir -p "$QMDIR" + cp ../dist/translations/*.qm "$QMDIR" + cp /usr/local/opt/qt/share/qt/translations/qt_*.qm "$QMDIR" + cp /usr/local/opt/qt/share/qt/translations/qtbase_*.qm "$QMDIR" + rm -R "$QMDIR"/qt_help_*.qm + # run deploy script + bash ../scripts/deployqtmacx.sh AppDir/usr/local/e2\ SAT\ Editor.app + # package + mkdir -p ../artifact/{cli,user-manual} + cp ../dist/common/Readme.txt.in ../artifact/Readme.txt + cp COPYING ../artifact/License.txt + mv AppDir/usr/local/e2\ SAT\ Editor.app ../artifact/ + mv AppDir/usr/local/e2se-cli ../artifact/cli/ + mv "${{github.workspace}}/user-manual" ../artifact/ + + # - name: Test + # working-directory: ${{github.workspace}}/e2-sat-editor/artifact + # continue-on-error: true + # timeout-minutes: 1 + # run: | + # sudo mv /usr/local/Cellar /usr/local/Cellar.bak + # DEBUG=1 QT_QPA_PLATFORM=minimal ./e2\ SAT\ Editor.app/Contents/MacOS/e2\ SAT\ Editor + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + path: ${{github.workspace}}/e2-sat-editor/artifact diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml new file mode 100644 index 00000000..acb60198 --- /dev/null +++ b/.github/workflows/build-win32.yml @@ -0,0 +1,101 @@ +name: build-win32 + +on: + workflow_dispatch: + +jobs: + user-manual: + uses: ./.github/workflows/user-manual.yml + with: + runs-on: ubuntu-latest + + build: + + runs-on: windows-2022 + needs: user-manual + + env: + BUILD_TYPE: Release + + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2-sat-editor + path: e2-sat-editor + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW32 + pacboy: >- + cc:i cmake:i ninja:i qt5-base:i qt5-translations:i curl:i + + - name: Configure CMake + working-directory: ${{github.workspace}}/e2-sat-editor/src + shell: msys2 {0} + run: | + cmake \ + -G Ninja \ + -B build \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DWITH_QT5=ON + + - name: Build + working-directory: ${{github.workspace}}/e2-sat-editor/src + shell: msys2 {0} + run: cmake --build build --config ${{ env.BUILD_TYPE }} + + - name: Download user-manual artifact + uses: actions/download-artifact@v4 + with: + name: user-manual + path: user-manual + run-id: ${{ needs.user-manual.outputs.run-id }} + + - name: Deploy + working-directory: ${{github.workspace}}/e2-sat-editor/src + continue-on-error: true + shell: msys2 {0} + run: | + DESTDIR=../AppDir ninja -C build install + # pre actions + QMDIR="AppDir/Program Files (x86)/e2-sat-editor/bin/translations" + mkdir -p "$QMDIR" + cp ../dist/translations/*.qm "$QMDIR" + cp /mingw32/share/qt5/translations/qt_*.qm "$QMDIR" + cp /mingw32/share/qt5/translations/qtbase_*.qm "$QMDIR" + rm -R "$QMDIR"/qt_help_*.qm + # run deploy script + bash ../scripts/deployqtwin.sh "AppDir/Program Files (x86)/e2-sat-editor/bin/e2-sat-editor.exe" \ + --verbose \ + -system MINGW32 \ + -qt-version 5 \ + -modules Core,Gui,Widgets,PrintSupport \ + -plugins platforms,styles,printsupport \ + -libraries libcurl-4.dll,libcrypto-3.dll,libidn2-0.dll,libnghttp2-14.dll,libpsl-5.dll,libssh2-1.dll,libssl-3.dll,libunistring-5.dll + # post actions + rm "AppDir/Program Files (x86)/e2-sat-editor/bin/platforms/qdirect2d.dll" + # package + mkdir -p ../artifact/{cli,user-manual} + cp ../dist/common/Readme.txt.in ../artifact/Readme.txt + cp COPYING ../artifact/License.txt + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/"*.dll ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/"{platforms,styles,printsupport,translations} ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/e2-sat-editor.exe" ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/e2se-cli.exe" ../artifact/cli/ + cp ../artifact/{libgcc_s_dw2-1,libstdc++-6,libwinpthread-1}.dll ../artifact/cli/ + mv "${{github.workspace}}/user-manual" ../artifact/ + + # - name: Test + # working-directory: ${{github.workspace}}/e2-sat-editor/artifact + # continue-on-error: true + # timeout-minutes: 1 + # shell: pwsh + # run: | + # $env:DEBUG=1; $env:QT_QPA_PLATFORM=minimal; .\e2-sat-editor.exe + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + path: ${{github.workspace}}/e2-sat-editor/artifact diff --git a/.github/workflows/build-win64.yml b/.github/workflows/build-win64.yml new file mode 100644 index 00000000..80afd495 --- /dev/null +++ b/.github/workflows/build-win64.yml @@ -0,0 +1,96 @@ +name: build-win64 + +on: + workflow_dispatch: + +jobs: + user-manual: + uses: ./.github/workflows/user-manual.yml + with: + runs-on: ubuntu-latest + + build: + + runs-on: windows-2022 + needs: user-manual + + env: + BUILD_TYPE: Release + + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2-sat-editor + path: e2-sat-editor + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + pacboy: >- + cc:x cmake:x ninja:x qt6-base:x qt6-translations:x curl:x + + - name: Configure CMake + working-directory: ${{github.workspace}}/e2-sat-editor/src + shell: msys2 {0} + run: | + cmake \ + -G Ninja \ + -B build \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + + - name: Build + working-directory: ${{github.workspace}}/e2-sat-editor/src + shell: msys2 {0} + run: cmake --build build --config ${{ env.BUILD_TYPE }} + + - name: Download user-manual artifact + uses: actions/download-artifact@v4 + with: + name: user-manual + path: user-manual + run-id: ${{ needs.user-manual.outputs.run-id }} + + - name: Deploy + working-directory: ${{github.workspace}}/e2-sat-editor/src + continue-on-error: true + shell: msys2 {0} + run: | + DESTDIR=../AppDir ninja -C build install + # pre actions + QMDIR="AppDir/Program Files (x86)/e2-sat-editor/bin/translations" + mkdir -p "$QMDIR" + cp ../dist/translations/*.qm "$QMDIR" + cp /mingw64/share/qt6/translations/qt_*.qm "$QMDIR" + cp /mingw64/share/qt6/translations/qtbase_*.qm "$QMDIR" + rm -R "$QMDIR"/qt_help_*.qm + # run deploy script + bash ../scripts/deployqtwin.sh "AppDir/Program Files (x86)/e2-sat-editor/bin/e2-sat-editor.exe" \ + --verbose \ + -modules Core,Gui,Widgets,PrintSupport \ + -libraries libcurl-4.dll,libcrypto-3-x64.dll,libidn2-0.dll,libnghttp2-14.dll,libpsl-5.dll,libssh2-1.dll,libssl-3-x64.dll,libunistring-5.dll + # post actions + rm "AppDir/Program Files (x86)/e2-sat-editor/bin/platforms/qdirect2d.dll" + # package + mkdir -p ../artifact/{cli,user-manual} + cp ../dist/common/Readme.txt.in ../artifact/Readme.txt + cp COPYING ../artifact/License.txt + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/"*.dll ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/"{platforms,styles,translations} ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/e2-sat-editor.exe" ../artifact/ + mv "AppDir/Program Files (x86)/e2-sat-editor/bin/e2se-cli.exe" ../artifact/cli/ + cp ../artifact/{libgcc_s_seh-1,libstdc++-6,libwinpthread-1}.dll ../artifact/cli/ + mv "${{github.workspace}}/user-manual" ../artifact/ + + # - name: Test + # working-directory: ${{github.workspace}}/e2-sat-editor/artifact + # continue-on-error: true + # timeout-minutes: 1 + # shell: pwsh + # run: | + # $env:DEBUG=1; $env:QT_QPA_PLATFORM=minimal; .\e2-sat-editor.exe + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + path: ${{github.workspace}}/e2-sat-editor/artifact diff --git a/.github/workflows/test-linux-appimage.yml b/.github/workflows/test-linux-appimage.yml new file mode 100644 index 00000000..823c7d57 --- /dev/null +++ b/.github/workflows/test-linux-appimage.yml @@ -0,0 +1,88 @@ +name: test-linux-appimage + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-22.04 + + env: + BUILD_TYPE: Release + + steps: + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2-sat-editor + path: e2-sat-editor + + - name: Setup Aptitude + run: | + sudo apt-get install curl libcurl4-openssl-dev + sudo apt-get install qt6-base-dev qt6-translations-l10n + sudo apt-get install libgl1-mesa-dev libglvnd-dev libxcb-xkb-dev libxkbcommon-x11-dev libvulkan-dev + sudo apt-get install cmake ninja-build + + - name: Download tools + run: | + sudo apt-get install fuse wget + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + chmod +x linuxdeploy-x86_64.AppImage + chmod +x linuxdeploy-plugin-qt-x86_64.AppImage + chmod +x appimagetool-x86_64.AppImage + mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy + mv linuxdeploy-plugin-qt-x86_64.AppImage /usr/local/bin/linuxdeploy-plugin-qt + mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool + + - name: Configure CMake + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: | + cmake \ + -G Ninja \ + -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DWITHOUT_CLI=ON + + - name: Build + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: cmake --build build --config ${{ env.BUILD_TYPE }} + + - name: Deploy + working-directory: ${{github.workspace}}/e2-sat-editor/src + continue-on-error: true + run: | + DESTDIR=../AppDir ninja -C build install + # pre actions + mkdir -p AppDir/usr/share/qt/translations + cp /usr/share/qt6/translations/qt_*.qm AppDir/usr/share/qt/translations + cp /usr/share/qt6/translations/qtbase_*.qm AppDir/usr/share/qt/translations + rm -R AppDir/usr/share/qt/translations/qt_help_*.qm + rm AppDir/usr/share/applications/e2se-cli.desktop + mv AppDir/usr/share/applications/e2-sat-editor.desktop AppDir/usr/share/applications/io.github.ctlcltd.e2se.desktop + mv AppDir/usr/share/metainfo/io.github.ctlcltd.e2se.metainfo.xml AppDir/usr/share/metainfo/io.github.ctlcltd.e2se.appdata.xml + mkdir -p AppDir/usr/share/doc/e2-sat-editor + mv AppDir/usr/share/e2-sat-editor/Readme.txt.in AppDir/usr/share/doc/e2-sat-editor/readme + mv AppDir/usr/share/e2-sat-editor/COPYING AppDir/usr/share/doc/e2-sat-editor/copyright + # run linuxdeploy + export QMAKE=qmake6 + linuxdeploy --appdir AppDir --plugin qt --output appimage + # package + mv e2_SAT_Editor-x86_64.AppImage ../artifact + chmod +x ../artifact + + # - name: Test + # working-directory: ${{github.workspace}}/e2-sat-editor + # continue-on-error: true + # timeout-minutes: 1 + # run: | + # sudo mv /usr/lib/qt6 /usr/lib/qt6.bak + # DEBUG=1 QT_QPA_PLATFORM=minimal ./artifact + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + path: ${{github.workspace}}/e2-sat-editor/artifact diff --git a/.github/workflows/test-macos-silicon.yml b/.github/workflows/test-macos-silicon.yml new file mode 100644 index 00000000..8fd29f8c --- /dev/null +++ b/.github/workflows/test-macos-silicon.yml @@ -0,0 +1,83 @@ +name: test-macos-silicon + +on: + workflow_dispatch: + +jobs: + user-manual: + uses: ./.github/workflows/user-manual.yml + with: + runs-on: ubuntu-latest + + build: + + runs-on: macos-14 + needs: user-manual + + env: + BUILD_TYPE: Release + + steps: + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2-sat-editor + path: e2-sat-editor + + - name: Setup Homebrew + run: brew install cmake ninja qt6 curl + + - name: Configure CMake + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: | + export PKG_CONFIG_PATH="/opt/homebrew/opt/curl/lib/pkgconfig" + cmake \ + -G Ninja \ + -B build \ + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + + - name: Build + working-directory: ${{github.workspace}}/e2-sat-editor/src + run: cmake --build build --config ${{ env.BUILD_TYPE }} + + - name: Download user-manual artifact + uses: actions/download-artifact@v4 + with: + name: user-manual + path: user-manual + run-id: ${{ needs.user-manual.outputs.run-id }} + + - name: Deploy + working-directory: ${{github.workspace}}/e2-sat-editor/src + continue-on-error: true + run: | + DESTDIR=../AppDir ninja -C build install + cp ../dist/macos/PkgInfo.in AppDir/usr/local/e2\ SAT\ Editor.app/Contents/PkgInfo + # pre actions + QMDIR=AppDir/usr/local/e2\ SAT\ Editor.app/Contents/Resources/translations + mkdir -p "$QMDIR" + cp ../dist/translations/*.qm "$QMDIR" + cp /opt/homebrew/opt/qt/share/qt/translations/qt_*.qm "$QMDIR" + cp /opt/homebrew/opt/qt/share/qt/translations/qtbase_*.qm "$QMDIR" + rm -R "$QMDIR"/qt_help_*.qm + # run deploy script + bash ../scripts/deployqtmacx.sh AppDir/usr/local/e2\ SAT\ Editor.app + # package + mkdir -p ../artifact/{cli,user-manual} + cp ../dist/common/Readme.txt.in ../artifact/Readme.txt + cp COPYING ../artifact/License.txt + mv AppDir/usr/local/e2\ SAT\ Editor.app ../artifact/ + mv AppDir/usr/local/e2se-cli ../artifact/cli/ + mv "${{github.workspace}}/user-manual" ../artifact/ + + # - name: Test + # working-directory: ${{github.workspace}}/e2-sat-editor/artifact + # continue-on-error: true + # timeout-minutes: 1 + # run: | + # sudo mv /opt/homebrew/Cellar /opt/homebrew/Cellar.bak + # DEBUG=1 QT_QPA_PLATFORM=minimal ./e2\ SAT\ Editor.app/Contents/MacOS/e2\ SAT\ Editor + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + path: ${{github.workspace}}/e2-sat-editor/artifact diff --git a/.github/workflows/test-user-manual.yml b/.github/workflows/test-user-manual.yml new file mode 100644 index 00000000..6ac413d8 --- /dev/null +++ b/.github/workflows/test-user-manual.yml @@ -0,0 +1,25 @@ +name: test-user-manual + +on: + workflow_dispatch: + +jobs: + user-manual: + uses: ./.github/workflows/user-manual.yml + with: + runs-on: ubuntu-latest + + distributable: + + runs-on: ubuntu-latest + needs: user-manual + + steps: + - name: Download user-manual artifact + uses: actions/download-artifact@v4 + with: + name: user-manual + run-id: ${{ needs.user-manual.outputs.run-id }} + + - name: Test user-manual + run: ls diff --git a/.github/workflows/user-manual.yml b/.github/workflows/user-manual.yml new file mode 100644 index 00000000..616c9c20 --- /dev/null +++ b/.github/workflows/user-manual.yml @@ -0,0 +1,43 @@ +name: user-manual + +on: + workflow_call: + inputs: + runs-on: + type: string + default: ubuntu-latest + outputs: + run-id: + value: ${{github.run_id}} + workflow_dispatch: + inputs: + runs-on: + type: string + default: ubuntu-latest + +jobs: + build: + + runs-on: ${{ inputs.runs-on }} + + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v4 + with: + repository: ctlcltd/e2se-site + path: e2se-site + + - name: NPM install + working-directory: ${{github.workspace}}/e2se-site/src + run: npm install + + - name: Build user-manual + working-directory: ${{github.workspace}}/e2se-site/src + run: | + npm run dist.help -- --dest=${{github.workspace}}/e2se-site/out/ + + - name: Archive user-manual artifact + uses: actions/upload-artifact@v4 + with: + name: user-manual + path: ${{github.workspace}}/e2se-site/out diff --git a/scripts/build-qmake.sh b/scripts/build-qmake.sh index a4950cb3..cdc9877c 100755 --- a/scripts/build-qmake.sh +++ b/scripts/build-qmake.sh @@ -7,7 +7,7 @@ usage () { printf "%s\n\n" "Build in *ux with QMake" fi - printf "%s\n\n" "bash build-qmake-ux.sh [OPTIONS] [-q qmake] [-q qmake6] [-b debug | release]" + printf "%s\n\n" "bash build-qmake.sh [OPTIONS] [-q qmake] [-q qmake6] [-b debug | release]" printf "%s\n" "-q --qmake QMake executable." printf "%s\n" "-c --cleanup Task: cleanup" printf "%s\n" "-p --prepare Task: prepare"