From 36809ea14b6a58670c74c5ac069760b4e4d9f42b Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 09:53:10 +0100 Subject: [PATCH 01/14] Autobuild: Derive all step commands from a base_command Previously, the build matrix had to provide three different command lines for the three different build steps. As all command invocations are normalized across platforms now, we can condense that into a base_command per matrix entry and will just add the build stage as a parameter in the generic invocation. This allows removal of several lines of definitions and makes the workflow more readable/maintenable. Related: #2503 --- .github/workflows/autobuild.yml | 79 +++++++++++++-------------------- 1 file changed, 30 insertions(+), 49 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index e8569b95e1..68a3f224ee 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -87,9 +87,7 @@ jobs: - config_name: Android .apk (artifact+codeQL) target_os: android building_on_os: ubuntu-20.04 - cmd1_prebuild: "./.github/autobuild/android.sh setup" - cmd2_build: "./.github/autobuild/android.sh build" - cmd3_postbuild: "./.github/autobuild/android.sh get-artifacts" + base_command: ./.github/autobuild/android.sh run_codeql: true # Jamulus.pro needs to count git history length for android versioning: checkout_fetch_depth: '0' @@ -97,35 +95,27 @@ jobs: - config_name: Linux .deb amd64 (artifacts+codeQL) target_os: linux building_on_os: ubuntu-18.04 - cmd1_prebuild: ./.github/autobuild/linux_deb.sh setup - cmd2_build: ./.github/autobuild/linux_deb.sh build - cmd3_postbuild: ./.github/autobuild/linux_deb.sh get-artifacts + base_command: ./.github/autobuild/linux_deb.sh run_codeql: true - config_name: Linux .deb armhf (artifacts) target_os: linux building_on_os: ubuntu-18.04 - cmd1_prebuild: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh setup - cmd2_build: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh build - cmd3_postbuild: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh get-artifacts + base_command: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh run_codeql: false - config_name: MacOS (artifacts+codeQL) 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: "QT_VERSION=5.15.2 SIGN_IF_POSSIBLE=1 ./.github/autobuild/mac.sh setup" - cmd2_build: "QT_VERSION=5.15.2 SIGN_IF_POSSIBLE=1 ./.github/autobuild/mac.sh build" - cmd3_postbuild: "QT_VERSION=5.15.2 SIGN_IF_POSSIBLE=1 ./.github/autobuild/mac.sh get-artifacts" + base_command: QT_VERSION=5.15.2 SIGN_IF_POSSIBLE=1 ./.github/autobuild/mac.sh run_codeql: true xcode_version: 12.1.1 - config_name: MacOS Legacy (artifacts) target_os: macos building_on_os: macos-10.15 - cmd1_prebuild: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh setup" - cmd2_build: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh build" - cmd3_postbuild: "QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh get-artifacts" + base_command: QT_VERSION=5.9.9 SIGN_IF_POSSIBLE=0 ARTIFACT_SUFFIX=_legacy ./.github/autobuild/mac.sh 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: @@ -137,9 +127,7 @@ jobs: - config_name: iOS (artifacts) target_os: ios building_on_os: macos-10.15 - cmd1_prebuild: "QT_VERSION=5.15.2 ./.github/autobuild/ios.sh setup" - cmd2_build: "QT_VERSION=5.15.2 ./.github/autobuild/ios.sh build" - cmd3_postbuild: "QT_VERSION=5.15.2 ./.github/autobuild/ios.sh get-artifacts" + base_command: QT_VERSION=5.15.2 ./.github/autobuild/ios.sh # Build failed with CodeQL enabled when last tested 03/2022 (#2490). # There are no hints that iOS is supposed to be supported by CodeQL. # Therefore, disable it: @@ -149,17 +137,13 @@ jobs: - config_name: Windows (artifact+codeQL) target_os: windows building_on_os: windows-2019 - cmd1_prebuild: powershell .\.github\autobuild\windows.ps1 -Stage setup - cmd2_build: powershell .\.github\autobuild\windows.ps1 -Stage build -GithubWorkspace - cmd3_postbuild: powershell .\.github\autobuild\windows.ps1 -Stage get-artifacts -GithubWorkspace + base_command: powershell .\.github\autobuild\windows.ps1 -Stage run_codeql: true - config_name: Windows JACK (artifact) target_os: windows building_on_os: windows-2019 - cmd1_prebuild: powershell .\.github\autobuild\windows.ps1 -BuildOption jackonwindows -Stage setup - cmd2_build: powershell .\.github\autobuild\windows.ps1 -BuildOption jackonwindows -Stage build -GithubWorkspace - cmd3_postbuild: powershell .\.github\autobuild\windows.ps1 -BuildOption jackonwindows -Stage get-artifacts -GithubWorkspace + base_command: powershell .\.github\autobuild\windows.ps1 -BuildOption jackonwindows -Stage run_codeql: false runs-on: ${{ matrix.config.building_on_os }} @@ -183,7 +167,7 @@ jobs: path: | /usr/local/opt/qt ~/Library/Cache/jamulus-homebrew-bottles - key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/mac/autobuild_mac_1_prepare.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.cmd1_prebuild }} + key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/mac/autobuild_mac_1_prepare.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }} - name: Cache Windows dependencies if: matrix.config.target_os == 'windows' @@ -194,7 +178,7 @@ jobs: C:\ChocoCache ~\windows\NSIS ~\windows\ASIOSDK2 - key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/windows.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.cmd1_prebuild }} + key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', 'autobuild/windows.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.base_command }} - name: Cache Android dependencies if: matrix.config.target_os == 'android' @@ -204,11 +188,10 @@ jobs: /opt/Qt /opt/android/android-sdk /opt/android/android-ndk - key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/android.sh') }}-${{ matrix.config.cmd1_prebuild }} + key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/android.sh') }}-${{ matrix.config.base_command }} - name: Set up build dependencies for ${{ matrix.config.config_name }} - if: matrix.config.cmd1_prebuild - run: ${{ matrix.config.cmd1_prebuild }} + run: ${{ matrix.config.base_command }} setup env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' # allow setting environment variables jamulus_project_path: ${{ github.workspace }} @@ -221,9 +204,8 @@ jobs: languages: 'cpp' - name: Build for ${{ matrix.config.config_name }} - id: step_build - if: matrix.config.cmd2_build - run: ${{ matrix.config.cmd2_build }} ${{ github.workspace }} + id: build + run: ${{ matrix.config.base_command }} build env: jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} @@ -234,9 +216,8 @@ jobs: KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - name: Post-Build for ${{ matrix.config.config_name }} - id: step_cmd3_postbuild - if: matrix.config.cmd3_postbuild - run: ${{ matrix.config.cmd3_postbuild }} ${{ github.workspace }} + id: get-artifacts + run: ${{ matrix.config.base_command }} get-artifacts env: jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} @@ -246,40 +227,40 @@ jobs: # If the artifact is missing, this should fail. uses: actions/upload-artifact@v2 with: - name: ${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} - path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_1 }} + name: ${{ steps.get-artifacts.outputs.artifact_1 }} + path: deploy/${{ steps.get-artifacts.outputs.artifact_1 }} retention-days: 31 if-no-files-found: error - name: Upload Artifact 2 to Job - if: steps.step_cmd3_postbuild.outputs.artifact_2 + if: steps.get-artifacts.outputs.artifact_2 uses: actions/upload-artifact@v2 with: - name: ${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} - path: deploy/${{ steps.step_cmd3_postbuild.outputs.artifact_2 }} + name: ${{ steps.get-artifacts.outputs.artifact_2 }} + path: deploy/${{ steps.get-artifacts.outputs.artifact_2 }} retention-days: 31 if-no-files-found: error - name: Notarize macOS Release Build if: >- - steps.step_build.outputs.macos_signed == 'true' && + steps.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 }} + product-path: deploy/${{ steps.get-artifacts.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_build.outputs.macos_signed == 'true' && + steps.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.get-artifacts.outputs.artifact_1 }} - name: Upload Artifact 1 to Release # Every build job has at least one artifact. Therefore, no `if artifact_1` condition here. @@ -291,13 +272,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: 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_path: deploy/${{ steps.get-artifacts.outputs.artifact_1 }} + asset_name: ${{ steps.get-artifacts.outputs.artifact_1 }} asset_content_type: application/octet-stream - name: Upload Artifact 2 to Release if: >- - steps.step_cmd3_postbuild.outputs.artifact_2 != '' && + steps.get-artifacts.outputs.artifact_2 != '' && contains(needs.create_release.outputs.publish_to_release, 'true') id: upload-release-asset2 uses: actions/upload-release-asset@v1 @@ -305,8 +286,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: 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_path: deploy/${{ steps.get-artifacts.outputs.artifact_2 }} + asset_name: ${{ steps.get-artifacts.outputs.artifact_2 }} asset_content_type: application/octet-stream - name: Perform CodeQL Analysis From b3f9c2c352cc07b17a6c2a3a1fd210e0bac65818 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 09:58:06 +0100 Subject: [PATCH 02/14] Autobuild: Drop irregular contains() usage from Workflow The Workflow used the contains() function in multiple places. contains() will either perform an in-array check or a substring check [1]. We are not dealing with arrays, nor do we want a substring check when checking for 'true'. Therefore, use an ordinary string comparison here which is more readable anyways. [1] https://docs.github.com/en/actions/learn-github-actions/expressions#contains Related: #2503 --- .github/workflows/autobuild.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 68a3f224ee..c6ed7370b4 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -52,7 +52,7 @@ jobs: id: jamulus-build-vars - name: Remove release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}}, if existing - if: contains(steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE, 'true') + if: steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' continue-on-error: true uses: dev-drprasad/delete-tag-and-release@v0.1.2 with: @@ -62,7 +62,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: steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' id: create_release_step uses: actions/create-release@v1 env: @@ -244,7 +244,7 @@ jobs: - name: Notarize macOS Release Build if: >- steps.build.outputs.macos_signed == 'true' && - contains(needs.create_release.outputs.publish_to_release, 'true') + needs.create_release.outputs.publish_to_release == 'true' id: notarize-macOS-app uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b with: @@ -256,7 +256,7 @@ jobs: - name: Staple macOS Release Build if: >- steps.build.outputs.macos_signed == 'true' && - contains(needs.create_release.outputs.publish_to_release, 'true') + needs.create_release.outputs.publish_to_release == 'true' id: staple-macOS-app uses: devbotsxyz/xcode-staple@v1 with: @@ -265,7 +265,7 @@ jobs: - name: Upload Artifact 1 to Release # Every build job has at least one artifact. Therefore, no `if artifact_1` condition here. # If the artifact is missing, this should fail. - if: contains(needs.create_release.outputs.publish_to_release, 'true') + if: needs.create_release.outputs.publish_to_release == 'true' id: upload-release-asset1 uses: actions/upload-release-asset@v1 env: @@ -279,7 +279,7 @@ jobs: - name: Upload Artifact 2 to Release if: >- steps.get-artifacts.outputs.artifact_2 != '' && - contains(needs.create_release.outputs.publish_to_release, 'true') + needs.create_release.outputs.publish_to_release == 'true' id: upload-release-asset2 uses: actions/upload-release-asset@v1 env: From 0fe908c62448e0416c0d0440963bcec29e32028f Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:00:15 +0100 Subject: [PATCH 03/14] Autobuild: Drop jamulus_project_path from Workflow The previous refactorings have adjusted all platform autobuild scripts to stop using this variable. Therefore, we can now safely drop the definition from the Workflow. Related: #2503 --- .github/workflows/autobuild.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index c6ed7370b4..f46cbadf60 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -194,7 +194,6 @@ jobs: run: ${{ matrix.config.base_command }} setup env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' # allow setting environment variables - jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - name: Initialize CodeQL @@ -207,7 +206,6 @@ jobs: id: build run: ${{ matrix.config.base_command }} build env: - jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT}} MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERT_PWD }} @@ -219,7 +217,6 @@ jobs: id: get-artifacts run: ${{ matrix.config.base_command }} get-artifacts env: - jamulus_project_path: ${{ github.workspace }} jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - name: Upload Artifact 1 to Job From 5100ebc762f0b4f52902325d217a14e6d5ead830 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:02:30 +0100 Subject: [PATCH 04/14] Autobuild: Mac: Set PATH before build step directly There's no need to set PATH in the prepare step, pass it back to the workflow, let the workflow pass it back to the build stage and use it only then. Therefore, just set PATH right before it's needed in the build step and drop the Github logic. Related: #2503 --- .github/autobuild/mac.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index b1c9955f86..d81ecc1ab7 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -21,11 +21,6 @@ setup() { python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}" python3 -m aqt install-qt --outputdir "${QT_DIR}" mac desktop "${QT_VERSION}" --archives qtbase qttools qttranslations qtmacextras fi - - # Add the qt binaries to the PATH. - # The clang_64 entry can be dropped when Qt <6.2 compatibility is no longer needed. - export PATH="${QT_DIR}/${QT_VERSION}/macos/bin:${QT_DIR}/${QT_VERSION}/clang_64/bin:${PATH}" - echo "::set-env name=PATH::${PATH}" } prepare_signing() { @@ -56,6 +51,10 @@ prepare_signing() { } build_app_as_dmg_installer() { + # Add the qt binaries to the PATH. + # The clang_64 entry can be dropped when Qt <6.2 compatibility is no longer needed. + export PATH="${QT_DIR}/${QT_VERSION}/macos/bin:${QT_DIR}/${QT_VERSION}/clang_64/bin:${PATH}" + # Mac's bash version considers BUILD_ARGS unset without at least one entry: BUILD_ARGS=("") if prepare_signing; then From edb549c7231e2477da428c90127305cfcce6742a Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:03:50 +0100 Subject: [PATCH 05/14] Autobuild: Workflow: Drop discouraged ACTIONS_ALLOW_UNSECURE_COMMANDS As no autobuild scripts require setting environment variables across build steps anymore, we can now safely drop this discouraged configuration. In case we ever need to set environment variables across steps again, there are better ways to do that by now (env files). Related: #2503 --- .github/workflows/autobuild.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index f46cbadf60..aa322def06 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -193,7 +193,6 @@ jobs: - name: Set up build dependencies for ${{ matrix.config.config_name }} run: ${{ matrix.config.base_command }} setup env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' # allow setting environment variables jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - name: Initialize CodeQL From 5f646b6d4d6c297f03cdaa3d32a0c8e7d23a2c88 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:20:28 +0100 Subject: [PATCH 06/14] Autobuild: Rename RELEASE_VERSION_NAME -> BUILD_VERSION This renames the RELEASE_VERSION_NAME (and all calculation in analyse_git_reference.py beforehand) to BUILD_VERSION instead. The variable does not contain a name (e.g. "Jamulus"), so that's confusing. It isn't solely used for releases either, so BUILD_ seems like a better fit. Related: #2503 --- .github/actions_scripts/analyse_git_reference.py | 14 +++++++------- .github/workflows/autobuild.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions_scripts/analyse_git_reference.py b/.github/actions_scripts/analyse_git_reference.py index f2f5cc4990..d093bde21f 100755 --- a/.github/actions_scripts/analyse_git_reference.py +++ b/.github/actions_scripts/analyse_git_reference.py @@ -43,7 +43,7 @@ def write_changelog(version): f.write(changelog) -def get_release_version_name(jamulus_pro_version): +def get_build_version(jamulus_pro_version): if "dev" in jamulus_pro_version: name = "{}-{}".format(jamulus_pro_version, get_git_hash()) print("building an intermediate version: ", name) @@ -61,14 +61,14 @@ def set_github_variable(varname, varval): jamulus_pro_version = get_version_from_jamulus_pro() write_changelog(jamulus_pro_version) -release_version_name = get_release_version_name(jamulus_pro_version) +build_version = get_build_version(jamulus_pro_version) fullref = os.environ['GITHUB_REF'] publish_to_release = bool(re.match(r'^refs/tags/r\d+_\d+_\d+\S*$', fullref)) -# RELEASE_VERSION_NAME is required for all builds including branch pushes +# BUILD_VERSION is required for all builds including branch pushes # and PRs: -set_github_variable("RELEASE_VERSION_NAME", release_version_name) +set_github_variable("BUILD_VERSION", build_version) # PUBLISH_TO_RELEASE is always required as the workflow decides about further # steps based on this. It will only be true for tag pushes with a tag @@ -78,10 +78,10 @@ def set_github_variable(varname, varval): if publish_to_release: reflist = fullref.split("/", 2) release_tag = reflist[2] - release_title = f"Release {release_version_name} ({release_tag})" + release_title = f"Release {build_version} ({release_tag})" is_prerelease = not re.match(r'^r\d+_\d+_\d+$', release_tag) - if not is_prerelease and release_version_name != release_tag[1:].replace('_', '.'): - raise Exception(f"non-pre-release tag {release_tag} doesn't match Jamulus.pro VERSION = {release_version_name}") + if not is_prerelease and build_version != release_tag[1:].replace('_', '.'): + raise Exception(f"non-pre-release tag {release_tag} doesn't match Jamulus.pro VERSION = {build_version}") # Those variables are only used when a release is created at all: set_github_variable("IS_PRERELEASE", str(is_prerelease).lower()) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index aa322def06..e119b1cdba 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -41,7 +41,7 @@ jobs: 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 }} + version_name: ${{ steps.jamulus-build-vars.outputs.BUILD_VERSION }} steps: - name: Checkout code From 4ea2ff4f67247d37c7bd1106a1f6826728acf61d Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:21:50 +0100 Subject: [PATCH 07/14] Autobuild: Rename jamulus_buildversionstring -> JAMULUS_BUILD_VERSION - "string" is redundant - use uppercase as all other environment variables do - using BUILD_VERSION is consistent with the source of the variable (create-release step) - prefixing with JAMULUS_ is helpful as other versions are in play in the Workflow as well. Related: #2503 --- .github/autobuild/android.sh | 6 +++--- .github/autobuild/ios.sh | 6 +++--- .github/autobuild/linux_deb.sh | 8 ++++---- .github/autobuild/mac.sh | 6 +++--- .github/autobuild/windows.ps1 | 4 ++-- .github/workflows/autobuild.yml | 18 +++++++++--------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/autobuild/android.sh b/.github/autobuild/android.sh index 7aeb4ce82f..60ff7b8426 100755 --- a/.github/autobuild/android.sh +++ b/.github/autobuild/android.sh @@ -22,8 +22,8 @@ export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/" export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools" export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools" -if [[ ! ${jamulus_buildversionstring:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - echo "Environment variable jamulus_buildversionstring has to be set to a valid version string" +if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" exit 1 fi @@ -87,7 +87,7 @@ build_app_as_apk() { pass_artifact_to_job() { mkdir deploy - artifact_deploy_filename="jamulus_${jamulus_buildversionstring}_android.apk" + artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_android.apk" echo "Moving ${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk to deploy/${artifact_deploy_filename}" mv "./${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk" "./deploy/${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" diff --git a/.github/autobuild/ios.sh b/.github/autobuild/ios.sh index e5b21b10a5..8d5bdc8677 100755 --- a/.github/autobuild/ios.sh +++ b/.github/autobuild/ios.sh @@ -8,8 +8,8 @@ if [[ ! ${QT_VERSION:-} =~ [0-9]+\.[0-9]+\..* ]]; then echo "Environment variable QT_VERSION must be set to a valid Qt version" exit 1 fi -if [[ ! ${jamulus_buildversionstring:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - echo "Environment variable jamulus_buildversionstring has to be set to a valid version string" +if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" exit 1 fi @@ -30,7 +30,7 @@ build_app_as_ipa() { } pass_artifact_to_job() { - artifact_deploy_filename="jamulus_${jamulus_buildversionstring}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" + artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" echo "Moving build artifact to deploy/${artifact_deploy_filename}" mv ./deploy/Jamulus.ipa "./deploy/${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index 26adf41cc8..8e2e5e2a1d 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -1,8 +1,8 @@ #!/bin/bash set -eu -if [[ ! ${jamulus_buildversionstring:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - echo "Environment variable jamulus_buildversionstring has to be set to a valid version string" +if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" exit 1 fi @@ -64,12 +64,12 @@ pass_artifacts_to_job() { mkdir deploy # rename headless first, so wildcard pattern matches only one file each - artifact_deploy_filename_1="jamulus_headless_${jamulus_buildversionstring}_ubuntu_${TARGET_ARCH}.deb" + artifact_deploy_filename_1="jamulus_headless_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" echo "Moving headless build artifact to deploy/${artifact_deploy_filename_1}" mv ../jamulus-headless*"_${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_1}" echo "::set-output name=artifact_1::${artifact_deploy_filename_1}" - artifact_deploy_filename_2="jamulus_${jamulus_buildversionstring}_ubuntu_${TARGET_ARCH}.deb" + artifact_deploy_filename_2="jamulus_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" echo "Moving regular build artifact to deploy/${artifact_deploy_filename_2}" mv ../jamulus*_"${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_2}" echo "::set-output name=artifact_2::${artifact_deploy_filename_2}" diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index d81ecc1ab7..6c8f7d7826 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -8,8 +8,8 @@ if [[ ! ${QT_VERSION:-} =~ [0-9]+\.[0-9]+\..* ]]; then echo "Environment variable QT_VERSION must be set to a valid Qt version" exit 1 fi -if [[ ! ${jamulus_buildversionstring:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - echo "Environment variable jamulus_buildversionstring has to be set to a valid version string" +if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" exit 1 fi @@ -64,7 +64,7 @@ build_app_as_dmg_installer() { } pass_artifact_to_job() { - artifact_deploy_filename="jamulus_${jamulus_buildversionstring}_mac${ARTIFACT_SUFFIX:-}.dmg" + artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_mac${ARTIFACT_SUFFIX:-}.dmg" echo "Moving build artifact to deploy/${artifact_deploy_filename}" mv ./deploy/Jamulus-*installer-mac.dmg "./deploy/${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index b8bf08539e..8c09b2758f 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -24,10 +24,10 @@ $Msvc32Version = "win32_msvc2019" $Msvc64Version = "win64_msvc2019_64" $JomVersion = "1.1.2" -$JamulusVersion = $Env:jamulus_buildversionstring +$JamulusVersion = $Env:JAMULUS_BUILD_VERSION if ( $JamulusVersion -notmatch '^\d+\.\d+\.\d+.*' ) { - throw "Environment variable jamulus_buildversionstring has to be set to a valid version string" + throw "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" } Function Install-Qt diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index e119b1cdba..42f072e2a3 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -41,7 +41,7 @@ jobs: 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.BUILD_VERSION }} + build_version: ${{ steps.jamulus-build-vars.outputs.BUILD_VERSION }} steps: - name: Checkout code @@ -193,7 +193,7 @@ jobs: - name: Set up build dependencies for ${{ matrix.config.config_name }} run: ${{ matrix.config.base_command }} setup env: - jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} + JAMULUS_BUILD_VERSION: ${{ needs.create_release.outputs.build_version }} - name: Initialize CodeQL if: matrix.config.run_codeql @@ -205,18 +205,18 @@ jobs: id: build run: ${{ matrix.config.base_command }} build env: - jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} - MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT}} - MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERT_PWD }} - MACOS_CERTIFICATE_ID: ${{ secrets.MACOS_CERT_ID }} - NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + JAMULUS_BUILD_VERSION: ${{ needs.create_release.outputs.build_version }} + MACOS_CERTIFICATE: ${{ secrets.MACOS_CERT}} + MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERT_PWD }} + MACOS_CERTIFICATE_ID: ${{ secrets.MACOS_CERT_ID }} + NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - name: Post-Build for ${{ matrix.config.config_name }} id: get-artifacts run: ${{ matrix.config.base_command }} get-artifacts env: - jamulus_buildversionstring: ${{ needs.create_release.outputs.version_name }} + JAMULUS_BUILD_VERSION: ${{ needs.create_release.outputs.build_version }} - name: Upload Artifact 1 to Job # Every build job has at least one artifact. Therefore, no `if` here. From da31a1cfdbf9605a3e84599eaca1bfdcfbeebc41 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:41:14 +0100 Subject: [PATCH 08/14] Autobuild: Windows: Rename the artifact instead of copying This is more consistent with the other platforms and might be slightly faster. Related: #2503 --- .github/autobuild/windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index 8c09b2758f..071b90ea2f 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -136,10 +136,10 @@ Function Pass-Artifact-to-Job $artifact_deploy_filename = "jamulus_${JamulusVersion}_win${ArtifactSuffix}.exe" echo "Copying artifact to ${artifact_deploy_filename}" - cp ".\deploy\Jamulus*installer-win.exe" ".\deploy\${artifact_deploy_filename}" + move ".\deploy\Jamulus*installer-win.exe" ".\deploy\${artifact_deploy_filename}" if ( !$? ) { - throw "cp failed with exit code $LastExitCode" + throw "move failed with exit code $LastExitCode" } echo "Setting Github step output name=artifact_1::${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" From 358a82fc68a2b1856a775528fa6f611a826b688b Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:47:51 +0100 Subject: [PATCH 09/14] Autobuild: Windows: Use Qt version variables instead of hardcoding Related: #2503 --- .github/autobuild/windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index 071b90ea2f..e0360f7ce3 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -116,7 +116,7 @@ Function Build-App-With-Installer { $ExtraArgs += ("-BuildOption", $BuildOption) } - powershell ".\windows\deploy_windows.ps1" "C:\Qt\5.15.2" "C:\Qt\5.15.2" @ExtraArgs + powershell ".\windows\deploy_windows.ps1" "C:\Qt\${Qt32Version}" "C:\Qt\${Qt64Version}" @ExtraArgs if ( !$? ) { throw "deploy_windows.ps1 failed with exit code $LastExitCode" From 3d4e623e60eb1ec932ff89a1b7bf4237cd0b2ec4 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:51:41 +0100 Subject: [PATCH 10/14] Autobuild: Linux: Silence apt questions Related: #2503 --- .github/autobuild/linux_deb.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index 8e2e5e2a1d..c8b950d72f 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -20,6 +20,8 @@ case "${TARGET_ARCH}" in esac setup() { + export DEBIAN_FRONTEND="noninteractive" + setup_cross_compilation_apt_sources echo "Update system..." From f290811650684833c61f09ffd4ab6f7135cc6993 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 10:54:55 +0100 Subject: [PATCH 11/14] Autobuild: Improve dependency installation log messages Related: #2503 --- .github/autobuild/ios.sh | 2 +- .github/autobuild/linux_deb.sh | 4 +--- .github/autobuild/mac.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/autobuild/ios.sh b/.github/autobuild/ios.sh index 8d5bdc8677..9c59657013 100755 --- a/.github/autobuild/ios.sh +++ b/.github/autobuild/ios.sh @@ -17,7 +17,7 @@ setup() { if [[ -d "${QT_DIR}" ]]; then echo "Using Qt installation from previous run (actions/cache)" else - echo "Install dependencies..." + echo "Installing Qt" python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}" python3 -m aqt install-qt --outputdir "${QT_DIR}" mac ios "${QT_VERSION}" --archives qtbase qttools qttranslations qtmacextras fi diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index c8b950d72f..a41b0156c6 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -24,10 +24,8 @@ setup() { setup_cross_compilation_apt_sources - echo "Update system..." + echo "Installing dependencies..." sudo apt-get -qq update - - echo "Install dependencies..." sudo apt-get -qq --no-install-recommends -y install devscripts build-essential debhelper fakeroot libjack-jackd2-dev qtbase5-dev qttools5-dev-tools setup_cross_compiler diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index 6c8f7d7826..aa45444a0b 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -17,7 +17,7 @@ setup() { if [[ -d "${QT_DIR}" ]]; then echo "Using Qt installation from previous run (actions/cache)" else - echo "Install dependencies..." + echo "Installing Qt..." python3 -m pip install "aqtinstall==${AQTINSTALL_VERSION}" python3 -m aqt install-qt --outputdir "${QT_DIR}" mac desktop "${QT_VERSION}" --archives qtbase qttools qttranslations qtmacextras fi From bbcb1d56f0b836b2f645ad72af727dd9d8c3f5e2 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 11:01:18 +0100 Subject: [PATCH 12/14] Autobuild: Mark local variables as local Related: #2503 --- .github/autobuild/android.sh | 6 +++--- .github/autobuild/ios.sh | 2 +- .github/autobuild/linux_deb.sh | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/autobuild/android.sh b/.github/autobuild/android.sh index 60ff7b8426..2343e919eb 100755 --- a/.github/autobuild/android.sh +++ b/.github/autobuild/android.sh @@ -75,8 +75,8 @@ setup_qt() { } build_app_as_apk() { - QT_DIR="${QT_BASEDIR}/${QT_VERSION}/android" - MAKE="${ANDROID_NDK_ROOT}/prebuilt/${ANDROID_NDK_HOST}/bin/make" + local QT_DIR="${QT_BASEDIR}/${QT_VERSION}/android" + local MAKE="${ANDROID_NDK_ROOT}/prebuilt/${ANDROID_NDK_HOST}/bin/make" "${QT_DIR}/bin/qmake" -spec android-clang "${MAKE}" -j "$(nproc)" @@ -87,7 +87,7 @@ build_app_as_apk() { pass_artifact_to_job() { mkdir deploy - artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_android.apk" + local artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_android.apk" echo "Moving ${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk to deploy/${artifact_deploy_filename}" mv "./${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk" "./deploy/${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" diff --git a/.github/autobuild/ios.sh b/.github/autobuild/ios.sh index 9c59657013..979c0cbc90 100755 --- a/.github/autobuild/ios.sh +++ b/.github/autobuild/ios.sh @@ -30,7 +30,7 @@ build_app_as_ipa() { } pass_artifact_to_job() { - artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" + local artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" echo "Moving build artifact to deploy/${artifact_deploy_filename}" mv ./deploy/Jamulus.ipa "./deploy/${artifact_deploy_filename}" echo "::set-output name=artifact_1::${artifact_deploy_filename}" diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index a41b0156c6..2ccec165ed 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -44,7 +44,7 @@ setup_cross_compiler() { if [[ "${TARGET_ARCH}" == amd64 ]]; then return fi - GCC_VERSION=7 # 7 is the default on 18.04, there is no reason not to update once 18.04 is out of support + local GCC_VERSION=7 # 7 is the default on 18.04, there is no reason not to update once 18.04 is out of support sudo apt install -qq -y --no-install-recommends "g++-${GCC_VERSION}-${ABI_NAME}" "qt5-qmake:${TARGET_ARCH}" "qtbase5-dev:${TARGET_ARCH}" "libjack-jackd2-dev:${TARGET_ARCH}" sudo update-alternatives --install "/usr/bin/${ABI_NAME}-g++" g++ "/usr/bin/${ABI_NAME}-g++-${GCC_VERSION}" 10 sudo update-alternatives --install "/usr/bin/${ABI_NAME}-gcc" gcc "/usr/bin/${ABI_NAME}-gcc-${GCC_VERSION}" 10 @@ -64,12 +64,12 @@ pass_artifacts_to_job() { mkdir deploy # rename headless first, so wildcard pattern matches only one file each - artifact_deploy_filename_1="jamulus_headless_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" + local artifact_deploy_filename_1="jamulus_headless_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" echo "Moving headless build artifact to deploy/${artifact_deploy_filename_1}" mv ../jamulus-headless*"_${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_1}" echo "::set-output name=artifact_1::${artifact_deploy_filename_1}" - artifact_deploy_filename_2="jamulus_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" + local artifact_deploy_filename_2="jamulus_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" echo "Moving regular build artifact to deploy/${artifact_deploy_filename_2}" mv ../jamulus*_"${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_2}" echo "::set-output name=artifact_2::${artifact_deploy_filename_2}" From 6612d2d7912c54f6dc4ee75fa4033808b4a05806 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 11:09:18 +0100 Subject: [PATCH 13/14] Autobuild: Workflow: Unify id naming scheme Related: #2503 --- .github/workflows/autobuild.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 42f072e2a3..1aa4e7354f 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -39,9 +39,9 @@ jobs: name: Build vars & Github release (if required) 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 }} - build_version: ${{ steps.jamulus-build-vars.outputs.BUILD_VERSION }} + publish_to_release: ${{ steps.get-build-vars.outputs.PUBLISH_TO_RELEASE }} + upload_url: ${{ steps.create-release.outputs.upload_url }} + build_version: ${{ steps.get-build-vars.outputs.BUILD_VERSION }} steps: - name: Checkout code @@ -49,29 +49,29 @@ jobs: - 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 + id: get-build-vars - - name: Remove release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}}, if existing - if: steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' + - name: Remove release ${{steps.get-build-vars.outputs.RELEASE_TAG}}, if existing + if: steps.get-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 }} + tag_name: ${{ steps.get-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: steps.jamulus-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' - id: create_release_step + - name: Create Release ${{steps.get-build-vars.outputs.RELEASE_TAG}} ${{steps.get-build-vars.outputs.RELEASE_TITLE}} + if: steps.get-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' + id: create-release 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 }} + tag_name: ${{ steps.get-build-vars.outputs.RELEASE_TAG }} + release_name: ${{ steps.get-build-vars.outputs.RELEASE_TITLE }} body_path: ${{ github.workspace }}/autoLatestChangelog.md - prerelease: ${{ steps.jamulus-build-vars.outputs.IS_PRERELEASE }} + prerelease: ${{ steps.get-build-vars.outputs.IS_PRERELEASE }} draft: false From f3ed7991ce4685a8fff3f94573b25d8e4e4f5b02 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 23 Mar 2022 12:08:31 +0100 Subject: [PATCH 14/14] Autobuild: Shorten artifact_deploy_filename variable name Related: #2503 --- .github/autobuild/android.sh | 8 ++++---- .github/autobuild/ios.sh | 8 ++++---- .github/autobuild/linux_deb.sh | 16 ++++++++-------- .github/autobuild/mac.sh | 8 ++++---- .github/autobuild/windows.ps1 | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/autobuild/android.sh b/.github/autobuild/android.sh index 2343e919eb..aceb565837 100755 --- a/.github/autobuild/android.sh +++ b/.github/autobuild/android.sh @@ -87,10 +87,10 @@ build_app_as_apk() { pass_artifact_to_job() { mkdir deploy - local artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_android.apk" - echo "Moving ${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk to deploy/${artifact_deploy_filename}" - mv "./${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk" "./deploy/${artifact_deploy_filename}" - echo "::set-output name=artifact_1::${artifact_deploy_filename}" + local artifact="jamulus_${JAMULUS_BUILD_VERSION}_android.apk" + echo "Moving ${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk to deploy/${artifact}" + mv "./${BUILD_DIR}/build/outputs/apk/debug/build-debug.apk" "./deploy/${artifact}" + echo "::set-output name=artifact_1::${artifact}" } case "${1:-}" in diff --git a/.github/autobuild/ios.sh b/.github/autobuild/ios.sh index 979c0cbc90..011379fe5f 100755 --- a/.github/autobuild/ios.sh +++ b/.github/autobuild/ios.sh @@ -30,10 +30,10 @@ build_app_as_ipa() { } pass_artifact_to_job() { - local artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" - echo "Moving build artifact to deploy/${artifact_deploy_filename}" - mv ./deploy/Jamulus.ipa "./deploy/${artifact_deploy_filename}" - echo "::set-output name=artifact_1::${artifact_deploy_filename}" + local artifact="jamulus_${JAMULUS_BUILD_VERSION}_iOSUnsigned${ARTIFACT_SUFFIX:-1}.ipa" + echo "Moving build artifact to deploy/${artifact}" + mv ./deploy/Jamulus.ipa "./deploy/${artifact}" + echo "::set-output name=artifact_1::${artifact}" } case "${1:-}" in diff --git a/.github/autobuild/linux_deb.sh b/.github/autobuild/linux_deb.sh index 2ccec165ed..21047719d0 100755 --- a/.github/autobuild/linux_deb.sh +++ b/.github/autobuild/linux_deb.sh @@ -64,15 +64,15 @@ pass_artifacts_to_job() { mkdir deploy # rename headless first, so wildcard pattern matches only one file each - local artifact_deploy_filename_1="jamulus_headless_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" - echo "Moving headless build artifact to deploy/${artifact_deploy_filename_1}" - mv ../jamulus-headless*"_${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_1}" - echo "::set-output name=artifact_1::${artifact_deploy_filename_1}" + local artifact_1="jamulus_headless_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" + echo "Moving headless build artifact to deploy/${artifact_1}" + mv ../jamulus-headless*"_${TARGET_ARCH}.deb" "./deploy/${artifact_1}" + echo "::set-output name=artifact_1::${artifact_1}" - local artifact_deploy_filename_2="jamulus_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" - echo "Moving regular build artifact to deploy/${artifact_deploy_filename_2}" - mv ../jamulus*_"${TARGET_ARCH}.deb" "./deploy/${artifact_deploy_filename_2}" - echo "::set-output name=artifact_2::${artifact_deploy_filename_2}" + local artifact_2="jamulus_${JAMULUS_BUILD_VERSION}_ubuntu_${TARGET_ARCH}.deb" + echo "Moving regular build artifact to deploy/${artifact_2}" + mv ../jamulus*_"${TARGET_ARCH}.deb" "./deploy/${artifact_2}" + echo "::set-output name=artifact_2::${artifact_2}" } case "${1:-}" in diff --git a/.github/autobuild/mac.sh b/.github/autobuild/mac.sh index aa45444a0b..a38cc393e7 100755 --- a/.github/autobuild/mac.sh +++ b/.github/autobuild/mac.sh @@ -64,10 +64,10 @@ build_app_as_dmg_installer() { } pass_artifact_to_job() { - artifact_deploy_filename="jamulus_${JAMULUS_BUILD_VERSION}_mac${ARTIFACT_SUFFIX:-}.dmg" - echo "Moving build artifact to deploy/${artifact_deploy_filename}" - mv ./deploy/Jamulus-*installer-mac.dmg "./deploy/${artifact_deploy_filename}" - echo "::set-output name=artifact_1::${artifact_deploy_filename}" + artifact="jamulus_${JAMULUS_BUILD_VERSION}_mac${ARTIFACT_SUFFIX:-}.dmg" + echo "Moving build artifact to deploy/${artifact}" + mv ./deploy/Jamulus-*installer-mac.dmg "./deploy/${artifact}" + echo "::set-output name=artifact_1::${artifact}" } case "${1:-}" in diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index e0360f7ce3..ace3808658 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -133,16 +133,16 @@ Function Pass-Artifact-to-Job default { "" } } - $artifact_deploy_filename = "jamulus_${JamulusVersion}_win${ArtifactSuffix}.exe" + $artifact = "jamulus_${JamulusVersion}_win${ArtifactSuffix}.exe" - echo "Copying artifact to ${artifact_deploy_filename}" - move ".\deploy\Jamulus*installer-win.exe" ".\deploy\${artifact_deploy_filename}" + echo "Copying artifact to ${artifact}" + move ".\deploy\Jamulus*installer-win.exe" ".\deploy\${artifact}" if ( !$? ) { throw "move failed with exit code $LastExitCode" } - echo "Setting Github step output name=artifact_1::${artifact_deploy_filename}" - echo "::set-output name=artifact_1::${artifact_deploy_filename}" + echo "Setting Github step output name=artifact_1::${artifact}" + echo "::set-output name=artifact_1::${artifact}" } switch ( $Stage )