diff --git a/.github/workflows/snap-store-publish-to-candidate.yml b/.github/workflows/snap-store-publish-to-candidate.yml index b174098..84e031b 100644 --- a/.github/workflows/snap-store-publish-to-candidate.yml +++ b/.github/workflows/snap-store-publish-to-candidate.yml @@ -144,8 +144,16 @@ jobs: # Declare an array to keep track of the revisions we've seen revisions=() + # Handle the case where architectures is a simple list of strings + archs="$(cat snap/snapcraft.yaml | yq -r -I=0 -o=json '.architectures[]')" + + # Handle the case where architectures is a list of objects + if echo "$archs" | grep -q "build-on"; then + archs="$(cat snap/snapcraft.yaml | yq -r -I=0 -o=json '.architectures[]."build-on"')" + fi + # Iterate over the architectures specified in the snapcraft.yaml - for arch in $(cat snap/snapcraft.yaml | yq '.architectures[]'); do + for arch in $archs; do rev="$(snapcraft list-revisions "${{ env.SNAP_NAME }}" --arch "$arch" | grep "latest/candidate*" | head -n1 | cut -d' ' -f1)" revisions+=("$rev") # Add a row to the HTML table @@ -195,7 +203,7 @@ jobs: .github/vmctl prepare .github/vmctl exec "sudo snap install ${{ env.SNAP_NAME }} --channel candidate" .github/vmctl exec "snap run ${{ env.SNAP_NAME }} &>/home/ubuntu/${{ env.SNAP_NAME }}.log &" - sleep 20 + sleep 45 - name: Gather screenshots run: |