Skip to content

Commit 5fa3c63

Browse files
authored
Merge pull request #141 from nodenv/test-workflow
2 parents 46f8b0b + 7f7a3f1 commit 5fa3c63

File tree

13 files changed

+136
-83
lines changed

13 files changed

+136
-83
lines changed

.github/workflows/definitions.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Definitions
2+
on:
3+
schedule: [{ cron: "0 */6 * * *" }] # 6hrly https://crontab.guru/#0_*/6_*_*_*
4+
workflow_dispatch:
5+
6+
permissions: {}
7+
jobs:
8+
scrape:
9+
runs-on: ubuntu-latest
10+
permissions: { contents: read }
11+
steps:
12+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
13+
with: { egress-policy: audit }
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- run: npm ci
16+
17+
- run: npm run scrape-definitions
18+
- run: npm run commit-definitions
19+
env:
20+
GIT_AUTHOR_NAME: ${{ vars.NODENV_BOT_NAME }}
21+
GIT_AUTHOR_EMAIL: ${{ vars.NODENV_BOT_EMAIL }}
22+
GIT_COMMITTER_NAME: ${{ vars.GHA_BOT_NAME }}
23+
GIT_COMMITTER_EMAIL: ${{ vars.GHA_BOT_EMAIL }}
24+
25+
- id: log
26+
run: |
27+
# TODO fix this whole PR body mess
28+
msg=$(git log --format='- %s' --reverse ${{github.sha}}..)
29+
echo "message=${msg//$'\n'/'%0A'}" >> "$GITHUB_OUTPUT"
30+
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
31+
with:
32+
token: ${{ secrets.BOT_TOKEN }}
33+
branch: latest-scraped-definitions
34+
title: "Scraped latest definitions"
35+
body: ${{ steps.log.outputs.message }}

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Release
2+
on:
3+
push: { tags: "v[0-9]+.[0-9]+.[0-9]+*" }
4+
5+
permissions: {}
6+
jobs:
7+
release:
8+
permissions: { contents: write, id-token: write }
9+
uses: nodenv/.github/.github/workflows/release.yml@v6
10+
secrets: inherit

.github/workflows/sync-default-branch.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ permissions: {}
66

77
jobs:
88
sync:
9-
permissions: {contents: write}
9+
permissions: { contents: write }
1010
uses: nodenv/.github/.github/workflows/sync-default-branch.yml@v5
11-
1211
# One-time commands for users to switch-over:
1312
#
1413
# ```console

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
schedule: [{ cron: "0 0 10 * *" }] # monthly https://crontab.guru/#0_0_10_*_*
6+
workflow_dispatch:
7+
8+
permissions: {}
9+
jobs:
10+
test:
11+
uses: nodenv/.github/.github/workflows/test.yml@v6
12+
with: { npm: false }
13+
permissions:
14+
contents: read
15+
packages: read
16+
id-token: write
17+
security-events: write
18+
statuses: write
19+
20+
checksums:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
24+
with: { egress-policy: audit }
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with: { fetch-depth: 0 }
27+
- run: npm ci
28+
29+
# FIXME workaround https://github.com/actions/checkout/issues/910
30+
- if: github.event_name == 'pull_request'
31+
run: npm run lint:checksums -- origin/${{github.base_ref}}
32+
- run: npm run lint:checksums -- HEAD^
33+
if: github.event_name == 'push'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/node_modules
2+
/package*/
3+
/tmp
4+
5+
/nodenv-node-build-prerelease-*.tgz

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

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

5-
node-build-prerelease is an [nodenv][] plugin (or more precisely, a [node-build][] plugin) that provides build definitions for nodejs prereleases (primarily release candidates).
5+
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).
66

77
<!-- toc -->
88

99
- [Installation](#installation)
10-
* [Installing with Homebrew (for OS X users)](#installing-with-homebrew-for-os-x-users)
11-
* [Installing via git-clone](#installing-via-git-clone)
12-
* [Installing via npm](#installing-via-npm)
13-
* [Installing manually](#installing-manually)
10+
- [Installing with Homebrew (for macOS users)](#installing-with-homebrew-for-macos-users)
11+
- [Installing via git-clone](#installing-via-git-clone)
12+
- [Installing via npm](#installing-via-npm)
13+
- [Installing manually](#installing-manually)
1414
- [Usage](#usage)
15-
* [Setting NODE_BUILD_DEFINITIONS](#setting-node_build_definitions)
16-
* [Passing build definition directly](#passing-build-definition-directly)
15+
- [Setting NODE_BUILD_DEFINITIONS](#setting-node_build_definitions)
16+
- [Passing build definition directly](#passing-build-definition-directly)
1717

1818
<!-- tocstop -->
1919

2020
## Installation
2121

22-
### Installing with Homebrew (for OS X users)
22+
### Installing with Homebrew (for macOS users)
2323

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

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

2929
brew install nodenv/nodenv/node-build-prerelease
3030

31-
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.
32-
Typically this additional delay is only a matter of days and is well worth the simplicity of using homebrew to manage nodenv plugins.
31+
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.
32+
Typically this additional delay is only a matter of days and is well worth the simplicity of using Homebrew to manage nodenv plugins.
3333

3434
(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][].)
3535

@@ -106,8 +106,6 @@ Or:
106106

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

109-
110-
111109
[homebrew]: http://brew.sh
112110
[nodenv]: https://github.com/nodenv/nodenv
113111
[node-build]: https://github.com/nodenv/node-build

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88
cd "$(dirname "$0")"
99

1010
if [ -z "${PREFIX}" ]; then
11-
PREFIX="/usr/local"
11+
PREFIX="/usr/local"
1212
fi
1313

1414
SHARE_PATH="${PREFIX}/share/node-build"

package-lock.json

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Install NodeJS prerelease versions",
55
"homepage": "https://github.com/nodenv/node-build-prerelease#readme",
66
"license": "MIT",
7-
"author": "Jason Karns <jason@karns.name> (http://jason.karns.name)",
7+
"author": "Jason Karns <jason.karns@gmail.com> (http://jasonkarns.com)",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/nodenv/node-build-prerelease.git"
@@ -21,21 +21,21 @@
2121
},
2222
"scripts": {
2323
"clean": "git clean -f -- share",
24-
"postinstall": "script/postinstall",
24+
"start": "npm run scrape-definitions",
25+
"scrape-definitions": "nodenv-update-version-defs --nodejs-pre --chakracore-pre --nodejs-nightly --chakracore-nightly -d share/node-build/",
26+
"commit-definitions": "npm explore @nodenv/node-build-update-defs -- npm run defs:commit --",
27+
"submit-definitions": "npm explore @nodenv/node-build-update-defs -- npm run defs:submit --",
28+
"test": "bats ${CI:+--tap} test",
2529
"posttest": "npm run lint",
2630
"lint": "git ls-files bin script **/*.*sh | xargs shellcheck",
27-
"scrape-definitions": "nodenv-update-version-defs --nodejs-pre --chakracore-pre --nodejs-nightly --chakracore-nightly -d $PWD/share/node-build/",
28-
"submit-definitions": "node_modules/@nodenv/node-build-update-defs/script/submit-definitions",
29-
"verify-definitions": "node_modules/@nodenv/node-build-update-defs/script/verify-definitions",
31+
"lint:checksums": "npm explore @nodenv/node-build-update-defs -- npm run defs:verify --",
32+
"postinstall": "script/postinstall",
3033
"preversion": "script/preversion",
31-
"postversion": "npm publish",
32-
"prepublishOnly": "npm run publish:github && npm run publish:brew",
33-
"publish:brew": "brew-publish",
34-
"publish:github": "script/publish/github"
34+
"postversion": "git push --follow-tags"
3535
},
3636
"devDependencies": {
3737
"@nodenv/node-build-update-defs": "^2.11.1",
3838
"bats": "^1.12.0",
39-
"brew-publish": "^2.3.1"
39+
"prettier": "^3.6.2"
4040
}
4141
}

0 commit comments

Comments
 (0)