Browse Source

ci: add flag to disable reh build

Baptiste Augrain 7 months ago
parent
commit
773b81f25f
1 changed files with 18 additions and 6 deletions
  1. 18 6
      .github/workflows/insider-linux.yml

+ 18 - 6
.github/workflows/insider-linux.yml

@@ -283,66 +283,78 @@ jobs:
       SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
       SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
       SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
       SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
       VSCODE_ARCH: ${{ matrix.vscode_arch }}
       VSCODE_ARCH: ${{ matrix.vscode_arch }}
-    if: (needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true') && vars[format('DISABLE_INSIDER_LINUX_REH_{0}', matrix.slug)] != 'yes'
+    if: needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
 
 
     steps:
     steps:
+      - name: Check if can run
+        run: |
+          echo "ABORT=yes" >> $GITHUB_ENV
+        if: vars[format('DISABLE_INSIDER_LINUX_REH_{0}', matrix.slug)] != 'yes'
+
       - uses: actions/checkout@v3
       - uses: actions/checkout@v3
         with:
         with:
           ref: ${{ env.GITHUB_BRANCH }}
           ref: ${{ env.GITHUB_BRANCH }}
+        if: env.ABORT != 'yes'
 
 
       - name: Switch to relevant branch
       - name: Switch to relevant branch
         env:
         env:
           PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
           PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
         run: ./get_pr.sh
         run: ./get_pr.sh
+        if: env.ABORT != 'yes'
 
 
       - name: Setup GCC
       - name: Setup GCC
         uses: egor-tensin/setup-gcc@v1
         uses: egor-tensin/setup-gcc@v1
         with:
         with:
           version: 10
           version: 10
           platform: x64
           platform: x64
+        if: env.ABORT != 'yes'
 
 
       - name: Setup Node.js environment
       - name: Setup Node.js environment
         uses: actions/setup-node@v4
         uses: actions/setup-node@v4
         with:
         with:
           node-version: '20.17'
           node-version: '20.17'
+        if: env.ABORT != 'yes'
 
 
       - name: Setup Python 3
       - name: Setup Python 3
         uses: actions/setup-python@v5
         uses: actions/setup-python@v5
         with:
         with:
           python-version: '3.11'
           python-version: '3.11'
+        if: env.ABORT != 'yes'
 
 
       - name: Install libkrb5-dev
       - name: Install libkrb5-dev
         run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
         run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
+        if: env.ABORT != 'yes'
 
 
       - name: Install GH
       - name: Install GH
         run: ./install_gh.sh
         run: ./install_gh.sh
-        if: env.SHOULD_DEPLOY == 'yes'
+        if: env.ABORT != 'yes' && env.SHOULD_DEPLOY == 'yes'
 
 
       - name: Check existing VSCodium tags/releases
       - name: Check existing VSCodium tags/releases
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           CHECK_ONLY_REH: 'yes'
           CHECK_ONLY_REH: 'yes'
         run: ./check_tags.sh
         run: ./check_tags.sh
+        if: env.ABORT != 'yes'
 
 
       - name: Download vscode artifact
       - name: Download vscode artifact
         uses: actions/download-artifact@v3
         uses: actions/download-artifact@v3
         with:
         with:
           name: vscode
           name: vscode
-        if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true'
+        if: env.ABORT != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
 
 
       - name: Build
       - name: Build
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
           npm_config_arch: ${{ matrix.npm_arch }}
         run: ./package_linux_reh.sh
         run: ./package_linux_reh.sh
-        if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true'
+        if: env.ABORT != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
 
 
       - name: Release
       - name: Release
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
           GITHUB_USERNAME: ${{ github.repository_owner }}
           GITHUB_USERNAME: ${{ github.repository_owner }}
         run: ./release.sh
         run: ./release.sh
-        if: (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no') && env.SHOULD_DEPLOY == 'yes'
+        if: env.ABORT != 'yes' && env.SHOULD_DEPLOY == 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no')
 
 
       - name: Upload assets
       - name: Upload assets
         uses: actions/upload-artifact@v4
         uses: actions/upload-artifact@v4
@@ -350,7 +362,7 @@ jobs:
           name: reh-linux-${{ matrix.vscode_arch }}
           name: reh-linux-${{ matrix.vscode_arch }}
           path: assets/
           path: assets/
           retention-days: 3
           retention-days: 3
-        if: env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
+        if: env.ABORT != 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
 
 
   reh_alpine:
   reh_alpine:
     needs:
     needs: