diff --git a/.github/workflows/update-canary.yml b/.github/workflows/update-canary.yml new file mode 100644 index 00000000000..28185b3705f --- /dev/null +++ b/.github/workflows/update-canary.yml @@ -0,0 +1,42 @@ +name: Update canary branch + +on: + schedule: + - cron: '0 6 * * *' + workflow_dispatch: + +jobs: + updateCanary: + name: Update the canary branch + if: github.repository == 'nodejs/node-v8' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - name: Clone node-v8 + uses: actions/checkout@v2 + with: + path: node-v8 + token: ${{ secrets.CANARY_UPDATE }} + + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: 14.x + + - name: Install dependencies + run: npm install -g node-core-utils@latest + + - name: Cache V8 clone + uses: actions/cache@v2 + with: + path: v8 + key: v8-clone + + - name: Execute the update script + run: ./node-v8/tools/update-canary.sh + + - name: Notify Slack on failure + if: ${{ failure() }} + run: | + ACTIONS_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true" + SLACK_PAYLOAD="{\"username\": \"canary_bot\", \"text\": \"*Canary update failed!*\n\nRun: ${ACTIONS_URL}\", \"icon_emoji\": \":bell:\"}" + curl -X POST --data-urlencode "payload=${SLACK_PAYLOAD}" ${{ secrets.SLACK_WEBHOOK }} diff --git a/README.md b/README.md new file mode 100644 index 00000000000..d40560f8ffc --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Node.js V8 canary + +This is an automatically updated **experimental** version of [Node.js][] with +the `lkgr` (last known good revision) of V8. + +The daily builds of this repo can be found at [`v8-canary`][]. + +**Do not use this in production!** + +This repository is not owned by `@nodejs/v8`, but they might be able to help +with issues. + +This project is bound by a [Code of Conduct][]. + +[Code of Conduct]: https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md +[Node.js]: https://github.com/nodejs/node +[`v8-canary`]: https://nodejs.org/download/v8-canary/ diff --git a/tools/update-canary.sh b/tools/update-canary.sh new file mode 100755 index 00000000000..3ed159b5609 --- /dev/null +++ b/tools/update-canary.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +cd node-v8 + +git remote add upstream https://github.com/nodejs/node.git +git fetch upstream master +git fetch upstream canary-base + +git config user.name "Node.js GitHub Bot" +git config user.email github-bot@iojs.org + +git reset --hard upstream/master + +# Update V8 to the lkgr branch +git-node v8 major --branch=lkgr --base-dir="$GITHUB_WORKSPACE" + +# Cherry-pick the floating V8 patches Node.js maintains on master. +# Canary-base is the last good version of canary, and is manually updated with any V8 patches or backports. +git cherry-pick `git log upstream/canary-base -1 --format=format:%H --grep "src: update NODE_MODULE_VERSION"`...upstream/canary-base + +# Verify that Node.js can be compiled and executed +python3 ./configure +make -j $(getconf _NPROCESSORS_ONLN) V= +out/Release/node test/parallel/test-process-versions.js + +# Force-push to the canary branch. +git push --force origin HEAD:canary