Skip to content

Latest Dart Version #38

Latest Dart Version

Latest Dart Version #38

Workflow file for this run

name: Latest Dart Version
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 5' # Run at 6:00 on Friday
env:
# Current supported major
major: 3
# Latest minor that we are explicitly supporting
latest_minor: 4
jobs:
check-dart-version:
name: Check
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install curl jq
- name: Check latest version ${{ env.major }} docker image
run: |
token=$(curl -s -H "Content-Type: application/json" \
"https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/dart:pull" | \
jq -r .token)
digest() {
curl -s -H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
"https://index.docker.io/v2/library/dart/manifests/$1" | \
jq -r '.fsLayers[0].blobSum'
}
digest_stable=$(digest stable)
digest_current=$(digest $major.$latest_minor)
if test "$digest_stable" = null -o "$digest_current" = null
then
echo "Could not get the stable image digest ($digest_stable) or the currrent ($major.$latest_minor)" \
"image digest ($digest_current)." >&2
exit 1
fi
if test "$digest_stable" != "$digest_current"
then
echo "Version of $major.$latest_minor is not the latest stable" \
"version for https://hub.docker.com/r/_/dart" >&2
exit 1
fi