Skip to content

Commit

Permalink
Fix the subfolder generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirks committed Jun 9, 2024
1 parent 9cdd702 commit 81d8506
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 81d8506

Please sign in to comment.