Translated using Weblate (Chinese (Simplified Han script)) #868
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: macOS CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - stable | |
| - wip-translator | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: "${{ matrix.config.name }} | ${{ matrix.config.build_type }}" | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| config: | |
| - { | |
| name: "Intel x64", | |
| arch: "x86_64", | |
| os: macos-15-intel, | |
| osx_target: "10.12", | |
| extra_path: "/Users/StaticQt/5.14.2/bin", | |
| build_type: "Release", | |
| upload_directory: "www/macosx/", | |
| qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/qt-5-14-2-static-macosx-10-14-6.tar.bz2", qt_install_dir: "/Users/StaticQt/", | |
| qt_ver: "5.14.2", | |
| qt_dir: "/Users/StaticQt/5.14.2/bin", | |
| qt_lib_dir: "/Users/StaticQt/5.14.2/lib" | |
| } | |
| - { | |
| name: "Apple Silicon", | |
| arch: "arm64", | |
| os: macos-15, | |
| osx_target: "10.13", | |
| extra_path: "/Users/StaticQt/5.15.16/bin", | |
| build_type: "Release", | |
| upload_directory: "www/macosx/", | |
| qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/qt-5-15-16-static-macosx-15-3-1.tar.bz2", qt_install_dir: "/Users/StaticQt/", | |
| qt_ver: "5.15.16", | |
| qt_dir: "/Users/StaticQt/5.15.16/bin", | |
| qt_lib_dir: "/Users/StaticQt/5.15.16/lib" | |
| } | |
| steps: | |
| - name: Check for the upload support | |
| id: upload-check | |
| shell: bash | |
| run: | | |
| if [[ "${{ secrets.builds_login }}" != '' && \ | |
| "${{ secrets.builds_password }}" != '' && \ | |
| "${{ secrets.builds_host }}" != '' ]]; then | |
| echo "available=true" >> $GITHUB_OUTPUT; | |
| else | |
| echo "available=false" >> $GITHUB_OUTPUT; | |
| fi | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 3 | |
| submodules: recursive | |
| - uses: Wohlstand/branch-name@v1.0.1-wohl | |
| - name: Check if a pull request | |
| id: event-check | |
| shell: bash | |
| run: | | |
| if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
| echo "--- This build is a pull-request ---" | |
| echo "is_pull_request=true" >> $GITHUB_OUTPUT; | |
| else | |
| echo "--- This build is a normal branch build ---" | |
| echo "is_pull_request=false" >> $GITHUB_OUTPUT; | |
| fi | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| brew install ninja coreutils binutils gnu-sed lftp axel | |
| # cmake wget p7zip | |
| git submodule init | |
| git submodule update | |
| mkdir build-temp | |
| - name: Download Qt | |
| if: matrix.config.qt_download | |
| uses: carlosperate/download-file-action@v2 | |
| with: | |
| file-url: "${{ matrix.config.qt_download }}" | |
| file-name: build-temp/qt.tar.bz2 | |
| - name: Extract Qt | |
| if: matrix.config.qt_install_dir | |
| shell: bash | |
| run: | | |
| sudo mkdir -p "${{ matrix.config.qt_install_dir }}" | |
| sudo tar -xf build-temp/qt.tar.bz2 -C "${{ matrix.config.qt_install_dir }}" | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
| export QT_VER="${{ matrix.config.qt_ver }}" | |
| export QT_PATH="${{ matrix.config.qt_dir }}" | |
| export QT_LIB_PATH="${{ matrix.config.qt_lib_dir }}" | |
| echo "# ==============Qt paths================" > _paths.sh; | |
| echo "QT_PATH=\"/Users/StaticQt/${QT_VER}/bin/\"" >> _paths.sh; | |
| echo "QT_LIB_PATH=\"/Users/StaticQt/${QT_VER}/lib/\"" >> _paths.sh; | |
| echo "QMake=\"qmake\"" >> _paths.sh; | |
| echo "LRelease=\"lrelease\"" >> _paths.sh; | |
| echo "PGE_OSX_TARGET=${{ matrix.config.osx_target }}" >> _paths.sh; | |
| echo "" >> _paths.sh; | |
| chmod u+x _paths.sh; | |
| echo "============== _paths.sh =================" | |
| cat _paths.sh | |
| echo "==========================================" | |
| export PATH=${{ matrix.config.extra_path }}:${PATH} | |
| echo "PATH environment: ${PATH}" | |
| fi | |
| echo "=====================================" | |
| qmake --version | |
| echo "=====================================" | |
| gcc --version | |
| echo "=====================================" | |
| git --version | |
| echo "=====================================" | |
| cmake --version | |
| echo "=====================================" | |
| - name: Build | |
| shell: bash | |
| run: | | |
| if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
| BRANCH_NAME_RES="pull-request" | |
| echo "-- Pull-request detected!" | |
| else | |
| BRANCH_NAME_RES=${BRANCH_NAME} | |
| fi | |
| export PATH=${{ matrix.config.qt_dir }}:${{ matrix.config.qt_lib_dir }}:/usr/local/opt/coreutils/libexec/gnubin:${PATH} | |
| TZ=Europe/Moscow date +"%Y-%m-%d %H:%M:%S" > build-temp/build_date_${BRANCH_NAME_RES}_osx.txt | |
| ./build.sh no-pause ninja deploy deploy-pkg static-qt | |
| - name: Rename package | |
| shell: bash | |
| run: | | |
| mv ./bin-cmake-release/pge-project-${BRANCH_NAME}-macosx.pkg ./bin-cmake-release/pge-project-${BRANCH_NAME}-macosx-${{ matrix.config.arch }}.pkg | |
| # mv ./bin-cmake-release/pge-project-${BRANCH_NAME}-macosx.dmg ./bin-cmake-release/pge-project-${BRANCH_NAME}-macosx-${{ matrix.config.arch }}.dmg | |
| - name: Deploy to builds.wohlsoft.ru | |
| if: success() && github.event_name != 'pull_request' && steps.event-check.outputs.is_pull_request == 'false' && steps.upload-check.outputs.available == 'true' | |
| shell: bash | |
| run: | | |
| if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
| export PATH=${{ matrix.config.extra_path }}:${PATH} | |
| fi | |
| if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
| BRANCH_NAME_RES="pull-request" | |
| echo "-- Pull-request detected!" | |
| else | |
| BRANCH_NAME_RES=${BRANCH_NAME} | |
| fi | |
| UPLOAD_LIST="set ssl:verify-certificate no;" | |
| # for q in ./bin-cmake-release/*.dmg; do | |
| # UPLOAD_LIST="${UPLOAD_LIST} put -O ${{ matrix.config.upload_directory }} $q;" | |
| # done | |
| for q in ./bin-cmake-release/*.pkg; do | |
| UPLOAD_LIST="${UPLOAD_LIST} put -O ${{ matrix.config.upload_directory }} $q;" | |
| done | |
| UPLOAD_LIST="${UPLOAD_LIST} put -O ./www/_versions build-temp/build_date_${BRANCH_NAME_RES}_osx.txt;" | |
| lftp -e "${UPLOAD_LIST} exit" -u ${{ secrets.builds_login }},${{ secrets.builds_password }} ${{ secrets.builds_host }} | |
| - name: List Build Directory | |
| if: always() | |
| shell: bash | |
| run: | | |
| git status | |
| ls -lR bin-cmake-release |