Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create GitHub action to update the canary branch #171

Merged
merged 6 commits into from
Apr 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/update-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update canary branch

on:
schedule:
- cron: '0 6 * * *'
targos marked this conversation as resolved.
Show resolved Hide resolved
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

targos marked this conversation as resolved.
Show resolved Hide resolved
- 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 }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result:

image

17 changes: 17 additions & 0 deletions README.md
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/
29 changes: 29 additions & 0 deletions tools/update-canary.sh
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 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