-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create GitHub action to update the canary branch (#171)
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [email protected] | ||
|
||
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 |