V8 Upgrade #563
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: V8 Upgrade | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Run every day | |
jobs: | |
upgrade: | |
name: Upgrade V8 | |
runs-on: ubuntu-latest | |
outputs: | |
has_upgrade: ${{ steps.check_v8.outputs.has_upgrade }} | |
latest_v8_hash: ${{ steps.check_v8.outputs.latest_v8_hash }} | |
steps: | |
- name: Install Utilities | |
run: | | |
sudo apt-get update | |
sudo apt-get install -qy --no-install-recommends jq | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- id: check_v8 | |
name: Check Latest Stable Chromium V8 | |
run: | | |
set -o pipefail | |
wget -q -O- "https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Linux&num=1&offset=0" | jq -r ".[0].hashes.v8" >deps/v8_hash | |
echo "latest_v8_hash=$(<deps/v8_hash)" >>"$GITHUB_OUTPUT" | |
bad_reason="$(awk -vhash="$(<deps/v8_hash)" '!$0 { next; } $1 == hash { $1 = ""; print substr($0, 2); }' deps/bad_v8_hashes)" | |
if [ -n "$bad_reason" ]; then | |
echo "has_upgrade=false" >>"$GITHUB_OUTPUT" | |
echo "reason=$bad_reason" >>"$GITHUB_OUTPUT" | |
else | |
echo "has_upgrade=$(git status --porcelain | grep -q . && echo true || echo false)" >>"$GITHUB_OUTPUT" | |
fi | |
- name: Create Summary | |
if: ${{ steps.check_v8.outputs.has_upgrade == 'true' }} | |
run: | | |
echo "New V8 hash: ${{ steps.check_v8.outputs.latest_v8_hash }}" >>"$GITHUB_STEP_SUMMARY" | |
- name: Create Summary (no upgrade) | |
if: ${{ steps.check_v8.outputs.has_upgrade != 'true' }} | |
run: | | |
echo "No V8 upgrade available." >>"$GITHUB_STEP_SUMMARY" | |
if [ -n "${{ steps.check_v8.outputs.reason }}" ]; then | |
echo "Reason: ${{ steps.check_v8.outputs.reason }}" >>"$GITHUB_STEP_SUMMARY" | |
fi | |
build: | |
name: Run V8 Build | |
needs: upgrade | |
if: ${{ needs.upgrade.outputs.has_upgrade == 'true' }} | |
uses: ./.github/workflows/v8build.yml | |
with: | |
v8_hash: ${{ needs.upgrade.outputs.latest_v8_hash }} | |
release: | |
name: Make A Release | |
needs: build | |
if: ${{ needs.build.outputs.committed == 'true' && github.ref == 'refs/heads/master' }} | |
uses: ./.github/workflows/release.yml | |
with: | |
draft: false | |
version: '+0.1.0' | |
sha: ${{ needs.build.outputs.sha }} |