-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.32 KB
/
update.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
name: Update Node.js Versions
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
schedule:
# Run every two hours
- cron: '0 0/2 * * *'
workflow_dispatch:
jobs:
collect-version-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install NVM
run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
- name: Download latest Node.js versions
run: wget https://nodejs.org/download/release/index.json -O node-versions.json
- run: |
./scripts/nvm-iterator.sh
- uses: actions/upload-artifact@v3
with:
name: version-jsons
path: jsons/*.json
merge-and-release:
runs-on: ubuntu-latest
needs: [collect-version-data]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/download-artifact@v3
with:
path: collected-json
- run: yarn install
- run: find ./collected-json -name '*.json' | xargs yarn merge
- run: cat index.json
- name: Publish from main if necessary
if: github.ref == 'refs/heads/main'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: yarn run release