Răsfoiți Sursa

Add GitHub Action to set environment variables

This action sets environment variables based on input parameters for different branches and conditions.
jimsterino98 4 luni în urmă
părinte
comite
18c0c762b7
1 a modificat fișierele cu 64 adăugiri și 0 ștergeri
  1. 64 0
      .github/actions/env-variables/action.yml

+ 64 - 0
.github/actions/env-variables/action.yml

@@ -0,0 +1,64 @@
+name: set variables
+description: set environment variables
+inputs:
+ susfs:
+  description: 'susfs'
+  required: true
+ branch:
+  description: 'device kernel'
+  required: true
+ zeromount:
+  description: 'zeromount'
+  required: true
+
+runs:
+ using: composite
+ steps:
+  - name: set dependency directory variables
+    shell: bash
+    run: |
+     ROOT="$GITHUB_WORKSPACE"
+     if [[ ${{ inputs.susfs }} == 'true' ]]; then
+      SUSFS4KSU="$ROOT/susfs4ksu"
+      KERNEL_PATCHES="$ROOT/kernel_patches"
+      echo "SUSFS4KSU=$SUSFS4KSU" >> $GITHUB_ENV
+      echo "KERNEL_PATCHES=$KERNEL_PATCHES" >> $GITHUB_ENV
+     fi
+     ANYKERNEL3="$ROOT/AnyKernel3"
+     if [[ ${{ inputs.zeromount }} == 'true' ]]; then
+      ZEROMOUNT="$ROOT/Super-Builders"
+      echo "ZEROMOUNT=$ZEROMOUNT" >> $GITHUB_ENV
+     fi
+
+     echo "ROOT=$ROOT" >> $GITHUB_ENV
+     echo "ANYKERNEL3=$ANYKERNEL3" >> $GITHUB_ENV
+     
+  - name: set common variable
+    shell: bash
+    run: |
+     if [[ ${{ inputs.branch }} == SM-A546* || "${{ inputs.branch }}" == "SM-M146B-Oneui7-ADYJ2" || "${{ inputs.branch }}" == "SM-S908B-Oneui8-bitK" ]]; then  
+       COMMON="$CONFIG"
+     elif [[ "${{ inputs.branch }}" == "SM-A566B" || ${{ inputs.branch }} == SM-A055* ]]; then
+       COMMON="$CONFIG/kernel-6.6"
+     elif [[ "${{ inputs.branch }}" == "SM-S926B-Oneui8" || ${{ inputs.branch }} == SM-A556* ]]; then
+       COMMON="$CONFIG/kernel"
+     else
+       COMMON="$CONFIG/kernel_platform/common"
+     fi
+     echo "COMMON=$COMMON" >> $GITHUB_ENV
+    
+  - name: set defconfig variable
+    shell: bash
+    run: |
+     if [[ "${{ inputs.branch }}" == "SM-A546B-Oneui7" || "${{ inputs.branch }}" == "SM-A546B-Oneui8" ]]; then
+       GKI_DEFCONFIG="$COMMON/arch/arm64/configs/s5e8835-a54xnaxx_defconfig"
+     elif [[ "${{ inputs.branch }}" == "SM-A546E-Oneui7" || "${{ inputs.branch }}" == "SM-A546E-Oneui8" ]]; then
+       GKI_DEFCONFIG="$COMMON/arch/arm64/configs/s5e8835-a54xnsxx_defconfig"
+     elif [[ "${{ inputs.branch }}" == "SM-M146B-Oneui7-ADYJ2" ]]; then
+       GKI_DEFCONFIG="$COMMON/arch/arm64/configs/s5e8535-m14xnsxx_defconfig"
+     elif [[ "${{ inputs.branch }}" == "SM-S908B-Oneui8-bitK" ]]; then
+       GKI_DEFCONFIG="$COMMON/arch/arm64/configs/s5e9925-b0sxxx_defconfig"
+     else
+       GKI_DEFCONFIG="$COMMON/arch/arm64/configs/gki_defconfig"
+     fi
+     echo "GKI_DEFCONFIG=$GKI_DEFCONFIG" >> $GITHUB_ENV