Skip to content
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
35 changes: 35 additions & 0 deletions .github/workflows/definitions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Definitions
on:
schedule: [{ cron: "0 */6 * * *" }] # 6hrly https://crontab.guru/#0_*/6_*_*_*
workflow_dispatch:

permissions: {}
jobs:
scrape:
runs-on: ubuntu-latest
permissions: { contents: read }
steps:
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with: { egress-policy: audit }
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: npm ci

- run: npm run scrape-definitions
- run: npm run commit-definitions
env:
GIT_AUTHOR_NAME: ${{ vars.NODENV_BOT_NAME }}
GIT_AUTHOR_EMAIL: ${{ vars.NODENV_BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ vars.GHA_BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ vars.GHA_BOT_EMAIL }}

- id: log
run: |
# TODO fix this whole PR body mess
msg=$(git log --format='- %s' --reverse ${{github.sha}}..)
echo "message=${msg//$'\n'/'%0A'}" >> "$GITHUB_OUTPUT"
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.BOT_TOKEN }}
branch: latest-scraped-definitions
title: "Scraped latest definitions"
body: ${{ steps.log.outputs.message }}
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Release
on:
push: { tags: "v[0-9]+.[0-9]+.[0-9]+*" }

permissions: {}
jobs:
release:
permissions: { contents: write, id-token: write }
uses: nodenv/.github/.github/workflows/release.yml@v6
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/sync-default-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ permissions: {}

jobs:
sync:
permissions: {contents: write}
permissions: { contents: write }
uses: nodenv/.github/.github/workflows/sync-default-branch.yml@v5

# One-time commands for users to switch-over:
#
# ```console
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test
on:
push:
pull_request:
schedule: [{ cron: "0 0 10 * *" }] # monthly https://crontab.guru/#0_0_10_*_*
workflow_dispatch:

permissions: {}
jobs:
test:
uses: nodenv/.github/.github/workflows/test.yml@v6
with: { npm: false }
permissions:
contents: read
packages: read
id-token: write
security-events: write
statuses: write

checksums:
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with: { egress-policy: audit }
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with: { fetch-depth: 0 }
- run: npm ci

# FIXME workaround https://github.com/actions/checkout/issues/910
- if: github.event_name == 'pull_request'
run: npm run lint:checksums -- origin/${{github.base_ref}}
- run: npm run lint:checksums -- HEAD^
if: github.event_name == 'push'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/node_modules
/package*/
/tmp

/nodenv-node-build-prerelease-*.tgz
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@

[![Build Status](https://travis-ci.org/nodenv/node-build-prerelease.svg?branch=master)](https://travis-ci.org/nodenv/node-build-prerelease)

node-build-prerelease is an [nodenv][] plugin (or more precisely, a [node-build][] plugin) that provides build definitions for nodejs prereleases (primarily release candidates).
node-build-prerelease is an [nodenv][] plugin (or more precisely, a [node-build][] plugin) that provides build definitions for Node.js prereleases (primarily release candidates).

<!-- toc -->

- [Installation](#installation)
* [Installing with Homebrew (for OS X users)](#installing-with-homebrew-for-os-x-users)
* [Installing via git-clone](#installing-via-git-clone)
* [Installing via npm](#installing-via-npm)
* [Installing manually](#installing-manually)
- [Installing with Homebrew (for macOS users)](#installing-with-homebrew-for-macos-users)
- [Installing via git-clone](#installing-via-git-clone)
- [Installing via npm](#installing-via-npm)
- [Installing manually](#installing-manually)
- [Usage](#usage)
* [Setting NODE_BUILD_DEFINITIONS](#setting-node_build_definitions)
* [Passing build definition directly](#passing-build-definition-directly)
- [Setting NODE_BUILD_DEFINITIONS](#setting-node_build_definitions)
- [Passing build definition directly](#passing-build-definition-directly)

<!-- tocstop -->

## Installation

### Installing with Homebrew (for OS X users)
### Installing with Homebrew (for macOS users)

Mac OS X users can install node-build-prerelease with the [Homebrew][].
Installing via Homebrew will make node-build aware of nodejs prereleases automatically.
MacOS users can install node-build-prerelease with the [Homebrew][].
Installing via Homebrew will make node-build aware of Node.js prereleases automatically.

*This is the recommended method of installation if you installed nodenv or node-build with Homebrew.*
_This is the recommended method of installation if you installed nodenv or node-build with Homebrew._

brew install nodenv/nodenv/node-build-prerelease

There is the added delay between when a new version of node-build-prerelease is released, and when the homebrew formula is updated to point to it.
Typically this additional delay is only a matter of days and is well worth the simplicity of using homebrew to manage nodenv plugins.
There is the added delay between when a new version of node-build-prerelease is released, and when the Homebrew formula is updated to point to it.
Typically this additional delay is only a matter of days and is well worth the simplicity of using Homebrew to manage nodenv plugins.

(And if you _really_ want to be on the bleeding edge of node-build, you can skip waiting on node-build/node-build-prerelease to update and scrape new node releases yourself with [node-build-update-defs][].)

Expand Down Expand Up @@ -106,8 +106,6 @@ Or:

node-build /path/to/node-build-prerelease/share/node-build/8.0.0-rc.2 /dest/path/8.0.0-rc.2



[homebrew]: http://brew.sh
[nodenv]: https://github.com/nodenv/nodenv
[node-build]: https://github.com/nodenv/node-build
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
cd "$(dirname "$0")"

if [ -z "${PREFIX}" ]; then
PREFIX="/usr/local"
PREFIX="/usr/local"
fi

SHARE_PATH="${PREFIX}/share/node-build"
Expand Down
20 changes: 14 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Install NodeJS prerelease versions",
"homepage": "https://github.com/nodenv/node-build-prerelease#readme",
"license": "MIT",
"author": "Jason Karns <jason@karns.name> (http://jason.karns.name)",
"author": "Jason Karns <jason.karns@gmail.com> (http://jasonkarns.com)",
"repository": {
"type": "git",
"url": "https://github.com/nodenv/node-build-prerelease.git"
Expand All @@ -21,21 +21,21 @@
},
"scripts": {
"clean": "git clean -f -- share",
"postinstall": "script/postinstall",
"start": "npm run scrape-definitions",
"scrape-definitions": "nodenv-update-version-defs --nodejs-pre --chakracore-pre --nodejs-nightly --chakracore-nightly -d share/node-build/",
"commit-definitions": "npm explore @nodenv/node-build-update-defs -- npm run defs:commit --",
"submit-definitions": "npm explore @nodenv/node-build-update-defs -- npm run defs:submit --",
"test": "bats ${CI:+--tap} test",
"posttest": "npm run lint",
"lint": "git ls-files bin script **/*.*sh | xargs shellcheck",
"scrape-definitions": "nodenv-update-version-defs --nodejs-pre --chakracore-pre --nodejs-nightly --chakracore-nightly -d $PWD/share/node-build/",
"submit-definitions": "node_modules/@nodenv/node-build-update-defs/script/submit-definitions",
"verify-definitions": "node_modules/@nodenv/node-build-update-defs/script/verify-definitions",
"lint:checksums": "npm explore @nodenv/node-build-update-defs -- npm run defs:verify --",
"postinstall": "script/postinstall",
"preversion": "script/preversion",
"postversion": "npm publish",
"prepublishOnly": "npm run publish:github && npm run publish:brew",
"publish:brew": "brew-publish",
"publish:github": "script/publish/github"
"postversion": "git push --follow-tags"
},
"devDependencies": {
"@nodenv/node-build-update-defs": "^2.11.1",
"bats": "^1.12.0",
"brew-publish": "^2.3.1"
"prettier": "^3.6.2"
}
}
18 changes: 9 additions & 9 deletions script/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ set -euo pipefail
IFS=$'\n\t'

installed_by_name() {
local pattern='"remain":\["'${npm_package_name-}
local pattern='"remain":\["'${npm_package_name-}

[[ ${npm_config_argv-} =~ $pattern ]]
[[ ${npm_config_argv-} =~ $pattern ]]
}

if [ -n "${npm_config_argv-}" ] && ! installed_by_name; then
exit
exit
fi

cat <<-MSG
====================
${npm_package_name-} caveats:
====================
${npm_package_name-} caveats:

For \`node-build\`/\`nodenv install\` to pick up definitions provided by this plugin,
ensure share/node-build directory exists in NODE_BUILD_DEFINITIONS:
export NODE_BUILD_DEFINITIONS="$PWD/share/node-build"
====================
For \`node-build\`/\`nodenv install\` to pick up definitions provided by this plugin,
ensure share/node-build directory exists in NODE_BUILD_DEFINITIONS:
export NODE_BUILD_DEFINITIONS="$PWD/share/node-build"
====================
MSG
12 changes: 6 additions & 6 deletions script/preversion
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ git fetch --quiet --tags origin master

existing="$(git tag --points-at HEAD)"
if [ -n "$existing" ]; then
echo "Aborting: HEAD is already tagged as '${existing}'" >&2
exit 1
echo "Aborting: HEAD is already tagged as '${existing}'" >&2
exit 1
fi

current_branch="$(git symbolic-ref --short HEAD)"
if [ "$current_branch" != master ]; then
echo "Aborting: Not currently on master branch" >&2
exit 1
echo "Aborting: Not currently on master branch" >&2
exit 1
fi

previous_tag="$(git describe --tags --abbrev=0)"
if git diff --quiet "${previous_tag}..HEAD" -- bin share; then
echo "Aborting: No features to release since '${previous_tag}'" >&2
exit 1
echo "Aborting: No features to release since '${previous_tag}'" >&2
exit 1
fi
24 changes: 0 additions & 24 deletions script/publish/github

This file was deleted.