diff --git a/.github/workflows/check-retrace-spec.yml b/.github/workflows/check-retrace-spec.yml new file mode 100644 index 0000000..b1255d1 --- /dev/null +++ b/.github/workflows/check-retrace-spec.yml @@ -0,0 +1,16 @@ +name: Check Retrace Spec + +on: + schedule: + - cron: '0 9 * * *' + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Check for newer retrace spec + run: ./scripts/check-retrace-spec.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19cf71e..41e8c25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy --no-self-update - uses: Swatinem/rust-cache@v2 @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: rustup toolchain install stable --profile minimal --no-self-update - uses: Swatinem/rust-cache@v2 @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c234aa0..d5d78f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: with: app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: # Fetch all commits so we can determine previous version fetch-depth: 0 diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 2fa85d3..f4eeda1 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: | rustup toolchain install ${{ matrix.rust }} --profile minimal --component clippy --no-self-update diff --git a/scripts/check-retrace-spec.sh b/scripts/check-retrace-spec.sh new file mode 100755 index 0000000..f7d132c --- /dev/null +++ b/scripts/check-retrace-spec.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +TRACKED_COMMIT="e212426be84283876b6bb832630c0de25a2a7bc5" + +# tail -n +2 to remove the magic anti-XSSI prefix from the Gitiles JSON response +LATEST_COMMIT=$(curl -sf \ + 'https://r8.googlesource.com/r8/+log/refs/heads/main/doc/retrace.md?format=JSON' \ + | tail -n +2 \ + | jq -r '.log[0].commit') + +if [ -z "$LATEST_COMMIT" ] || [ "$LATEST_COMMIT" = "null" ]; then + echo "ERROR: Failed to fetch latest commit from Gitiles" >&2 + exit 1 +fi + +echo "Tracked commit: $TRACKED_COMMIT" +echo "Latest commit: $LATEST_COMMIT" + +if [ "$LATEST_COMMIT" != "$TRACKED_COMMIT" ]; then + echo "Spec has been updated! Latest: https://r8.googlesource.com/r8/+/${LATEST_COMMIT}/doc/retrace.md" + exit 1 +fi + +echo "Spec is up to date."