Skip to content

Commit 1518b31

Browse files
authored
Merge pull request #6 from thirdiron/node20upgrade
Pull in latest changes to enable NodeJS 20 to work
2 parents 9ac6454 + a4537ff commit 1518b31

59 files changed

Lines changed: 2044 additions & 11761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7+
labels:
8+
- "dependencies"
9+
- "ruby"
10+
- "skip changelog"
11+
groups:
12+
ruby-dependencies:
13+
update-types:
14+
- "minor"
15+
- "patch"
716
- package-ecosystem: "github-actions"
817
directory: "/"
918
schedule:
1019
interval: "monthly"
11-
- package-ecosystem: "gomod"
12-
directory: "/"
13-
schedule:
14-
interval: "monthly"
20+
labels:
21+
- "dependencies"
22+
- "github actions"
23+
- "skip changelog"

.github/workflows/check_changelog.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@ name: Check Changelog
22

33
on:
44
pull_request:
5-
types: [opened, reopened, edited, labeled, unlabeled, synchronize]
5+
types: [opened, reopened, labeled, unlabeled, synchronize]
66

77
permissions:
88
contents: read
99

1010
jobs:
1111
check-changelog:
1212
runs-on: ubuntu-latest
13-
if: |
14-
!contains(github.event.pull_request.body, '[skip changelog]') &&
15-
!contains(github.event.pull_request.body, '[changelog skip]') &&
16-
!contains(github.event.pull_request.body, '[skip ci]') &&
17-
!contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
18-
!contains(github.event.pull_request.labels.*.name, 'dependencies') &&
19-
!contains(github.event.pull_request.labels.*.name, 'automation')
13+
if: (!contains(github.event.pull_request.labels.*.name, 'skip changelog'))
2014
steps:
21-
- uses: actions/checkout@v3
15+
- name: Checkout
16+
uses: actions/checkout@v4
2217
- name: Check that CHANGELOG is touched
2318
run: |
2419
git fetch origin ${{ github.base_ref }} --depth 1 && \

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
STACK: heroku-${{ matrix.stack_number }}
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525
- name: Unit tests on heroku:${{ matrix.stack_number }}-build
2626
run: test/unit
2727

@@ -36,7 +36,7 @@ jobs:
3636
STACK: heroku-${{ matrix.stack_number }}
3737
steps:
3838
- name: Checkout
39-
uses: actions/checkout@v2
39+
uses: actions/checkout@v4
4040
- name: Functional tests on heroku:${{ matrix.stack_number }}-build
4141
run: test/run
4242

@@ -48,7 +48,7 @@ jobs:
4848
HATCHET_EXPENSIVE_MODE: "1"
4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@v2
51+
uses: actions/checkout@v4
5252
- name: Install Ruby and gems
5353
uses: ruby/setup-ruby@v1
5454
with:

.github/workflows/hatchet_app_cleaner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
HEROKU_DISABLE_AUTOUPDATE: 1
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
- name: Install Ruby and dependencies
2424
uses: ruby/setup-ruby@v1
2525
with:

.github/workflows/inventory.yml

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,92 @@ jobs:
1010
runs-on: pub-hk-ubuntu-22.04-small
1111
steps:
1212
- name: Checkout Repo
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Install Rust Toolchain
1515
uses: actions-rs/toolchain@v1
1616
with:
1717
toolchain: stable
1818
- name: Install Rust Inventory Binaries
19-
run: cargo install heroku-nodejs-utils --bin diff_versions --bin list_versions --git https://github.com/heroku/buildpacks-nodejs
19+
run: cargo install heroku-nodejs-utils --bin diff_versions --bin generate_inventory --git https://github.com/heroku/buildpacks-nodejs
2020
- id: set-diff-msg
2121
name: Set Diff Message
22-
run: echo "::set-output name=msg::$(diff_versions node inventory/node.toml)"
22+
run: |
23+
delimiter="$(openssl rand -hex 8)"
24+
{
25+
echo "msg<<${delimiter}"
26+
diff_versions node inventory/node.toml
27+
echo "${delimiter}"
28+
} >> $GITHUB_OUTPUT
2329
- name: Rebuild Inventory
24-
run: "list_versions node > inventory/node.toml"
30+
run: "generate_inventory node > inventory/node.toml"
2531
- name: Update Changelog
26-
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n- {}/' CHANGELOG.md
32+
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n{}/' CHANGELOG.md
33+
- uses: heroku/use-app-token-action@main
34+
id: generate-token
35+
with:
36+
app_id: ${{ vars.LINGUIST_GH_APP_ID }}
37+
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
2738
- name: Create Pull Request
28-
uses: peter-evans/create-pull-request@v4.2.4
39+
id: pr
40+
uses: peter-evans/create-pull-request@v5.0.2
2941
with:
42+
token: ${{ steps.generate-token.outputs.app_token }}
3043
title: "Update Node.js Engine Inventory"
3144
commit-message: "Update Inventory for heroku/nodejs engine\n\n${{ steps.set-diff-msg.outputs.msg }}"
3245
branch: update-nodejs-inventory
33-
labels: "automation"
3446
body: "Automated pull-request to update heroku/nodejs engine inventory:\n\n${{ steps.set-diff-msg.outputs.msg }}"
47+
committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
48+
author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
49+
- name: Configure PR
50+
if: steps.pr.outputs.pull-request-operation == 'created'
51+
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}"
52+
env:
53+
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }}
54+
3555
update-yarn-inventory:
3656
name: Update Node.js Yarn Inventory
3757
runs-on: pub-hk-ubuntu-22.04-small
3858
steps:
3959
- name: Checkout Repo
40-
uses: actions/checkout@v3
60+
uses: actions/checkout@v4
4161
- id: install-rust-toolchain
4262
name: Install Rust Toolchain
4363
uses: actions-rs/toolchain@v1
4464
with:
4565
toolchain: stable
4666
- name: Install Rust Inventory Binaries
47-
run: cargo install heroku-nodejs-utils --bin diff_versions --bin list_versions --git https://github.com/heroku/buildpacks-nodejs
67+
run: cargo install heroku-nodejs-utils --bin diff_versions --bin generate_inventory --git https://github.com/heroku/buildpacks-nodejs
4868
- id: set-diff-msg
4969
name: Set Diff Message
50-
run: echo "::set-output name=msg::$(diff_versions yarn inventory/yarn.toml)"
70+
run: |
71+
delimiter="$(openssl rand -hex 8)"
72+
{
73+
echo "msg<<${delimiter}"
74+
diff_versions yarn inventory/yarn.toml
75+
echo "${delimiter}"
76+
} >> $GITHUB_OUTPUT
5177
- name: Rebuild Inventory
52-
run: "list_versions yarn > inventory/yarn.toml"
78+
run: "generate_inventory yarn > inventory/yarn.toml"
5379
- name: Update Changelog
54-
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n- {}/' CHANGELOG.md
80+
run: echo "${{ steps.set-diff-msg.outputs.msg }}" | xargs -r -I '{}' perl -i -p -e 's/## main\s+/## main\n\n{}/' CHANGELOG.md
81+
- uses: heroku/use-app-token-action@main
82+
id: generate-token
83+
with:
84+
app_id: ${{ vars.LINGUIST_GH_APP_ID }}
85+
private_key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }}
5586
- name: Create Pull Request
56-
uses: peter-evans/create-pull-request@v4.2.4
87+
id: pr
88+
uses: peter-evans/create-pull-request@v5.0.2
5789
with:
90+
token: ${{ steps.generate-token.outputs.app_token }}
5891
title: "Update Node.js Yarn Inventory"
5992
commit-message: "Update Inventory for heroku/nodejs yarn\n\n${{ steps.set-diff-msg.outputs.msg }}"
6093
branch: update-yarn-inventory
61-
labels: "automation"
6294
body: "Automated pull-request to update heroku/nodejs yarn inventory:\n\n${{ steps.set-diff-msg.outputs.msg }}"
95+
committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
96+
author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}>
97+
- name: Configure PR
98+
if: steps.pr.outputs.pull-request-operation == 'created'
99+
run: gh pr merge --squash --auto "${{ steps.pr.outputs.pull-request-number }}"
100+
env:
101+
GH_TOKEN: ${{ steps.generate-token.outputs.app_token }}

CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,87 @@
22

33
## main
44

5+
## v228 (2023-10-31)
6+
7+
- Update default node version to 20.x ([#1171](https://github.com/heroku/heroku-buildpack-nodejs/pull/1171))
8+
- Added Yarn version 4.0.1.
9+
10+
## v227 (2023-10-26)
11+
12+
- Added Yarn version 4.0.0.
13+
- Added Node.js version 21.1.0.
14+
- Added Node.js version 20.9.0.
15+
16+
## v226 (2023-10-19)
17+
18+
- Added Node.js version 21.0.0.
19+
- Add metrics and tests for Node.js 21. ([#1161](https://github.com/heroku/heroku-buildpack-nodejs/pull/1161))
20+
21+
## v225 (2023-10-17)
22+
23+
- Added Node.js version 20.8.1.
24+
- Added Node.js version 18.18.2.
25+
26+
## v224 (2023-10-11)
27+
28+
- Added Node.js version 18.18.1.
29+
- Report errors when checking `npm` and `yarn` output ([#1147](https://github.com/heroku/heroku-buildpack-nodejs/pull/1147))
30+
31+
## v223 (2023-10-04)
32+
33+
- Added Node.js version 20.8.0.
34+
- Added Yarn version 3.6.4.
35+
- Added Yarn version 4.0.0-rc.52.
36+
- Added Yarn version 4.0.0-rc.53.
37+
38+
## v222 (2023-09-25)
39+
40+
- Fixed issue where npm versions `>=10` were being downgraded to version `5.x` ([#1141](https://github.com/heroku/heroku-buildpack-nodejs/pull/1141))
41+
42+
## v221 (2023-09-19)
43+
44+
- Improved error messaging when installing an incompatible npm version.
45+
- Added Node.js version 18.18.0.
46+
- Added Node.js version 20.7.0.
47+
- Added Yarn version 3.6.2.
48+
- Added Yarn version 3.6.3.
49+
- Added Yarn version 4.0.0-rc.49
50+
- Added Yarn version 4.0.0-rc.50
51+
- Added Yarn version 4.0.0-rc.51
52+
53+
## v220 (2023-09-13)
54+
55+
- Added Node.js version 20.6.0.
56+
- Added Node.js version 20.6.1.
57+
58+
## v219 (2023-08-10)
59+
60+
- Added Node.js version 16.20.2.
61+
- Added Node.js version 18.17.1.
62+
- Added Node.js version 20.5.1.
63+
64+
## v218 (2023-07-24)
65+
66+
- Added Node.js version 20.5.0.
67+
68+
## v217 (2023-07-19)
69+
70+
- Added Node.js version 18.17.0.
71+
72+
## v216 (2023-07-07)
73+
74+
- Added Node.js version 20.4.0.
75+
- Added Yarn version 3.6.1.
76+
77+
## v215 (2023-06-21)
78+
79+
- Added Node.js version 20.3.1, 18.16.1, 16.20.1.
80+
81+
## v214 (2023-06-20)
82+
83+
- Added Yarn version 4.0.0-rc.45.
84+
- Added Node.js version 20.3.0.
85+
586
## v213 (2023-05-24)
687

788
- Added node version 20.2.0.

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ GEM
2626
heroics (~> 0.1.1)
2727
moneta (~> 1.0.0)
2828
rate_throttle_client (~> 0.1.0)
29-
rake (13.0.6)
29+
rake (13.1.0)
3030
rate_throttle_client (0.1.2)
3131
rrrretry (1.0.0)
3232
rspec-core (3.12.0)
3333
rspec-support (~> 3.12.0)
34-
rspec-expectations (3.12.2)
34+
rspec-expectations (3.12.3)
3535
diff-lcs (>= 1.2.0, < 2.0)
3636
rspec-support (~> 3.12.0)
3737
rspec-retry (0.6.2)
3838
rspec-core (> 3.3)
39-
rspec-support (3.12.0)
39+
rspec-support (3.12.1)
4040
sem_version (2.0.1)
4141
thor (1.2.1)
4242
threaded (0.0.4)

bin/compile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ source "$BP_DIR/lib/output.sh"
3232
source "$BP_DIR/lib/monitor.sh"
3333
# shellcheck source=lib/environment.sh
3434
source "$BP_DIR/lib/environment.sh"
35+
# shellcheck source=lib/npm.sh
36+
source "$BP_DIR/lib/npm.sh"
3537
# shellcheck source=lib/failure.sh
3638
source "$BP_DIR/lib/failure.sh"
3739
# shellcheck source=lib/binaries.sh

etc/publish.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
set -e
44

55
BP_NAME=${1:-"heroku/nodejs"}
6-
7-
# if buildpack-registry CLI plugin is not installed, show a help message and exit
8-
if ! heroku plugins | grep -q "buildpack-registry"; then
9-
echo "Releasing the buildpack requires the buildpack-registry CLI plugin."
10-
echo "https://github.com/heroku/languages-team/blob/main/languages/nodejs/buildpack.md"
11-
echo ""
12-
echo "heroku plugins:install buildpack-registry"
13-
echo ""
14-
echo "Current CLI plugins:"
15-
heroku plugins
16-
exit 1
17-
fi
18-
196
curVersion=$(heroku buildpacks:versions "$BP_NAME" | awk 'FNR == 3 { print $1 }')
207
newVersion="v$((curVersion + 1))"
218

0 commit comments

Comments
 (0)