瀏覽代碼

CI: use openwrt official tools container by default

Use openwrt official tools container by default.
Fork will use openwrt tools container by default.

This can be disabled by setting the option use_openwrt_container to
false for the build.yml and check-kernel-patches.yml.

The push-containers workflow is disabled on forks. The workflow can be
reenabled by commenting the condition in push-containers.yml.

Signed-off-by: Christian Marangi <[email protected]>
Christian Marangi 2 年之前
父節點
當前提交
6f89a0ca20
共有 3 個文件被更改,包括 18 次插入0 次删除
  1. 8 0
      .github/workflows/build.yml
  2. 8 0
      .github/workflows/check-kernel-patches.yml
  3. 2 0
      .github/workflows/push-containers.yml

+ 8 - 0
.github/workflows/build.yml

@@ -22,6 +22,9 @@ on:
         type: boolean
         type: boolean
       build_all_boards:
       build_all_boards:
         type: boolean
         type: boolean
+      use_openwrt_container:
+        type: boolean
+        default: true
 
 
 permissions:
 permissions:
   contents: read
   contents: read
@@ -44,6 +47,11 @@ jobs:
         run: |
         run: |
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
             | tr '[:upper:]' '[:lower:]')
             | tr '[:upper:]' '[:lower:]')
+
+          if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
+            OWNER_LC=openwrt
+          fi
+
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
 
 
       - name: Generate ccache hash
       - name: Generate ccache hash

+ 8 - 0
.github/workflows/check-kernel-patches.yml

@@ -8,6 +8,9 @@ on:
         type: string
         type: string
       testing:
       testing:
         type: boolean
         type: boolean
+      use_openwrt_container:
+        type: boolean
+        default: true
 
 
 permissions:
 permissions:
   contents: read
   contents: read
@@ -26,6 +29,11 @@ jobs:
         run: |
         run: |
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
           OWNER_LC=$(echo "${{ github.repository_owner }}" \
             | tr '[:upper:]' '[:lower:]')
             | tr '[:upper:]' '[:lower:]')
+
+          if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
+            OWNER_LC=openwrt
+          fi
+
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
           echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
 
 
       # Per branch tools container tag
       # Per branch tools container tag

+ 2 - 0
.github/workflows/push-containers.yml

@@ -18,6 +18,7 @@ concurrency:
 jobs:
 jobs:
   build-linux-buildbot:
   build-linux-buildbot:
     name: Build tools with buildbot container
     name: Build tools with buildbot container
+    if: ${{ github.repository_owner  == 'openwrt' }}
     uses: ./.github/workflows/build-tools.yml
     uses: ./.github/workflows/build-tools.yml
     with:
     with:
       generate_prebuilt_artifacts: true
       generate_prebuilt_artifacts: true
@@ -25,6 +26,7 @@ jobs:
   push-tools-container:
   push-tools-container:
     needs: build-linux-buildbot
     needs: build-linux-buildbot
     name: Push prebuilt tools container
     name: Push prebuilt tools container
+    if: ${{ github.repository_owner  == 'openwrt' }}
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
     permissions:
     permissions: