Refactor automation editing and add undo support #14963
Workflow file for this run
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: 'Build: Linux' | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| platforms: | |
| description: 'Platforms to build:' | |
| default: 'linux_x64 linux_arm64' | |
| required: true | |
| build_mode: | |
| description: 'Build mode: devel, nightly, testing, stable' | |
| default: 'devel' | |
| required: true | |
| publish: | |
| description: 'Publish to FTP: on - publish' | |
| default: 'off' | |
| required: false | |
| sentry_project: | |
| description: 'Upload symbols and dumps to Sentry (choose a project): mu4(default for stable build), mu4-sandbox' | |
| default: '' | |
| required: false | |
| dockwidgets_v2: | |
| description: 'Use KDDockWidgets v2: ON/OFF' | |
| default: 'ON' | |
| required: false | |
| workflow_call: | |
| inputs: | |
| platforms: | |
| description: 'Platforms to build:' | |
| default: 'linux_x64 linux_arm64' | |
| type: string | |
| required: true | |
| build_mode: | |
| description: 'Build mode: devel, nightly, testing, stable' | |
| default: 'devel' | |
| type: string | |
| required: true | |
| publish: | |
| description: 'Publish to FTP: on - publish' | |
| default: 'off' | |
| type: string | |
| required: false | |
| sentry_project: | |
| description: 'Upload symbols and dumps to Sentry (choose a project): mu4(default for stable build), mu4-sandbox' | |
| default: '' | |
| type: string | |
| required: false | |
| build_number: | |
| description: "Build number (if not provided, will be generated)" | |
| default: "" | |
| type: string | |
| required: false | |
| dockwidgets_v2: | |
| description: 'Use KDDockWidgets v2: ON/OFF' | |
| default: 'ON' | |
| type: string | |
| required: false | |
| app_repo: | |
| description: 'owner/repo to source MuseScore from (default: this repo)' | |
| type: string | |
| required: false | |
| default: '' | |
| app_ref: | |
| description: 'MuseScore ref to check out (default: ref of triggering event)' | |
| type: string | |
| required: false | |
| default: '' | |
| framework_repo: | |
| description: 'owner/repo to source muse_framework from (default: pinned submodule)' | |
| type: string | |
| required: false | |
| default: '' | |
| framework_ref: | |
| description: 'Ref to check out into the muse_framework submodule (default: pinned SHA)' | |
| type: string | |
| required: false | |
| default: '' | |
| concurrency: | |
| # If run via workflow_call, ${{ github.workflow }} is the root workflow's name (e.g. 'Deploy'), | |
| # which is the same for all workflows called in that run, hence we must add a unique suffix here. | |
| group: ${{ github.workflow }} ${{ github.event_name }} ${{ github.ref }} linux | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: inputs.platforms == '' || contains(inputs.platforms, 'linux_x64') || contains(inputs.platforms, 'linux_arm64') | |
| runs-on: ${{ matrix.runs-on }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: ${{ | |
| (inputs.platforms == '' | |
| || (contains(inputs.platforms, 'linux_x64') && contains(inputs.platforms, 'linux_arm64'))) | |
| && fromJson('["linux_x64","linux_arm64"]') | |
| || (contains(inputs.platforms, 'linux_x64') && fromJson('["linux_x64"]') | |
| || (contains(inputs.platforms, 'linux_arm64') && fromJson('["linux_arm64"]') | |
| || fromJson('[]'))) | |
| }} | |
| include: | |
| - platform: linux_x64 | |
| arch: x86_64 | |
| runs-on: ubuntu-24.04 | |
| qt-host: linux | |
| qt-arch: linux_gcc_64 | |
| dump-symbols-arch: x86-64 | |
| - platform: linux_arm64 | |
| arch: aarch64 | |
| runs-on: ubuntu-24.04-arm | |
| qt-host: linux_arm64 | |
| qt-arch: linux_gcc_arm64 | |
| dump-symbols-arch: aarch64 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ inputs.app_repo || github.repository }} | |
| ref: ${{ inputs.app_ref || github.ref }} | |
| submodules: recursive | |
| - name: Override muse_framework | |
| if: inputs.framework_ref != '' && inputs.framework_repo != '' | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ inputs.framework_repo }} | |
| ref: ${{ inputs.framework_ref }} | |
| path: muse | |
| submodules: recursive | |
| - name: Configure workflow | |
| env: | |
| pull_request_title: ${{ github.event.pull_request.title }} | |
| SENTRY_MUSE_MU4_KEY: ${{ secrets.SENTRY_MUSE_MU4_KEY }} | |
| SENTRY_MUSE_MU4_SANDBOX_KEY: ${{ secrets.SENTRY_MUSE_MU4_SANDBOX_KEY }} | |
| SENTRY_PROJECT: ${{ inputs.sentry_project }} | |
| run: | | |
| bash ./buildscripts/ci/tools/make_build_mode_env.sh -e ${{ github.event_name }} -m ${{ inputs.build_mode }} | |
| BUILD_MODE=$(cat ./build.artifacts/env/build_mode.env) | |
| if [ -n "${{ inputs.build_number }}" ]; then | |
| BUILD_NUMBER="${{ inputs.build_number }}" | |
| bash ./buildscripts/ci/tools/make_build_number.sh "$BUILD_NUMBER" | |
| else | |
| bash ./buildscripts/ci/tools/make_build_number.sh | |
| fi | |
| BUILD_NUMBER=$(cat ./build.artifacts/env/build_number.env) | |
| DO_UPDATE_TS='false' | |
| if [[ "$BUILD_MODE" == "testing" || "$BUILD_MODE" == "stable" ]]; then | |
| DO_UPDATE_TS='true' | |
| if [ -z "${{ secrets.TRANSIFEX_API_TOKEN }}" ]; then | |
| echo "::warning::TRANSIFEX_API_TOKEN is empty; updating .ts files disabled" | |
| DO_UPDATE_TS='false' | |
| fi | |
| fi | |
| DO_PLACEHOLDER_TRANSLATIONS='false' | |
| if [[ "$BUILD_MODE" == "nightly" || "$BUILD_MODE" == "devel" ]]; then | |
| DO_PLACEHOLDER_TRANSLATIONS='true' | |
| fi | |
| DO_UPLOAD_SYMBOLS='false' | |
| SENTRY_URL="" | |
| if [ "$SENTRY_MUSE_MU4_KEY" != "" ]; then | |
| if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "stable" ]; then | |
| SENTRY_PROJECT="mu4" | |
| fi | |
| if [ "$SENTRY_PROJECT" == "mu4" ]; then | |
| DO_UPLOAD_SYMBOLS='true' | |
| SENTRY_URL=https://sentry.musescore.com/api/4/minidump/?sentry_key=$SENTRY_MUSE_MU4_KEY | |
| fi | |
| fi | |
| if [ -z "$SENTRY_PROJECT" ] && [ "$BUILD_MODE" == "nightly" ]; then | |
| SENTRY_PROJECT="mu4-sandbox" | |
| fi | |
| if [ "$SENTRY_PROJECT" == "mu4-sandbox" ] && [ "$SENTRY_MUSE_MU4_SANDBOX_KEY" != "" ]; then | |
| DO_UPLOAD_SYMBOLS='true' | |
| SENTRY_URL=https://sentry.musescore.com/api/3/minidump/?sentry_key=$SENTRY_MUSE_MU4_SANDBOX_KEY | |
| fi | |
| DO_PUBLISH='false' | |
| if [ "${{ inputs.publish }}" == "on" ]; then | |
| DO_PUBLISH='true' | |
| if [ -z "${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }}" ]; then | |
| echo "::warning::OSUOSL_SSH_ENCRYPT_SECRET is empty; not publishing to OSUOSL" | |
| DO_PUBLISH='false' | |
| fi | |
| fi | |
| ADD_INFO="_${GITHUB_REF#refs/heads/}" | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| ADD_INFO="_${{ github.event.pull_request.number }}_${pull_request_title}" | |
| fi | |
| UPLOAD_ARTIFACT_NAME="$(tr '":<>|*?/\\’' '_' <<<"MU4_${BUILD_NUMBER}_Lin_${{ matrix.arch }}${ADD_INFO}")" | |
| echo "github.repository: ${{ github.repository }}" | |
| echo "BUILD_MODE=$BUILD_MODE" | tee -a $GITHUB_ENV | |
| echo "BUILD_NUMBER=$BUILD_NUMBER" | tee -a $GITHUB_ENV | |
| echo "DO_UPDATE_TS=$DO_UPDATE_TS" | tee -a $GITHUB_ENV | |
| echo "DO_PLACEHOLDER_TRANSLATIONS=$DO_PLACEHOLDER_TRANSLATIONS" | tee -a $GITHUB_ENV | |
| echo "DO_UPLOAD_SYMBOLS=$DO_UPLOAD_SYMBOLS" | tee -a $GITHUB_ENV | |
| echo "SENTRY_PROJECT=$SENTRY_PROJECT" | tee -a $GITHUB_ENV | |
| echo "SENTRY_URL=$SENTRY_URL" | tee -a $GITHUB_ENV | |
| echo "DO_PUBLISH=$DO_PUBLISH" | tee -a $GITHUB_ENV | |
| echo "UPLOAD_ARTIFACT_NAME=$UPLOAD_ARTIFACT_NAME" | tee -a $GITHUB_ENV | |
| - parallel: | |
| - name: Restore ccache files | |
| id: restore-ccache | |
| uses: actions/cache/restore@v6 | |
| with: | |
| path: ${{ github.workspace }}/.ccache | |
| key: ${{runner.os}}-${{runner.arch}}-ccache- | |
| restore-keys: ${{runner.os}}-${{runner.arch}}-ccache- | |
| - name: Setup ccache | |
| run: | | |
| sudo apt-get install -y ccache | |
| bash ./buildscripts/ci/tools/setup_ccache_config.sh | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: 6.10.2 | |
| host: ${{ matrix.qt-host }} | |
| target: 'desktop' | |
| arch: ${{ matrix.qt-arch }} | |
| modules: 'qt5compat qtnetworkauth qtshadertools qtwebsockets' | |
| cache: true | |
| - name: Setup environment | |
| run: | | |
| bash ./buildscripts/ci/linux/setup.sh --arch ${{ matrix.arch }} --build-pipewire | |
| - parallel: | |
| - name: Generate _en.ts files | |
| env: | |
| LUPDATE_ARGS: "" | |
| POSTPROCESS_ARGS: ${{ env.DO_PLACEHOLDER_TRANSLATIONS == 'true' && '--generate-placeholder-translations' || '' }} | |
| run: | | |
| bash ./tools/translations/run_lupdate.sh | |
| - name: Update .ts files (tx pull) | |
| if: env.DO_UPDATE_TS == 'true' | |
| uses: transifex/cli-action@v2 | |
| with: | |
| token: ${{ secrets.TRANSIFEX_API_TOKEN }} | |
| args: "pull -f" | |
| - name: Register gcc problem matcher | |
| run: echo "::add-matcher::.github/problem_matchers/gcc.json" | |
| - name: Build | |
| run: | | |
| C_URL=${SENTRY_URL}; if [ -z "$C_URL" ]; then C_URL="''"; fi | |
| bash ./buildscripts/ci/linux/build.sh -n ${{ env.BUILD_NUMBER }} --crash_log_url $C_URL --arch ${{ matrix.arch }} --build-pipewire --dockwidgets_v2 ${{ inputs.dockwidgets_v2 == 'ON' && 'ON' || 'OFF' }} | |
| - name: Show ccache stats | |
| run: | | |
| ccache -sv | |
| - name: Package | |
| run: | | |
| bash ./buildscripts/ci/linux/package.sh --arch ${{ matrix.arch }} --build-pipewire | |
| - name: Checksum | |
| run: | | |
| bash ./buildscripts/ci/tools/checksum.sh | |
| - name: Generate and upload dump symbols | |
| if: env.DO_UPLOAD_SYMBOLS == 'true' | |
| run: | | |
| APP_BIN=$(find "$(pwd)/build.release/src/app/" -type f -name "mscore4portable*" -print -quit) | |
| ARCH=${{ matrix.dump-symbols-arch }} | |
| sudo cmake -DAPP_BIN=${APP_BIN} \ | |
| -DARCH=${ARCH} \ | |
| -DSENTRY_URL=https://sentry.musescore.com \ | |
| -DSENTRY_ORG=sentry \ | |
| -DSENTRY_AUTH_TOKEN=${{ secrets.SENTRY_MUSE_AUTH_TOKEN }} \ | |
| -DSENTRY_PROJECT=${SENTRY_PROJECT} \ | |
| -DSTAGE=${BUILD_MODE} \ | |
| -P buildscripts/ci/crashdumps/ci_generate_and_upload.cmake | |
| - name: Publish to OSUOSL | |
| if: env.DO_PUBLISH == 'true' | |
| run: | | |
| bash ./buildscripts/ci/tools/osuosl/publish.sh -s ${{ secrets.OSUOSL_SSH_ENCRYPT_SECRET }} --os linux --arch ${{ matrix.arch }} -v 4 | |
| - name: Upload artifacts on GitHub | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.UPLOAD_ARTIFACT_NAME }} | |
| path: ./build.artifacts/ | |
| - name: Prepare ccache files for saving | |
| id: prepare-save-ccache | |
| if: always() | |
| run: | | |
| ccache --recompress 10 | |
| echo "CCACHE_TIMESTAMP=$(date -u +"%F-%T")" | tee -a $GITHUB_OUTPUT | |
| - name: Save ccache files | |
| if: always() | |
| uses: actions/cache/save@v6 | |
| with: | |
| key: ${{ steps.restore-ccache.outputs.cache-primary-key }}${{ steps.prepare-save-ccache.outputs.CCACHE_TIMESTAMP }} | |
| path: ${{ github.workspace }}/.ccache |