Skip to content

Commit

Permalink
store information about the available versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wsipak committed Dec 18, 2023
1 parent e78e8dd commit d378f7d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ jobs:
source .env
gsutil -m rsync -r build/ gs://zephyr-samples-builder/zephyr/$ZEPHYR_VERSION
Update-latest-status:
Update-version-info:
needs: Build
runs-on: ubuntu-latest
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
concurrency: update_latest_status
concurrency: update_version_info

permissions:
contents: 'read'
Expand Down Expand Up @@ -198,6 +198,26 @@ jobs:
gsutil cp latest $LATEST_REMOTE_FILE
fi
- name: Update the `versions` file in the bucket.
run: |
source .env
VERSIONS_REMOTE_FILE="gs://zephyr-samples-builder/zephyr/versions"
touch versions
# If the `latest` file exists, read its contents.
! gsutil -q stat $VERSIONS_REMOTE_FILE \
|| gsutil cp $VERSIONS_REMOTE_FILE versions
COUNT_ENTRIES=$(wc -l < versions)
echo "The remote file has $COUNT_ENTRIES entries."
# Store information about the version.
if grep -q "$ZEPHYR_VERSION" versions; then
echo "New version candidate for the versions file:"
echo "$ZEPHYR_VERSION" | tee -a versions
gsutil cp versions $VERSIONS_REMOTE_FILE
fi
Print-status:
needs: Build
runs-on: ubuntu-latest
Expand Down

0 comments on commit d378f7d

Please sign in to comment.