From 81d85060f845fc3344b2e25c7bb6ca27684465fa Mon Sep 17 00:00:00 2001 From: David Birks Date: Sat, 8 Jun 2024 23:36:09 -0400 Subject: [PATCH] Fix the subfolder generation --- .github/workflows/build.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 683ec62..e435f50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,13 +11,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + # List the two subdirectories under the src directory, and turn it into a json array for easier parsing in the next step. + # Like: ["./fabric-runtime/1.1","./fabric-runtime/1.2"] - name: Find subfolders to build - id: find - # List the two subdirectories under the src directory, trim src/ off the front of the path, - # trim the final newline, and turn it into a json array for easier parsing in the next step. - # Like: ["fabric-runtime/1.2","fabric-runtime/1.3"] run: | - SUBFOLDERS=$(find src -mindepth 2 -maxdepth 2 -type d | sed 's|^src/||' | tr -d '\n' | jq --raw-input --slurp --compact-output 'split("\n")') + SUBFOLDERS=$(cd src && find . -mindepth 2 -maxdepth 2 -type d | jc --find -r) echo "Found subfolders: $SUBFOLDERS" echo "SUBFOLDERS=$SUBFOLDERS" >> $GITHUB_ENV outputs: @@ -43,17 +41,16 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Parse out the image name and tag - id: parse run: | echo "Parsing subfolder: ${{ matrix.subfolder }}" # The first part is the image name - IMAGE_NAME=$(echo ${{ matrix.subfolder }} | cut -d / -f 1) + IMAGE_NAME=$(echo ${{ matrix.subfolder }} | cut -d / -f 2) echo "The image name is: $IMAGE_NAME" echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV # And the second part is the image tag - IMAGE_TAG=$(echo ${{ matrix.subfolder }} | cut -d / -f 2) + IMAGE_TAG=$(echo ${{ matrix.subfolder }} | cut -d / -f 3) echo "The image tag is: $IMAGE_TAG" echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV