-
Notifications
You must be signed in to change notification settings - Fork 29.6k
165 lines (162 loc) Β· 7.47 KB
/
tools.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Tools and deps update
on:
schedule:
# Run once a week at 00:05 AM UTC on Sunday.
- cron: 5 0 * * 0
workflow_dispatch:
permissions:
contents: read
jobs:
tools-deps-update:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
strategy:
fail-fast: false # Prevent other jobs from aborting if one fails
matrix:
include:
- id: eslint
subsystem: tools
label: tools
run: |
NEW_VERSION=$(npm view eslint dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./tools/node_modules/eslint/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/dep_updaters/update-eslint.sh
fi
- id: corepack
subsystem: deps
label: dependencies
run: |
make corepack-update
echo "NEW_VERSION=$(node deps/corepack/dist/corepack.js --version)" >> $GITHUB_ENV
- id: lint-md-dependencies
subsystem: tools
label: tools
run: |
cd tools/lint-md
npm ci
NEW_VERSION=$(npm outdated --parseable | cut -d: -f4 | xargs)
if [ "$NEW_VERSION" != "" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
rm -rf package-lock.json node_modules
# Include $NEW_VERSION to explicitly update the package.json
# entry for the dependency and also so that semver-major updates
# are not skipped.
npm install --ignore-scripts $NEW_VERSION
npm install --ignore-scripts
cd ../..
make lint-md-rollup
fi
- id: doc
subsystem: tools
label: tools
run: |
cd tools/doc
npm ci
NEW_VERSION=$(npm outdated --parseable | cut -d: -f4 | xargs)
if [ "$NEW_VERSION" != "" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
rm -rf package-lock.json node_modules
# Include $NEW_VERSION to explicitly update the package.json
# entry for the dependency and also so that semver-major updates
# are not skipped.
npm install --ignore-scripts $NEW_VERSION
npm install --ignore-scripts
fi
- id: undici
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(npm view undici dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./deps/undici/src/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-undici.sh
fi
- id: postject
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(npm view postject dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/dep_updaters/update-postject.sh
fi
- id: base64
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(gh api repos/aklomp/base64/releases/latest -q '.tag_name|ltrimstr("v")')
CURRENT_VERSION=$(grep "base64 LANGUAGES C VERSION" ./deps/base64/base64/CMakeLists.txt | \
sed -n "s/^.*VERSION \(.*\))/\1/p")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-base64.sh "$NEW_VERSION"
fi
- id: acorn
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(npm view acorn dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-acorn.sh
fi
- id: acorn-walk
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(npm view acorn-walk dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn-walk/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-acorn-walk.sh
fi
- id: libuv
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(gh api repos/libuv/libuv/releases/latest -q '.tag_name|ltrimstr("v")')
VERSION_H="./deps/uv/include/uv/version.h"
CURRENT_MAJOR_VERSION=$(grep "#define UV_VERSION_MAJOR" $VERSION_H | sed -n "s/^.*MAJOR \(.*\)/\1/p")
CURRENT_MINOR_VERSION=$(grep "#define UV_VERSION_MINOR" $VERSION_H | sed -n "s/^.*MINOR \(.*\)/\1/p")
CURRENT_PATCH_VERSION=$(grep "#define UV_VERSION_PATCH" $VERSION_H | sed -n "s/^.*PATCH \(.*\)/\1/p")
CURRENT_SUFFIX_VERSION=$(grep "#define UV_VERSION_SUFFIX" $VERSION_H | sed -n "s/^.*SUFFIX \"\(.*\)\"/\1/p")
SUFFIX_STRING=$([[ -z "$CURRENT_SUFFIX_VERSION" ]] && echo "" || echo "-$CURRENT_SUFFIX_VERSION")
CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION$SUFFIX_STRING"
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/dep_updaters/update-libuv.sh "$NEW_VERSION"
fi
- id: simdutf
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(gh api repos/simdutf/simdutf/releases/latest -q '.tag_name|ltrimstr("v")')
CURRENT_VERSION=$(grep "#define SIMDUTF_VERSION" ./deps/simdutf/simdutf.h | sed -n "s/^.*VERSION \(.*\)/\1/p")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/dep_updaters/update-simdutf.sh "$NEW_VERSION"
fi
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- run: ${{ matrix.run }}
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
- uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
# Creates a PR or update the Action's existing PR, or
# no-op if the base branch is already up-to-date.
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot <[email protected]>
body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}.
branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action.
commit-message: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
labels: ${{ matrix.label }}
title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'