From f51c90526f049e1683856ea57e6fd3c7caf19678 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Fri, 4 Aug 2023 14:36:30 +0200 Subject: [PATCH] feat: add flag to test assets builder in CI (#1590) --- .github/workflows/insider-linux.yml | 7 ++++++- .github/workflows/insider-macos.yml | 7 ++++++- .github/workflows/insider-windows.yml | 7 ++++++- .github/workflows/stable-linux.yml | 7 ++++++- .github/workflows/stable-macos.yml | 7 ++++++- .github/workflows/stable-windows.yml | 7 ++++++- check_cron_or_pr.sh | 13 ++++++++++--- 7 files changed, 46 insertions(+), 9 deletions(-) diff --git a/.github/workflows/insider-linux.yml b/.github/workflows/insider-linux.yml index 8fc9b60..9027ce2 100644 --- a/.github/workflows/insider-linux.yml +++ b/.github/workflows/insider-linux.yml @@ -9,6 +9,9 @@ on: new_release: type: boolean description: Force new Release + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 8 * * *' push: @@ -51,6 +54,8 @@ jobs: run: ./get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: ./check_cron_or_pr.sh dependencies: @@ -181,7 +186,7 @@ jobs: - name: Prepare assets run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/.github/workflows/insider-macos.yml b/.github/workflows/insider-macos.yml index 450b8bc..f2903b6 100644 --- a/.github/workflows/insider-macos.yml +++ b/.github/workflows/insider-macos.yml @@ -9,6 +9,9 @@ on: new_release: type: boolean description: Force new Release + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 8 * * *' push: @@ -58,6 +61,8 @@ jobs: run: . get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: . check_cron_or_pr.sh - name: Check existing VSCodium tags/releases @@ -79,7 +84,7 @@ jobs: CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }} run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/.github/workflows/insider-windows.yml b/.github/workflows/insider-windows.yml index 509ff47..8518393 100644 --- a/.github/workflows/insider-windows.yml +++ b/.github/workflows/insider-windows.yml @@ -9,6 +9,9 @@ on: new_release: type: boolean description: Force new Release + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 8 * * *' push: @@ -71,6 +74,8 @@ jobs: run: ./get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: ./check_cron_or_pr.sh - name: Check existing VSCodium tags/releases @@ -90,7 +95,7 @@ jobs: - name: Prepare assets run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/.github/workflows/stable-linux.yml b/.github/workflows/stable-linux.yml index eb44b00..59b368e 100644 --- a/.github/workflows/stable-linux.yml +++ b/.github/workflows/stable-linux.yml @@ -9,6 +9,9 @@ on: force_version: type: boolean description: Force update version + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 18 * * *' push: @@ -48,6 +51,8 @@ jobs: run: ./get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: ./check_cron_or_pr.sh dependencies: @@ -176,7 +181,7 @@ jobs: - name: Prepare assets run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/.github/workflows/stable-macos.yml b/.github/workflows/stable-macos.yml index 0daf06c..27ed3b9 100644 --- a/.github/workflows/stable-macos.yml +++ b/.github/workflows/stable-macos.yml @@ -9,6 +9,9 @@ on: force_version: type: boolean description: Force update version + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 18 * * *' push: @@ -53,6 +56,8 @@ jobs: run: . get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: . check_cron_or_pr.sh - name: Check existing VSCodium tags/releases @@ -74,7 +79,7 @@ jobs: CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }} run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/.github/workflows/stable-windows.yml b/.github/workflows/stable-windows.yml index e4d27d9..94e1d34 100644 --- a/.github/workflows/stable-windows.yml +++ b/.github/workflows/stable-windows.yml @@ -9,6 +9,9 @@ on: force_version: type: boolean description: Force update version + test_asset_builder: + type: boolean + description: Test the assets builder schedule: - cron: '0 18 * * *' push: @@ -67,6 +70,8 @@ jobs: run: ./get_repo.sh - name: Check PR or cron + env: + TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }} run: ./check_cron_or_pr.sh - name: Check existing VSCodium tags/releases @@ -86,7 +91,7 @@ jobs: - name: Prepare assets run: ./prepare_assets.sh - if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true') - name: Release env: diff --git a/check_cron_or_pr.sh b/check_cron_or_pr.sh index b140ec3..6a858a6 100755 --- a/check_cron_or_pr.sh +++ b/check_cron_or_pr.sh @@ -14,16 +14,23 @@ elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then export SHOULD_BUILD="yes" export SHOULD_DEPLOY="no" elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then - echo "It's a Dispatch" + if [[ "${TEST_ASSET_BUILDER}" == "true" ]]; then + echo "It's testing the assets builder" - export SHOULD_DEPLOY="yes" + export SHOULD_BUILD="yes" + export SHOULD_DEPLOY="no" + else + echo "It's a Dispatch" + + export SHOULD_DEPLOY="yes" + fi else echo "It's a Cron" export SHOULD_DEPLOY="yes" fi -if [[ "${GITHUB_ENV}" ]]; then +if [[ "${GITHUB_ENV}" ]]; then echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> "${GITHUB_ENV}" echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}" echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"