Add support for nightly and rc versions (#611)

This commit is contained in:
Dmitry Shibanov
2022-11-17 14:35:58 +01:00
committed by GitHub
parent 6bc15ab23c
commit 2349c84f5c
12 changed files with 712 additions and 73 deletions

View File

@ -104,6 +104,78 @@ jobs:
- run: npm test
```
## Nightly versions
You can specify a nightly version to download it from https://nodejs.org/download/nightly.
### Install the nightly build for a major version
```yaml
jobs:
build:
runs-on: ubuntu-latest
name: Node sample
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16-nightly' # it will install the latest nightly release for node 16
- run: npm ci
- run: npm test
```
### Install the nightly build for a specific version
```yaml
jobs:
build:
runs-on: ubuntu-latest
name: Node sample
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.0.0-nightly' # it will install the latest nightly release for node 16.0.0
- run: npm ci
- run: npm test
```
### Install an exact nightly version
```yaml
jobs:
build:
runs-on: ubuntu-latest
name: Node sample
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.0.0-nightly20210420a0261d231c'
- run: npm ci
- run: npm test
```
## RC versions
You can use specify a rc version to download it from https://nodejs.org/download/rc.
```yaml
jobs:
build:
runs-on: ubuntu-latest
name: Node sample
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.0.0-rc.1'
- run: npm ci
- run: npm test
```
**Note:** Unlike nightly versions, which support version range specifiers, you must specify the exact version for a release candidate: `16.0.0-rc.1`.
## Caching packages data
The action follows [actions/cache](https://github.com/actions/cache/blob/main/examples.md#node---npm) guidelines, and caches global cache on the machine instead of `node_modules`, so cache can be reused between different Node.js versions.