From d700128c79cd3ff2aee8080a01330bbb4977c517 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:09:33 +0100 Subject: [PATCH 01/11] Autobuild: Drop commented out code and duplicate newlines --- .github/workflows/autobuild.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index c88b65b709..83affe2e67 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,6 +1,5 @@ #### Automatically build and upload releases to GitHub #### - # see analyse_git_reference.py for implementation of the logic: # for every push to a branch starting with "autobuild": (can be used during development for tighter supervision of builds) # - do CodeQl while building for every platform @@ -16,7 +15,6 @@ # - publish the created binaries/packs only as artifacts/appendix as a release # - on: workflow_dispatch: push: @@ -26,7 +24,6 @@ on: - "autobuild*" # for developers: branches starting with autobuild will be built and evaluated on each push - "autobuild/*" # for developers: branches starting with autobuild will be built and evaluated on each push - "master" - # - "*" pull_request: # The branches below must be a subset of the branches in "push" branches: - master @@ -77,11 +74,6 @@ jobs: draft: false - ### CANCEL ### can be used for development concerning release-creation - #- name: Cancelthrougherroe - # run: myundefinedfunction - - release_assets: name: Build assets for ${{ matrix.config.config_name }} needs: create_release From 41303890963da72af5755025ee6c62d1cb1cf803 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:12:36 +0100 Subject: [PATCH 02/11] Autobuild: Shorten branch matching syntax https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet --- .github/workflows/autobuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 83affe2e67..1283f04bc1 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -21,8 +21,8 @@ on: tags: - "r*" branches: - - "autobuild*" # for developers: branches starting with autobuild will be built and evaluated on each push - - "autobuild/*" # for developers: branches starting with autobuild will be built and evaluated on each push + # for developers: branches starting with autobuild will be built and evaluated on each push + - "autobuild**" - "master" pull_request: # The branches below must be a subset of the branches in "push" branches: From f566b2da7335e88e8619e7e27b1d9b03e1668749 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:21:59 +0100 Subject: [PATCH 03/11] Autobuild: Drop comments which repeat step names --- .github/workflows/autobuild.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 1283f04bc1..08df2c6cf2 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -39,17 +39,13 @@ jobs: version_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_VERSION_NAME }} steps: - # Checkout code - name: Checkout code uses: actions/checkout@v2 - # Set variables - # Determine release / pre-release - name: Get Jamulus build info, determine actions & variables run: python3 ${{ github.workspace }}/.github/actions_scripts/analyse_git_reference.py id: jamulus-build-vars - # remove release, if it exists (with this releasetag) - name: Remove release, if existing (for branches) if: ${{ contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') }} continue-on-error: true @@ -59,7 +55,7 @@ jobs: tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # create release (empty, filled by next jobs) + - name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}' if: ${{ contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') }} id: create_release_step @@ -158,21 +154,18 @@ jobs: runs-on: ${{ matrix.config.building_on_os }} steps: - - name: Select Xcode version for Mac if: ${{ matrix.config.target_os == 'macos' || matrix.config.target_os == 'ios' }} uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ${{ matrix.config.xcode_version }} - # Checkout code - name: Checkout code uses: actions/checkout@v2 with: submodules: true fetch-depth: ${{ matrix.config.checkout_fetch_depth || '1' }} - # Enable caching of downloaded dependencies - name: "Cache Mac dependencies" if: ${{ matrix.config.target_os == 'macos' }} uses: actions/cache@v2 @@ -205,7 +198,6 @@ jobs: /opt/android/android-ndk key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/android/autobuild_apk_1_prepare.sh', 'autobuild/android/install-qt.sh') }}-${{ matrix.config.cmd1_prebuild }} - # Prepare (install QT & dependencies) - name: "Prepare for ${{ matrix.config.config_name }}" if: ${{ matrix.config.cmd1_prebuild }} run: ${{ matrix.config.cmd1_prebuild }} @@ -214,7 +206,6 @@ jobs: jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - # Initialize CodeQL tools for code-scanning for security - name: Initialize CodeQL if: matrix.config.uses_codeql uses: github/codeql-action/init@v1 @@ -224,7 +215,6 @@ jobs: # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - # Build - name: "Build for ${{ matrix.config.config_name }}" id: step_macos_build if: ${{ matrix.config.cmd2_build }} @@ -246,7 +236,6 @@ jobs: jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - # Upload Artifact to Job - name: Upload Artifact 1 to Job if: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} uses: actions/upload-artifact@v2 @@ -256,7 +245,6 @@ jobs: retention-days: 31 if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - # Upload Artifact to Job - name: Upload Artifact 2 to Job if: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} uses: actions/upload-artifact@v2 @@ -266,7 +254,6 @@ jobs: retention-days: 31 if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - # Notarize macOS build, if needed - name: "Notarize macOS Release Build" if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} id: notarize-macOS-app @@ -276,7 +263,7 @@ jobs: primary-bundle-id: io.jamulus.Jamulus appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} - # Apply successful notarization + - name: "Staple macOS Release Build" if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} id: staple-macOS-app @@ -284,7 +271,6 @@ jobs: with: product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - # Upload Artifact to Release - name: Upload Artifact 1 to Release if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') }} id: upload-release-asset1 @@ -297,7 +283,6 @@ jobs: asset_name: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} asset_content_type: application/octet-stream - # Upload Artifact to Release - name: Upload Artifact 2 to Release if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_2 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') }} id: upload-release-asset2 @@ -310,7 +295,6 @@ jobs: asset_name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} asset_content_type: application/octet-stream - # Run CodeQL tools for code-scanning for security - name: Perform CodeQL Analysis if: matrix.config.uses_codeql uses: github/codeql-action/analyze@v1 From 9e2fc08360527b7f2a3e487f0e959cab47504fca Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:38:42 +0100 Subject: [PATCH 04/11] Autobuild: Unify indentation --- .github/workflows/autobuild.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 08df2c6cf2..febf160447 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -158,7 +158,7 @@ jobs: if: ${{ matrix.config.target_os == 'macos' || matrix.config.target_os == 'ios' }} uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: ${{ matrix.config.xcode_version }} + xcode-version: ${{ matrix.config.xcode_version }} - name: Checkout code uses: actions/checkout@v2 @@ -254,22 +254,22 @@ jobs: retention-days: 31 if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - - name: "Notarize macOS Release Build" - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} - id: notarize-macOS-app - uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b + - name: "Notarize macOS Release Build" + if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + id: notarize-macOS-app + uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b with: - product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - primary-bundle-id: io.jamulus.Jamulus + product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} + primary-bundle-id: io.jamulus.Jamulus appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} - - name: "Staple macOS Release Build" - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} - id: staple-macOS-app - uses: devbotsxyz/xcode-staple@v1 + - name: "Staple macOS Release Build" + if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + id: staple-macOS-app + uses: devbotsxyz/xcode-staple@v1 with: - product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} + product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - name: Upload Artifact 1 to Release if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') }} From 1c8729a557f784ee4ee70089087ecdc010586420 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:41:58 +0100 Subject: [PATCH 05/11] Autobuild: Reorganize, shorten and strip redundant comments --- .github/workflows/autobuild.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index febf160447..ddb6f7004c 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -13,7 +13,6 @@ # for every tag that starts with 'r' and does not have any suffix: # - do CodeQl while building for every platform # - publish the created binaries/packs only as artifacts/appendix as a release -# on: workflow_dispatch: @@ -21,11 +20,12 @@ on: tags: - "r*" branches: - # for developers: branches starting with autobuild will be built and evaluated on each push + # For developers: Branches starting with autobuild will be built and evaluated on each push. - "autobuild**" - "master" - pull_request: # The branches below must be a subset of the branches in "push" + pull_request: branches: + # These branches must be a subset of the branches in "push": - master name: Auto-Build @@ -75,7 +75,9 @@ jobs: needs: create_release strategy: fail-fast: false - matrix: # Think of this like a foreach loop. Basically runs the steps with every combination of the contents of this. More info: https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + matrix: + # Think of this like a foreach loop. Basically runs the steps with every combination of + # the contents of this. config: - config_name: AndroidAPK (artifact+codeQL) target_os: android @@ -84,7 +86,8 @@ jobs: cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh" cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh" uses_codeql: true - checkout_fetch_depth: '0' # Jamulus.pro needs to count git history length for android versioning + # Jamulus.pro needs to count git history length for android versioning: + checkout_fetch_depth: '0' - config_name: Linux (artifacts+codeQL) target_os: linux @@ -211,9 +214,6 @@ jobs: uses: github/codeql-action/init@v1 with: languages: 'cpp' - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - name: "Build for ${{ matrix.config.config_name }}" id: step_macos_build @@ -243,7 +243,7 @@ jobs: name: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} retention-days: 31 - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if-no-files-found: error - name: Upload Artifact 2 to Job if: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} @@ -252,7 +252,7 @@ jobs: name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} retention-days: 31 - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if-no-files-found: error - name: "Notarize macOS Release Build" if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} @@ -278,7 +278,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.create_release.outputs.upload_url }} # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.create_release.outputs.upload_url }} asset_path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} asset_name: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} asset_content_type: application/octet-stream @@ -290,7 +290,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.create_release.outputs.upload_url }} # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.create_release.outputs.upload_url }} asset_path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} asset_name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} asset_content_type: application/octet-stream From ecc50f8b8a6d58727f20b441bffeccdfaf8e0627 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:45:57 +0100 Subject: [PATCH 06/11] Autobuild: Shorten if expressions ${{ ... }} is optional for if: entries. Therefore drop it in order to reduce clutter. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif --- .github/workflows/autobuild.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index ddb6f7004c..0909a70c7b 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -47,7 +47,7 @@ jobs: id: jamulus-build-vars - name: Remove release, if existing (for branches) - if: ${{ contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') }} + if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') continue-on-error: true uses: dev-drprasad/delete-tag-and-release@v0.1.2 with: @@ -57,7 +57,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}' - if: ${{ contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') }} + if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') id: create_release_step uses: actions/create-release@v1 env: @@ -158,7 +158,7 @@ jobs: runs-on: ${{ matrix.config.building_on_os }} steps: - name: Select Xcode version for Mac - if: ${{ matrix.config.target_os == 'macos' || matrix.config.target_os == 'ios' }} + if: matrix.config.target_os == 'macos' || matrix.config.target_os == 'ios' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ${{ matrix.config.xcode_version }} @@ -170,7 +170,7 @@ jobs: fetch-depth: ${{ matrix.config.checkout_fetch_depth || '1' }} - name: "Cache Mac dependencies" - if: ${{ matrix.config.target_os == 'macos' }} + if: matrix.config.target_os == 'macos' uses: actions/cache@v2 with: path: | @@ -180,7 +180,7 @@ jobs: key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/mac/artifacts/autobuild_mac_1_prepare.sh', 'autobuild/mac/codeQL/autobuild_mac_1_prepare.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.cmd1_prebuild }} - name: "Cache Windows dependencies" - if: ${{ matrix.config.target_os == 'windows' }} + if: matrix.config.target_os == 'windows' uses: actions/cache@v2 with: path: | @@ -192,7 +192,7 @@ jobs: key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.cmd1_prebuild }} - name: "Cache Android dependencies" - if: ${{ matrix.config.target_os == 'android' }} + if: matrix.config.target_os == 'android' uses: actions/cache@v2 with: path: | @@ -202,7 +202,7 @@ jobs: key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/android/autobuild_apk_1_prepare.sh', 'autobuild/android/install-qt.sh') }}-${{ matrix.config.cmd1_prebuild }} - name: "Prepare for ${{ matrix.config.config_name }}" - if: ${{ matrix.config.cmd1_prebuild }} + if: matrix.config.cmd1_prebuild run: ${{ matrix.config.cmd1_prebuild }} env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' # allow setting environment variables @@ -217,7 +217,7 @@ jobs: - name: "Build for ${{ matrix.config.config_name }}" id: step_macos_build - if: ${{ matrix.config.cmd2_build }} + if: matrix.config.cmd2_build run: ${{ matrix.config.cmd2_build }} ${{ github.workspace }} env: jamulus_project_path: ${{ github.workspace }} @@ -230,14 +230,14 @@ jobs: - name: "Post-Build for ${{ matrix.config.config_name }}" id: step_cmd3_postbuild - if: ${{ matrix.config.cmd3_postbuild }} + if: matrix.config.cmd3_postbuild run: ${{ matrix.config.cmd3_postbuild }} ${{ github.workspace }} env: jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - name: Upload Artifact 1 to Job - if: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} + if: steps.step_cmd3_postbuild.outputs.artifact_1 uses: actions/upload-artifact@v2 with: name: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} @@ -246,7 +246,7 @@ jobs: if-no-files-found: error - name: Upload Artifact 2 to Job - if: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} + if: steps.step_cmd3_postbuild.outputs.artifact_2 uses: actions/upload-artifact@v2 with: name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} @@ -255,7 +255,7 @@ jobs: if-no-files-found: error - name: "Notarize macOS Release Build" - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') id: notarize-macOS-app uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b with: @@ -265,14 +265,14 @@ jobs: appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} - name: "Staple macOS Release Build" - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') id: staple-macOS-app uses: devbotsxyz/xcode-staple@v1 with: product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - name: Upload Artifact 1 to Release - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') id: upload-release-asset1 uses: actions/upload-release-asset@v1 env: @@ -284,7 +284,7 @@ jobs: asset_content_type: application/octet-stream - name: Upload Artifact 2 to Release - if: ${{ (steps.step_cmd3_postbuild.outputs.artifact_2 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') }} + if: (steps.step_cmd3_postbuild.outputs.artifact_2 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') id: upload-release-asset2 uses: actions/upload-release-asset@v1 env: From e2d093c2bb2907317a2981320e79851f7012ed22 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:50:27 +0100 Subject: [PATCH 07/11] Autobuild: Line-wrap long if statements --- .github/workflows/autobuild.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 0909a70c7b..ef1eca20e5 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -255,7 +255,10 @@ jobs: if-no-files-found: error - name: "Notarize macOS Release Build" - if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') + if: >- + steps.step_cmd3_postbuild.outputs.artifact_1 != '' && + steps.step_macos_build.outputs.macos_signed == 'true' && + contains(needs.create_release.outputs.publish_to_release, 'true') id: notarize-macOS-app uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b with: @@ -265,14 +268,19 @@ jobs: appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} - name: "Staple macOS Release Build" - if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && (steps.step_macos_build.outputs.macos_signed == 'true') && contains(needs.create_release.outputs.publish_to_release, 'true') + if: >- + steps.step_cmd3_postbuild.outputs.artifact_1 != '' && + steps.step_macos_build.outputs.macos_signed == 'true' && + contains(needs.create_release.outputs.publish_to_release, 'true') id: staple-macOS-app uses: devbotsxyz/xcode-staple@v1 with: product-path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - name: Upload Artifact 1 to Release - if: (steps.step_cmd3_postbuild.outputs.artifact_1 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') + if: >- + steps.step_cmd3_postbuild.outputs.artifact_1 != '' && + contains(needs.create_release.outputs.publish_to_release, 'true') id: upload-release-asset1 uses: actions/upload-release-asset@v1 env: @@ -284,7 +292,9 @@ jobs: asset_content_type: application/octet-stream - name: Upload Artifact 2 to Release - if: (steps.step_cmd3_postbuild.outputs.artifact_2 != '') && contains(needs.create_release.outputs.publish_to_release, 'true') + if: >- + steps.step_cmd3_postbuild.outputs.artifact_2 != '' && + contains(needs.create_release.outputs.publish_to_release, 'true') id: upload-release-asset2 uses: actions/upload-release-asset@v1 env: From ae64e384d9d95ea1041c925b894237e650a22619 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 7 Mar 2022 23:52:02 +0100 Subject: [PATCH 08/11] Autobuild: Rename uses_codeql -> run_codeql --- .github/workflows/autobuild.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index ef1eca20e5..ab3a516a83 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -85,7 +85,7 @@ jobs: cmd1_prebuild: "./autobuild/android/autobuild_apk_1_prepare.sh" cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh" cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh" - uses_codeql: true + run_codeql: true # Jamulus.pro needs to count git history length for android versioning: checkout_fetch_depth: '0' @@ -95,7 +95,7 @@ jobs: cmd1_prebuild: "./autobuild/linux/autobuild_deb_1_prepare.sh" cmd2_build: "./autobuild/linux/autobuild_deb_2_build.sh" cmd3_postbuild: "./autobuild/linux/autobuild_deb_3_copy_files.sh" - uses_codeql: true + run_codeql: true - config_name: MacOS (codeQL) target_os: macos @@ -103,7 +103,7 @@ jobs: cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh 5.15.2" cmd2_build: "./autobuild/mac/codeQL/autobuild_mac_2_build.sh" cmd3_postbuild: false - uses_codeql: true + run_codeql: true xcode_version: 12.1.1 - config_name: MacOS (artifacts) @@ -113,7 +113,7 @@ jobs: cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.15.2" cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible" cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh" - uses_codeql: false + run_codeql: false xcode_version: 12.1.1 - config_name: iOS (artifacts) @@ -122,7 +122,7 @@ jobs: cmd1_prebuild: "./autobuild/ios/artifacts/autobuild_ios_1_prepare.sh 5.15.2" cmd2_build: "./autobuild/ios/artifacts/autobuild_ios_2_build.sh" cmd3_postbuild: "./autobuild/ios/artifacts/autobuild_ios_3_copy_files.sh" - uses_codeql: false + run_codeql: false xcode_version: 12.1.1 - config_name: MacOS Legacy (artifacts) @@ -131,7 +131,7 @@ jobs: cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.9.9" cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh do_not_sign" cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy" - uses_codeql: false + run_codeql: false # For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x. # Xcode 12.1 is the most-recent release which still ships SDK 10.15: # https://developer.apple.com/support/xcode/ @@ -145,7 +145,7 @@ jobs: cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 - uses_codeql: true + run_codeql: true - config_name: Windows JACK (artifact) target_os: windows @@ -153,7 +153,7 @@ jobs: cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 -BuildOption jackonwindows cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 -BuildOption jackonwindows cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 -BuildOption jackonwindows - uses_codeql: false + run_codeql: false runs-on: ${{ matrix.config.building_on_os }} steps: @@ -210,7 +210,7 @@ jobs: jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - name: Initialize CodeQL - if: matrix.config.uses_codeql + if: matrix.config.run_codeql uses: github/codeql-action/init@v1 with: languages: 'cpp' @@ -306,5 +306,5 @@ jobs: asset_content_type: application/octet-stream - name: Perform CodeQL Analysis - if: matrix.config.uses_codeql + if: matrix.config.run_codeql uses: github/codeql-action/analyze@v1 From fe9f41526020ef298a8af0c95900d409c584eca1 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 9 Mar 2022 12:29:54 +0100 Subject: [PATCH 09/11] Autobuild: Make two-space indentation consistent --- .github/workflows/autobuild.yml | 216 ++++++++++++++++---------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index ab3a516a83..bc20968de5 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -31,43 +31,43 @@ on: name: Auto-Build jobs: create_release: - name: Prepare Auto-Build/Release - runs-on: ubuntu-20.04 - outputs: + name: Prepare Auto-Build/Release + runs-on: ubuntu-20.04 + outputs: publish_to_release: ${{ steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE }} upload_url: ${{ steps.create_release_step.outputs.upload_url }} version_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_VERSION_NAME }} - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Get Jamulus build info, determine actions & variables - run: python3 ${{ github.workspace }}/.github/actions_scripts/analyse_git_reference.py - id: jamulus-build-vars - - - name: Remove release, if existing (for branches) - if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') - continue-on-error: true - uses: dev-drprasad/delete-tag-and-release@v0.1.2 - with: - delete_release: true - tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}' - if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') - id: create_release_step - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }} - release_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TITLE }} - body_path: ${{ github.workspace }}/autoLatestChangelog.md - prerelease: ${{ steps.jamulus-build-vars.outputs.IS_PRERELEASE }} - draft: false + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Get Jamulus build info, determine actions & variables + run: python3 ${{ github.workspace }}/.github/actions_scripts/analyse_git_reference.py + id: jamulus-build-vars + + - name: Remove release, if existing (for branches) + if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') + continue-on-error: true + uses: dev-drprasad/delete-tag-and-release@v0.1.2 + with: + delete_release: true + tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}' + if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') + id: create_release_step + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }} + release_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TITLE }} + body_path: ${{ github.workspace }}/autoLatestChangelog.md + prerelease: ${{ steps.jamulus-build-vars.outputs.IS_PRERELEASE }} + draft: false release_assets: @@ -79,81 +79,81 @@ jobs: # Think of this like a foreach loop. Basically runs the steps with every combination of # the contents of this. config: - - config_name: AndroidAPK (artifact+codeQL) - target_os: android - building_on_os: ubuntu-20.04 - cmd1_prebuild: "./autobuild/android/autobuild_apk_1_prepare.sh" - cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh" - cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh" - run_codeql: true - # Jamulus.pro needs to count git history length for android versioning: - checkout_fetch_depth: '0' - - - config_name: Linux (artifacts+codeQL) - target_os: linux - building_on_os: ubuntu-18.04 - cmd1_prebuild: "./autobuild/linux/autobuild_deb_1_prepare.sh" - cmd2_build: "./autobuild/linux/autobuild_deb_2_build.sh" - cmd3_postbuild: "./autobuild/linux/autobuild_deb_3_copy_files.sh" - run_codeql: true - - - config_name: MacOS (codeQL) - target_os: macos - building_on_os: macos-10.15 - cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh 5.15.2" - cmd2_build: "./autobuild/mac/codeQL/autobuild_mac_2_build.sh" - cmd3_postbuild: false - run_codeql: true - xcode_version: 12.1.1 - - - config_name: MacOS (artifacts) - target_os: macos - # Stay on 10.15 as long as we use dmgbuild which does not work with 11's hdiutil (?) - building_on_os: macos-10.15 - cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.15.2" - cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible" - cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh" - run_codeql: false - xcode_version: 12.1.1 - - - config_name: iOS (artifacts) - target_os: ios - building_on_os: macos-10.15 - cmd1_prebuild: "./autobuild/ios/artifacts/autobuild_ios_1_prepare.sh 5.15.2" - cmd2_build: "./autobuild/ios/artifacts/autobuild_ios_2_build.sh" - cmd3_postbuild: "./autobuild/ios/artifacts/autobuild_ios_3_copy_files.sh" - run_codeql: false - xcode_version: 12.1.1 - - - config_name: MacOS Legacy (artifacts) - target_os: macos - building_on_os: macos-10.15 - cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.9.9" - cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh do_not_sign" - cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy" - run_codeql: false - # For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x. - # Xcode 12.1 is the most-recent release which still ships SDK 10.15: - # https://developer.apple.com/support/xcode/ - # Xcode 12.1.1 is the most-recent 12.1.x release: - # https://xcodereleases.com/ - xcode_version: 12.1.1 - - - config_name: Windows (artifact+codeQL) - target_os: windows - building_on_os: windows-2019 - cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 - cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 - cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 - run_codeql: true - - - config_name: Windows JACK (artifact) - target_os: windows - building_on_os: windows-2019 - cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 -BuildOption jackonwindows - cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 -BuildOption jackonwindows - cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 -BuildOption jackonwindows - run_codeql: false + - config_name: AndroidAPK (artifact+codeQL) + target_os: android + building_on_os: ubuntu-20.04 + cmd1_prebuild: "./autobuild/android/autobuild_apk_1_prepare.sh" + cmd2_build: "./autobuild/android/autobuild_apk_2_build.sh" + cmd3_postbuild: "./autobuild/android/autobuild_apk_3_copy_files.sh" + run_codeql: true + # Jamulus.pro needs to count git history length for android versioning: + checkout_fetch_depth: '0' + + - config_name: Linux (artifacts+codeQL) + target_os: linux + building_on_os: ubuntu-18.04 + cmd1_prebuild: "./autobuild/linux/autobuild_deb_1_prepare.sh" + cmd2_build: "./autobuild/linux/autobuild_deb_2_build.sh" + cmd3_postbuild: "./autobuild/linux/autobuild_deb_3_copy_files.sh" + run_codeql: true + + - config_name: MacOS (codeQL) + target_os: macos + building_on_os: macos-10.15 + cmd1_prebuild: "./autobuild/mac/codeQL/autobuild_mac_1_prepare.sh 5.15.2" + cmd2_build: "./autobuild/mac/codeQL/autobuild_mac_2_build.sh" + cmd3_postbuild: false + run_codeql: true + xcode_version: 12.1.1 + + - config_name: MacOS (artifacts) + target_os: macos + # Stay on 10.15 as long as we use dmgbuild which does not work with 11's hdiutil (?) + building_on_os: macos-10.15 + cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.15.2" + cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh sign_if_possible" + cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh" + run_codeql: false + xcode_version: 12.1.1 + + - config_name: iOS (artifacts) + target_os: ios + building_on_os: macos-10.15 + cmd1_prebuild: "./autobuild/ios/artifacts/autobuild_ios_1_prepare.sh 5.15.2" + cmd2_build: "./autobuild/ios/artifacts/autobuild_ios_2_build.sh" + cmd3_postbuild: "./autobuild/ios/artifacts/autobuild_ios_3_copy_files.sh" + run_codeql: false + xcode_version: 12.1.1 + + - config_name: MacOS Legacy (artifacts) + target_os: macos + building_on_os: macos-10.15 + cmd1_prebuild: "./autobuild/mac/artifacts/autobuild_mac_1_prepare.sh 5.9.9" + cmd2_build: "./autobuild/mac/artifacts/autobuild_mac_2_build.sh do_not_sign" + cmd3_postbuild: "./autobuild/mac/artifacts/autobuild_mac_3_copy_files.sh legacy" + run_codeql: false + # For Qt5 on Mac, we need to ensure SDK 10.15 is used, and not SDK 11.x. + # Xcode 12.1 is the most-recent release which still ships SDK 10.15: + # https://developer.apple.com/support/xcode/ + # Xcode 12.1.1 is the most-recent 12.1.x release: + # https://xcodereleases.com/ + xcode_version: 12.1.1 + + - config_name: Windows (artifact+codeQL) + target_os: windows + building_on_os: windows-2019 + cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 + cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 + cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 + run_codeql: true + + - config_name: Windows JACK (artifact) + target_os: windows + building_on_os: windows-2019 + cmd1_prebuild: powershell .\autobuild\windows\autobuild_windowsinstaller_1_prepare.ps1 -BuildOption jackonwindows + cmd2_build: powershell .\autobuild\windows\autobuild_windowsinstaller_2_build.ps1 -BuildOption jackonwindows + cmd3_postbuild: powershell .\autobuild\windows\autobuild_windowsinstaller_3_copy_files.ps1 -BuildOption jackonwindows + run_codeql: false runs-on: ${{ matrix.config.building_on_os }} steps: From 080a27d2d6c42a7d77fb11965b02c5061351299a Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Tue, 8 Mar 2022 21:21:13 +0100 Subject: [PATCH 10/11] Autobuild: Clarify action step names and improve comments Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com> --- .github/workflows/autobuild.yml | 35 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index bc20968de5..03c3c00168 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,4 +1,6 @@ -#### Automatically build and upload releases to GitHub #### +# This file builds the source and produces artifacts for every supported platform. +# For release tags it creates a Github release and uploads the binaries to that releases. +# The builds are instrumented with CodeQL. # see analyse_git_reference.py for implementation of the logic: # for every push to a branch starting with "autobuild": (can be used during development for tighter supervision of builds) @@ -22,16 +24,19 @@ on: branches: # For developers: Branches starting with autobuild will be built and evaluated on each push. - "autobuild**" + # CodeQL requires every branch from on.pull_request to be part of on.push as well in order to run comparisons. + # We also need master here to trigger builds on PR merge to master and manual pushes (e.g. as part of the release process): - "master" pull_request: branches: - # These branches must be a subset of the branches in "push": - master name: Auto-Build jobs: create_release: - name: Prepare Auto-Build/Release + # Check if we are doing a release or just a normal build. + # This must be done before actually building the app to find out where to upload the binaries and if we need to create a Github release. + name: Build vars & Github release (if required) runs-on: ubuntu-20.04 outputs: publish_to_release: ${{ steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE }} @@ -42,11 +47,11 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Get Jamulus build info, determine actions & variables + - name: Determine release version, type and prerelease variables and generate Changelog run: python3 ${{ github.workspace }}/.github/actions_scripts/analyse_git_reference.py id: jamulus-build-vars - - name: Remove release, if existing (for branches) + - name: Remove release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}}, if existing if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') continue-on-error: true uses: dev-drprasad/delete-tag-and-release@v0.1.2 @@ -56,7 +61,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}' + - name: Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} ${{steps.jamulus-build-vars.outputs.RELEASE_TITLE}} if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') id: create_release_step uses: actions/create-release@v1 @@ -71,7 +76,7 @@ jobs: release_assets: - name: Build assets for ${{ matrix.config.config_name }} + name: Build for ${{ matrix.config.config_name }} needs: create_release strategy: fail-fast: false @@ -169,7 +174,7 @@ jobs: submodules: true fetch-depth: ${{ matrix.config.checkout_fetch_depth || '1' }} - - name: "Cache Mac dependencies" + - name: Cache Mac dependencies if: matrix.config.target_os == 'macos' uses: actions/cache@v2 with: @@ -179,7 +184,7 @@ jobs: ~/Library/Cache/jamulus-homebrew-bottles key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/mac/artifacts/autobuild_mac_1_prepare.sh', 'autobuild/mac/codeQL/autobuild_mac_1_prepare.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.cmd1_prebuild }} - - name: "Cache Windows dependencies" + - name: Cache Windows dependencies if: matrix.config.target_os == 'windows' uses: actions/cache@v2 with: @@ -191,7 +196,7 @@ jobs: ~\windows\ASIOSDK2 key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.cmd1_prebuild }} - - name: "Cache Android dependencies" + - name: Cache Android dependencies if: matrix.config.target_os == 'android' uses: actions/cache@v2 with: @@ -201,7 +206,7 @@ jobs: /opt/android/android-ndk key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/android/autobuild_apk_1_prepare.sh', 'autobuild/android/install-qt.sh') }}-${{ matrix.config.cmd1_prebuild }} - - name: "Prepare for ${{ matrix.config.config_name }}" + - name: Set up build dependencies for ${{ matrix.config.config_name }} if: matrix.config.cmd1_prebuild run: ${{ matrix.config.cmd1_prebuild }} env: @@ -215,7 +220,7 @@ jobs: with: languages: 'cpp' - - name: "Build for ${{ matrix.config.config_name }}" + - name: Build for ${{ matrix.config.config_name }} id: step_macos_build if: matrix.config.cmd2_build run: ${{ matrix.config.cmd2_build }} ${{ github.workspace }} @@ -228,7 +233,7 @@ jobs: NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - - name: "Post-Build for ${{ matrix.config.config_name }}" + - name: Post-Build for ${{ matrix.config.config_name }} id: step_cmd3_postbuild if: matrix.config.cmd3_postbuild run: ${{ matrix.config.cmd3_postbuild }} ${{ github.workspace }} @@ -254,7 +259,7 @@ jobs: retention-days: 31 if-no-files-found: error - - name: "Notarize macOS Release Build" + - name: Notarize macOS Release Build if: >- steps.step_cmd3_postbuild.outputs.artifact_1 != '' && steps.step_macos_build.outputs.macos_signed == 'true' && @@ -267,7 +272,7 @@ jobs: appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} - - name: "Staple macOS Release Build" + - name: Staple macOS Release Build if: >- steps.step_cmd3_postbuild.outputs.artifact_1 != '' && steps.step_macos_build.outputs.macos_signed == 'true' && From d31bda09b760f945be7540e33f2f34f461cbd172 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 9 Mar 2022 23:03:46 +0100 Subject: [PATCH 11/11] Autobuild: Avoid Mac-specific naming in generic build step Although the build step is only referenced later by Mac-specific steps it should not be called "step_mac_build" as that suggests that this step was Mac-only. It isn't, it's the generic step used by all platforms. Therefore, rename accordingly. --- .github/workflows/autobuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 03c3c00168..643a5570f7 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -221,7 +221,7 @@ jobs: languages: 'cpp' - name: Build for ${{ matrix.config.config_name }} - id: step_macos_build + id: step_build if: matrix.config.cmd2_build run: ${{ matrix.config.cmd2_build }} ${{ github.workspace }} env: @@ -262,7 +262,7 @@ jobs: - name: Notarize macOS Release Build if: >- steps.step_cmd3_postbuild.outputs.artifact_1 != '' && - steps.step_macos_build.outputs.macos_signed == 'true' && + steps.step_build.outputs.macos_signed == 'true' && contains(needs.create_release.outputs.publish_to_release, 'true') id: notarize-macOS-app uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b @@ -275,7 +275,7 @@ jobs: - name: Staple macOS Release Build if: >- steps.step_cmd3_postbuild.outputs.artifact_1 != '' && - steps.step_macos_build.outputs.macos_signed == 'true' && + steps.step_build.outputs.macos_signed == 'true' && contains(needs.create_release.outputs.publish_to_release, 'true') id: staple-macOS-app uses: devbotsxyz/xcode-staple@v1