Browse Source

ci: generate assets for a pr [skip ci]

Baptiste Augrain 1 year ago
parent
commit
40c487fcf9

+ 4 - 4
.github/workflows/insider-linux.yml

@@ -6,9 +6,9 @@ on:
       release_version:
         type: string
         description: Forced release version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
   repository_dispatch:
     types: [insider]
   push:
@@ -52,7 +52,7 @@ jobs:
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: ./check_cron_or_pr.sh
 
   dependencies:
@@ -166,7 +166,7 @@ jobs:
 
       - name: Prepare assets
         run: ./prepare_assets.sh
-        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
         env:

+ 4 - 4
.github/workflows/insider-macos.yml

@@ -6,9 +6,9 @@ on:
       release_version:
         type: string
         description: Forced release version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
   repository_dispatch:
     types: [insider]
   push:
@@ -65,7 +65,7 @@ jobs:
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: . check_cron_or_pr.sh
 
       - name: Check existing VSCodium tags/releases
@@ -86,7 +86,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' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
         env:

+ 4 - 4
.github/workflows/insider-windows.yml

@@ -6,9 +6,9 @@ on:
       release_version:
         type: string
         description: Forced release version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
   repository_dispatch:
     types: [insider]
   push:
@@ -72,7 +72,7 @@ jobs:
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: ./check_cron_or_pr.sh
 
       - name: Check existing VSCodium tags/releases
@@ -91,7 +91,7 @@ jobs:
 
       - name: Prepare assets
         run: ./prepare_assets.sh
-        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
         env:

+ 35 - 4
.github/workflows/stable-linux.yml

@@ -6,9 +6,12 @@ on:
       force_version:
         type: boolean
         description: Force update version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
+      checkout_pr:
+        type: string
+        description: Checkout PR
   repository_dispatch:
     types: [stable]
   push:
@@ -44,12 +47,18 @@ jobs:
         with:
           ref: ${{ env.GITHUB_BRANCH }}
 
+      - name: Checkout PR
+        uses: dawidd6/action-checkout-pr@v1
+        with:
+          pr: ${{ github.event.inputs.checkout_pr }}
+        if: github.event.inputs.checkout_pr != ''
+
       - name: Clone VSCode repo
         run: ./get_repo.sh
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: ./check_cron_or_pr.sh
 
   dependencies:
@@ -77,6 +86,12 @@ jobs:
         with:
           ref: ${{ env.GITHUB_BRANCH }}
 
+      - name: Checkout PR
+        uses: dawidd6/action-checkout-pr@v1
+        with:
+          pr: ${{ github.event.inputs.checkout_pr }}
+        if: github.event.inputs.checkout_pr != ''
+
       - name: Clone VSCode repo
         run: ./get_repo.sh
 
@@ -133,6 +148,14 @@ jobs:
 
     steps:
       - uses: actions/checkout@v3
+        with:
+          ref: ${{ env.GITHUB_BRANCH }}
+
+      - name: Checkout PR
+        uses: dawidd6/action-checkout-pr@v1
+        with:
+          pr: ${{ github.event.inputs.checkout_pr }}
+        if: github.event.inputs.checkout_pr != ''
 
       - name: Clone VSCode repo
         run: ./get_repo.sh
@@ -161,7 +184,15 @@ jobs:
 
       - name: Prepare assets
         run: ./prepare_assets.sh
-        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
+
+      - name: Upload assets
+        uses: actions/upload-artifact@v3
+        with:
+          name: assets
+          path: ./assets/
+          retention-days: 3
+        if: github.event.inputs.generate_assets == 'true'
 
       - name: Release
         env:

+ 4 - 4
.github/workflows/stable-macos.yml

@@ -6,9 +6,9 @@ on:
       force_version:
         type: boolean
         description: Force update version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
   repository_dispatch:
     types: [stable]
   push:
@@ -60,7 +60,7 @@ jobs:
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: . check_cron_or_pr.sh
 
       - name: Check existing VSCodium tags/releases
@@ -81,7 +81,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' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
         env:

+ 4 - 4
.github/workflows/stable-windows.yml

@@ -6,9 +6,9 @@ on:
       force_version:
         type: boolean
         description: Force update version
-      test_asset_builder:
+      generate_assets:
         type: boolean
-        description: Test the assets builder
+        description: Generate assets
   repository_dispatch:
     types: [stable]
   push:
@@ -68,7 +68,7 @@ jobs:
 
       - name: Check PR or cron
         env:
-          TEST_ASSET_BUILDER: ${{ github.event.inputs.test_asset_builder }}
+          GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
         run: ./check_cron_or_pr.sh
 
       - name: Check existing VSCodium tags/releases
@@ -88,7 +88,7 @@ jobs:
 
       - name: Prepare assets
         run: ./prepare_assets.sh
-        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.test_asset_builder == 'true')
+        if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
         env:

+ 2 - 2
check_cron_or_pr.sh

@@ -14,8 +14,8 @@ elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
 	export SHOULD_BUILD="yes"
 	export SHOULD_DEPLOY="no"
 elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
-  if [[ "${TEST_ASSET_BUILDER}" == "true" ]]; then
-    echo "It's testing the assets builder"
+  if [[ "${GENERATE_ASSETS}" == "true" ]]; then
+    echo "It will generate the assets"
 
     export SHOULD_BUILD="yes"
     export SHOULD_DEPLOY="no"