From 3b86373e7ca8119d788f2bf8ab54fc809eb67ed6 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 22 Feb 2024 13:34:57 +0100 Subject: [PATCH] ci(linux): regroup checks [skip ci] --- .github/workflows/insider-linux.yml | 30 +++++++++++++++-------------- check_cron_or_pr.sh | 7 +------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/insider-linux.yml b/.github/workflows/insider-linux.yml index bae91ec..3a69892 100644 --- a/.github/workflows/insider-linux.yml +++ b/.github/workflows/insider-linux.yml @@ -55,6 +55,12 @@ jobs: GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }} run: ./check_cron_or_pr.sh + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHECK_ASSETS: 'no' + run: ./check_tags.sh + compile: needs: - check @@ -91,12 +97,6 @@ jobs: - name: Clone VSCode repo run: ./get_repo.sh - - name: Check existing VSCodium tags/releases - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECK_ASSETS: 'no' - run: ./check_tags.sh - - name: Build run: ./build.sh @@ -180,21 +180,21 @@ jobs: env: SHOULD_BUILD_REH: 'no' run: ./prepare_assets.sh - if: env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true' + if: (env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes') || github.event.inputs.generate_assets == 'true' - name: Release env: GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} run: ./release.sh - if: env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' - name: Update versions repo env: GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} run: ./update_version.sh - if: env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' - name: Upload assets uses: actions/upload-artifact@v3 @@ -262,7 +262,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} run: ./release.sh - if: env.SHOULD_DEPLOY == 'yes' + if: env.SHOULD_BUILD_REH != 'no' && env.SHOULD_DEPLOY == 'yes' - name: Upload assets uses: actions/upload-artifact@v3 @@ -274,6 +274,7 @@ jobs: aur: needs: + - check - build runs-on: ubuntu-latest strategy: @@ -282,12 +283,12 @@ jobs: include: - package_name: vscodium-insiders-bin - package_name: vscodium-insiders - if: needs.build.outputs.SHOULD_DEPLOY == 'yes' + if: needs.check.outputs.SHOULD_DEPLOY == 'yes' steps: - name: Get version env: - RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }} + RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }} run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}" - name: Publish ${{ matrix.package_name }} @@ -301,17 +302,18 @@ jobs: snap: needs: + - check - build runs-on: ubuntu-latest env: - RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }} + RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }} strategy: fail-fast: false matrix: platform: - amd64 - arm64 - # if: needs.build.outputs.SHOULD_DEPLOY == 'yes' + # if: needs.check.outputs.SHOULD_DEPLOY == 'yes' if: false steps: diff --git a/check_cron_or_pr.sh b/check_cron_or_pr.sh index 15c52f7..1b4eec6 100755 --- a/check_cron_or_pr.sh +++ b/check_cron_or_pr.sh @@ -6,12 +6,7 @@ set -e if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then echo "It's a PR" - if [[ "${OS_NAME}" != "linux" || "${VSCODE_ARCH}" == "x64" ]]; then - export SHOULD_BUILD="yes" - else - export SHOULD_BUILD="no" - fi - + export SHOULD_BUILD="yes" export SHOULD_DEPLOY="no" elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then echo "It's a Push"