Compare commits

..

38 commits

Author SHA1 Message Date
renovate[bot]
dd32ff311c chore(deps): update codecov/codecov-action digest to c16abc2 2024-03-28 03:26:01 +00:00
renovate[bot]
f45e055dae chore(deps): update typescript-eslint monorepo to v7.4.0 2024-03-26 22:39:13 -05:00
renovate[bot]
539df473f2 chore(deps): update dependency typescript to v5.4.3 2024-03-26 22:38:22 -05:00
renovate[bot]
e4b51448e5 chore(deps): update dependency @tsconfig/node16 to v16.1.2 2024-03-26 22:37:35 -05:00
renovate[bot]
b6450942b1 fix(deps): update dependency @types/node to v20.11.30 2024-03-20 12:30:56 -05:00
renovate[bot]
ba4707051a chore(deps): update dependency @types/node to v20.11.29 2024-03-18 22:04:15 -05:00
renovate[bot]
30529cda13 chore(deps): update actions/setup-java digest to 99b8673 2024-03-16 00:37:22 +00:00
renovate[bot]
4637a9eae3 fix(deps): update dependency @types/node to v20.11.27 2024-03-13 17:59:51 -05:00
renovate[bot]
ffdeb683d4 chore(deps): update dependency typescript to v5.4.2 2024-03-11 22:31:55 -05:00
renovate[bot]
1f956c348c chore(deps): update typescript-eslint monorepo to v7.2.0 2024-03-11 22:31:33 -05:00
renovate[bot]
0659912bc7 chore(deps): update dependency @types/node to v20.11.26 2024-03-11 22:31:16 -05:00
86f6f140b1
chore: Bump version in CHANGELOG to v2.0.0 2024-02-29 19:14:09 -06:00
a9cb77cf2d
chore: Bump version in package files to v2.0.0 2024-02-29 19:08:28 -06:00
dab00cf95f
chore: Run npm audit fix 2024-02-29 19:06:30 -06:00
0dada87e26 fix: Increase ava test timeout amount 2024-02-29 19:05:07 -06:00
e1fffeb533 chore: Remove unused parameters from debug configuration 2024-02-29 19:05:07 -06:00
156de38608 chore: Remove GITHUB_TOKEN from actrc 2024-02-29 19:05:07 -06:00
d1ab68ccb4 chore: Remove GitHub token from README 2024-02-29 19:05:07 -06:00
e6c6e059b5 chore: Update CHANGELOG 2024-02-29 19:05:07 -06:00
295ac2462c chore!: Remove unused parameters from action.yml 2024-02-29 19:05:07 -06:00
60bfcf0fe2 test: Add test for install_nextflow 2024-02-29 19:05:07 -06:00
5534093b23 chore: Add ability to deal with temporary files generated by tests
The "install_nextflow" tests generate a new install of Nextflow every time
 they are run based on the "RUNNER_TEMP" environment variable. Deal with
this by adding our RUNNER_TEMP variable to the ava config and making sure
none of these installs get committed.
2024-02-29 19:05:07 -06:00
d734edd2bc test: Add tests for Nextflow release version resolver 2024-02-29 19:05:07 -06:00
d86e286349 feat!: Remove url resolver for NextflowRelease 2024-02-29 19:05:07 -06:00
913140bcc3 feat!: Remove Octkit conversion function for NextflowRelease 2024-02-29 19:05:07 -06:00
40341375dd test!: Remove testing utils for getting GitHub token
This is no longer needed under the new API.
2024-02-29 19:05:07 -06:00
81ae9e771c chore!: Remove octokit throttling dependency 2024-02-29 19:05:07 -06:00
4f10ea1aa5 feat!: Remove Octokit API 2024-02-29 19:05:07 -06:00
caa40cbf6e refactor!: Replace Octokit API with nf-core API in main script 2024-02-29 19:05:07 -06:00
fe7784be92 refactor!: Rename NextflowRelease.allBinaryURL to NextflowRelease.downloadUrlAll
Another API consistency update.
2024-02-29 19:05:07 -06:00
4049d10c6d refactor!: Rename NextflowRelease.binaryURL to NextflowRelease.downloadURL
Another API consistency change.
2024-02-29 19:05:07 -06:00
a6f42a71d4 refactor!: Rename NextflowRelease.versionNumber to NextflowRelease.version
This is to preserve consistency with the new API
2024-02-29 19:05:07 -06:00
c5088a9942 feat!: Remove the "latest-*" version resolvers from get_nextflow_release
Not needed due to the new API
2024-02-29 19:05:07 -06:00
0af53866f0 fix: Fix the version number debug log 2024-02-29 19:05:07 -06:00
5570bb488b test!: Remove version resolving tests for "latest*" versions
This functionality is now offloaded to the API.
2024-02-29 19:05:07 -06:00
214ce026da feat: Make get_nextflow_release compatible with arrays
Although it seems like we're moving backwards, the new API only supports a
single data dump. I still like the iterative nature rather, so tack on
array support.
2024-02-29 19:05:07 -06:00
1c4afed1ea feat: Add nf-core website API wrapper
Basically, a stand-in for OctoKit, but smarter.
2024-02-29 19:05:07 -06:00
98350997f1 feat: Add optional published_at field to NextflowRelease type
Per @ewels request, the API on nf-co.re includes a "published_at" field
with the date of each release. For future compatibility without breaking
anything current, add an optional field that can handle this additional
information.
2024-02-29 19:05:07 -06:00
18 changed files with 296 additions and 647 deletions

1
.actrc
View file

@ -1,3 +1,2 @@
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-s GITHUB_TOKEN
--container-architecture linux/amd64

View file

@ -37,7 +37,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run package
- uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
if: ${{ env.ACT }}
with:
java-version: 11
@ -60,7 +60,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run package
- uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
if: ${{ env.ACT}}
with:
java-version: 11

View file

@ -26,6 +26,6 @@ jobs:
- run: npm run test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4
- uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 # v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

6
.gitignore vendored
View file

@ -131,4 +131,8 @@ dist
# Ignore built ts files
__tests__/runner/*
lib/**/*
lib/**/*
# Testing garbage
.tmp
nxf-v*

5
.vscode/launch.json vendored
View file

@ -13,10 +13,7 @@
"outFiles": ["${workspaceFolder}/lib/**/*.js"],
"env": {
"INPUT_ALL": "false",
"INPUT_VERSION": "latest",
"INPUT_TOKEN": "${env:GITHUB_TOKEN}",
"INPUT_COOLDOWN": "60",
"INPUT_MAX_RETRIES": "3",
"INPUT_VERSION": "v23.10",
"RUNNER_TEMP": "${workspaceFolder}/.tmp"
}
}

View file

@ -7,9 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.0.0] - 2024-03-01
### Added
- `renovate` dependency automation bot (#41)
### Changed
- Upgraded GitHub Actions node version to v20
- Upgraded GitHub Actions node version to v20 (#39)
- GitHub Octokit API switched to nf-core custom API (#37)
### Removed
- Timeout controls for Octokit API (#37)
## [1.5.2] - 2024-02-07
@ -87,7 +98,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- GitHub Actions workflow to test Nextflow installation and downstream usage
- Documentation and license files
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v1.5.2...HEAD
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/nf-core/setup-nextflow/compare/v1.5.2...v2.0.0
[1.5.2]: https://github.com/nf-core/setup-nextflow/compare/v1.5.1...v1.5.2
[1.5.1]: https://github.com/nf-core/setup-nextflow/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/nf-core/setup-nextflow/compare/v1.4.0...v1.5.0

View file

@ -60,17 +60,6 @@ There are three (technically four) aliases to assist in choosing up-to-date Next
A boolean deciding whether to download the "all versions" distribution of Nextflow. May be useful for running tests against multiple versions downstream.
### `token`
> **default: `${{ secrets.GITHUB_TOKEN }}`**
> **:warning: This really shouldn't be changed. If you think this will fix a workflow problem, triple-check everything else first. :warning:**
This action locates the releases based upon the GitHub API, and requires an access token. The default token provided with all GitHub actions should be sufficient for all use cases on GitHub. Valid reasons to change this:
- GitHub Enterprise server (and only under some configurations)
- Testing workflows locally with [act](https://github.com/nektos/act)
## Outputs
There are no outputs from this action.

View file

@ -10,22 +10,6 @@ inputs:
description: "Whether to install every Nextflow release via the '-all' distribution."
required: false
default: false
token:
description: "GitHub token to access the GitHub Releases API. The default token should be sufficient for all use cases."
required: false
default: ${{ github.token }}
deprecationMessage: "setup-nextflow@v2 will no longer use the GitHub API. A token will no longer be needed."
cooldown:
description: "Time (in seconds) to wait before querying the GitHub Releases API in the case of hitting a rate limit."
required: false
default: "60"
deprecationMessage: "setup-nextflow@v2 will no longer use the GitHub API. The cooldown will no longer apply."
max-retries:
description: "The number of times that to try querying the GitHub Releases API in case of a rate-limited failure."
required: false
default: "3"
deprecationMessage: "setup-nextflow@v2 will no longer use the GitHub API. The retry count will no longer apply."
runs:
using: "node20"
main: "dist/index.js"

305
package-lock.json generated
View file

@ -1,31 +1,30 @@
{
"name": "install-nextflow-action",
"version": "1.5.2",
"version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "install-nextflow-action",
"version": "1.5.2",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.8.2",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1",
"@octokit/plugin-throttling": "^8.1.3",
"@types/node": "^20.0.0",
"async-retry": "^1.3.3",
"semver": "^7.3.7"
},
"devDependencies": {
"@ava/typescript": "4.1.0",
"@tsconfig/node16": "16.1.1",
"@tsconfig/node16": "16.1.2",
"@types/async-retry": "1.4.8",
"@types/node": "20.11.24",
"@types/node": "20.11.30",
"@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "7.1.0",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
"@vercel/ncc": "0.38.1",
"ava": "6.1.2",
"c8": "9.1.0",
@ -38,7 +37,7 @@
"lint-staged": "15.2.2",
"prettier": "3.2.5",
"ts-node": "10.9.2",
"typescript": "5.3.3"
"typescript": "5.4.3"
}
},
"node_modules/@aashutoshrathi/word-wrap": {
@ -114,9 +113,9 @@
}
},
"node_modules/@actions/tool-cache/node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
@ -475,21 +474,6 @@
"@octokit/core": ">=5"
}
},
"node_modules/@octokit/plugin-throttling": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-8.2.0.tgz",
"integrity": "sha512-nOpWtLayKFpgqmgD0y3GqXafMFuKcA4tRPZIfu7BArd2lEZeb1988nhWhwx4aZWmjDmUfdgVf7W+Tt4AmvRmMQ==",
"dependencies": {
"@octokit/types": "^12.2.0",
"bottleneck": "^2.15.3"
},
"engines": {
"node": ">= 18"
},
"peerDependencies": {
"@octokit/core": "^5.0.0"
}
},
"node_modules/@octokit/request": {
"version": "8.1.6",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.6.tgz",
@ -581,9 +565,9 @@
"dev": true
},
"node_modules/@tsconfig/node16": {
"version": "16.1.1",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-16.1.1.tgz",
"integrity": "sha512-+pio93ejHN4nINX4pXqfnR/fPLRtJBaT4ORaa5RH0Oc1zoYmo2B2koG+M328CQhHKn1Wj6FcOxCDFXAot9NhvA==",
"version": "16.1.2",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-16.1.2.tgz",
"integrity": "sha512-dQ4IMJsdighPkzI8YNdjZy9Ky2ZAj1m2EkCUfQ575djffboaVJrkl5RmHmmc4MEF7LXVv501aO8KeG5Aa43VHA==",
"dev": true
},
"node_modules/@types/async-retry": {
@ -614,9 +598,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "20.11.24",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz",
"integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==",
"version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@ -635,16 +619,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.0.tgz",
"integrity": "sha512-j6vT/kCulhG5wBmGtstKeiVr1rdXE4nk+DT1k6trYkwlrvW9eOF5ZbgKnd/YR6PcM4uTEXa0h6Fcvf6X7Dxl0w==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz",
"integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/type-utils": "7.1.0",
"@typescript-eslint/utils": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/type-utils": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@ -653,7 +637,7 @@
"ts-api-utils": "^1.0.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -670,19 +654,19 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.0.tgz",
"integrity": "sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz",
"integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -698,16 +682,16 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.0.tgz",
"integrity": "sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz",
"integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0"
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -715,18 +699,18 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.0.tgz",
"integrity": "sha512-UZIhv8G+5b5skkcuhgvxYWHjk7FW7/JP5lPASMEUoliAPwIH/rxoUSQPia2cuOj9AmDZmwUl1usKm85t5VUMew==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz",
"integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/utils": "7.1.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -742,12 +726,12 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.0.tgz",
"integrity": "sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz",
"integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==",
"dev": true,
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -755,13 +739,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.0.tgz",
"integrity": "sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz",
"integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -770,7 +754,7 @@
"ts-api-utils": "^1.0.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -807,21 +791,21 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz",
"integrity": "sha512-WUFba6PZC5OCGEmbweGpnNJytJiLG7ZvDBJJoUcX4qZYf1mGZ97mO2Mps6O2efxJcJdRNpqweCistDbZMwIVHw==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz",
"integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"semver": "^7.5.4"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -832,16 +816,16 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.0.tgz",
"integrity": "sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz",
"integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/types": "7.4.0",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
"node": "^18.18.0 || >=20.0.0"
},
"funding": {
"type": "opencollective",
@ -1481,11 +1465,6 @@
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
"dev": true
},
"node_modules/bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@ -3972,9 +3951,9 @@
"dev": true
},
"node_modules/json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"dependencies": {
"minimist": "^1.2.0"
@ -6079,9 +6058,9 @@
}
},
"node_modules/typescript": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
"integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@ -6107,9 +6086,9 @@
}
},
"node_modules/undici": {
"version": "5.28.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
"version": "5.28.3",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz",
"integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
@ -6621,9 +6600,9 @@
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
}
}
},
@ -6890,15 +6869,6 @@
"@octokit/types": "^12.3.0"
}
},
"@octokit/plugin-throttling": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-8.2.0.tgz",
"integrity": "sha512-nOpWtLayKFpgqmgD0y3GqXafMFuKcA4tRPZIfu7BArd2lEZeb1988nhWhwx4aZWmjDmUfdgVf7W+Tt4AmvRmMQ==",
"requires": {
"@octokit/types": "^12.2.0",
"bottleneck": "^2.15.3"
}
},
"@octokit/request": {
"version": "8.1.6",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.6.tgz",
@ -6969,9 +6939,9 @@
"dev": true
},
"@tsconfig/node16": {
"version": "16.1.1",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-16.1.1.tgz",
"integrity": "sha512-+pio93ejHN4nINX4pXqfnR/fPLRtJBaT4ORaa5RH0Oc1zoYmo2B2koG+M328CQhHKn1Wj6FcOxCDFXAot9NhvA==",
"version": "16.1.2",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-16.1.2.tgz",
"integrity": "sha512-dQ4IMJsdighPkzI8YNdjZy9Ky2ZAj1m2EkCUfQ575djffboaVJrkl5RmHmmc4MEF7LXVv501aO8KeG5Aa43VHA==",
"dev": true
},
"@types/async-retry": {
@ -7002,9 +6972,9 @@
"dev": true
},
"@types/node": {
"version": "20.11.24",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz",
"integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==",
"version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true,
"requires": {
"undici-types": "~5.26.4"
@ -7023,16 +6993,16 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.0.tgz",
"integrity": "sha512-j6vT/kCulhG5wBmGtstKeiVr1rdXE4nk+DT1k6trYkwlrvW9eOF5ZbgKnd/YR6PcM4uTEXa0h6Fcvf6X7Dxl0w==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz",
"integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==",
"dev": true,
"requires": {
"@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/type-utils": "7.1.0",
"@typescript-eslint/utils": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/type-utils": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@ -7042,54 +7012,54 @@
}
},
"@typescript-eslint/parser": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.0.tgz",
"integrity": "sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz",
"integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4"
}
},
"@typescript-eslint/scope-manager": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.0.tgz",
"integrity": "sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz",
"integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0"
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0"
}
},
"@typescript-eslint/type-utils": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.0.tgz",
"integrity": "sha512-UZIhv8G+5b5skkcuhgvxYWHjk7FW7/JP5lPASMEUoliAPwIH/rxoUSQPia2cuOj9AmDZmwUl1usKm85t5VUMew==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz",
"integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==",
"dev": true,
"requires": {
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/utils": "7.1.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
}
},
"@typescript-eslint/types": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.0.tgz",
"integrity": "sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz",
"integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.0.tgz",
"integrity": "sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz",
"integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/visitor-keys": "7.1.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -7119,27 +7089,27 @@
}
},
"@typescript-eslint/utils": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz",
"integrity": "sha512-WUFba6PZC5OCGEmbweGpnNJytJiLG7ZvDBJJoUcX4qZYf1mGZ97mO2Mps6O2efxJcJdRNpqweCistDbZMwIVHw==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz",
"integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==",
"dev": true,
"requires": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "7.1.0",
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/typescript-estree": "7.1.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"semver": "^7.5.4"
}
},
"@typescript-eslint/visitor-keys": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.0.tgz",
"integrity": "sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz",
"integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "7.1.0",
"@typescript-eslint/types": "7.4.0",
"eslint-visitor-keys": "^3.4.1"
}
},
@ -7598,11 +7568,6 @@
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
"dev": true
},
"bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@ -9402,9 +9367,9 @@
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
@ -10840,9 +10805,9 @@
}
},
"typescript": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
"integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"dev": true
},
"unbox-primitive": {
@ -10858,9 +10823,9 @@
}
},
"undici": {
"version": "5.28.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
"version": "5.28.3",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz",
"integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==",
"requires": {
"@fastify/busboy": "^2.0.0"
}

View file

@ -1,6 +1,6 @@
{
"name": "install-nextflow-action",
"version": "1.5.2",
"version": "2.0.0",
"description": "An action to install Nextflow into a GitHub Actions workflow and make it available for subsequent steps.",
"main": "lib/src/main.js",
"scripts": {
@ -28,6 +28,9 @@
"extensions": [
"ts"
],
"environmentVariables": {
"RUNNER_TEMP": "./.tmp"
},
"rewritePaths": {
"src/": "lib/"
},
@ -43,7 +46,8 @@
],
"concurrency": 1,
"serial": true,
"powerAssert": true
"powerAssert": true,
"timeout": "120s"
},
"license": "MIT",
"dependencies": {
@ -51,19 +55,18 @@
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1",
"@octokit/plugin-throttling": "^8.1.3",
"@types/node": "^20.0.0",
"async-retry": "^1.3.3",
"semver": "^7.3.7"
},
"devDependencies": {
"@ava/typescript": "4.1.0",
"@tsconfig/node16": "16.1.1",
"@tsconfig/node16": "16.1.2",
"@types/async-retry": "1.4.8",
"@types/node": "20.11.24",
"@types/node": "20.11.30",
"@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
"@vercel/ncc": "0.38.1",
"ava": "6.1.2",
"c8": "9.1.0",
@ -76,7 +79,7 @@
"lint-staged": "15.2.2",
"prettier": "3.2.5",
"ts-node": "10.9.2",
"typescript": "5.3.3"
"typescript": "5.4.3"
},
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix",

View file

@ -6,115 +6,15 @@ import semver from "semver"
import { NextflowRelease } from "./nextflow-release"
async function get_latest_everything_nextflow_release(
releases: AsyncGenerator<NextflowRelease>
): Promise<NextflowRelease> {
// Need to make sure we aren't in the edge case where a patch release is
// more recent chronologically than the edge release
let latest_release = {} as NextflowRelease
for await (const release of releases) {
// First iteration:
if (Object.keys(latest_release).length === 0) {
// If the most recent release is an edge release, then we have nothing to
// worry about, return it.
if (release.isEdge) {
return release
}
// Ok, so the most recent release is a stable release. We need to keep
// tabs on it
latest_release = release
continue
}
// A larger version number that is older than the "latest" release
// indicates that we've hit an edge release that is more up-to-date
// than a patch release. Return it.
if (semver.gt(release.versionNumber, latest_release.versionNumber, true)) {
return release
}
// A smaller version number that is also an edge release indicates that the
// chronologically most recent release is also the most up-to-date
if (
release.isEdge &&
semver.lt(release.versionNumber, latest_release.versionNumber, true)
) {
return latest_release
}
// Once we've hit the major.minor.0 of the version that is the most recent
// patch, we know that we would have traversed any edge releases along the
// way, so check to see if we've hit that point yet.
const latest_release_major = semver.major(
latest_release.versionNumber,
true
)
const latest_release_minor = semver.minor(
latest_release.versionNumber,
true
)
const latest_release_minver = `${latest_release_major}.${latest_release_minor}.0`
if (semver.eq(release.versionNumber, latest_release_minver, true)) {
return latest_release
}
}
// We should never get here, but just in case
return {} as NextflowRelease
}
async function get_latest_edge_nextflow_release(
releases: AsyncGenerator<NextflowRelease>
): Promise<NextflowRelease> {
// Because we don't have to worry about crossing between edge and stable
// releases, we can just return the first edge release we come across
for await (const release of releases) {
if (release.isEdge) {
return release
}
}
// We should never get here, but just in case
return {} as NextflowRelease
}
async function get_latest_stable_nextflow_release(
releases: AsyncGenerator<NextflowRelease>
): Promise<NextflowRelease> {
// Because we don't have to worry about crossing between edge and stable
// releases, we can just return the first stable release we come across
for await (const release of releases) {
if (!release.isEdge) {
return release
}
}
// We should never get here, but just in case
return {} as NextflowRelease
}
export async function get_nextflow_release(
version: string,
releases: AsyncGenerator<NextflowRelease>
releases: NextflowRelease[] | AsyncGenerator<NextflowRelease>
): Promise<NextflowRelease> {
// First, check to see if we are using a "latest-*" version system, and return
// early
if (version === "latest-everything") {
return await get_latest_everything_nextflow_release(releases)
}
if (version === "latest-edge") {
return await get_latest_edge_nextflow_release(releases)
}
if (version === "latest" || version === "latest-stable") {
return await get_latest_stable_nextflow_release(releases)
}
// The releases are sent in reverse chronological order
// If we are sent a numbered tag, then back through the list until we find
// a release that fulfils the requested version number
for await (const release of releases) {
if (semver.satisfies(release.versionNumber, version, true)) {
if (semver.satisfies(release.version, version, true)) {
return release
}
}
@ -127,8 +27,8 @@ export async function install_nextflow(
release: NextflowRelease,
get_all: boolean
): Promise<string> {
const url = get_all ? release.allBinaryURL : release.binaryURL
const version = release.versionNumber
const url = get_all ? release.downloadUrlAll : release.downloadUrl
const version = release.version
core.debug(`Downloading Nextflow from ${url}`)
const nf_dl_path = await retry(

View file

@ -11,10 +11,9 @@ import {
} from "./functions"
import { NextflowRelease } from "./nextflow-release"
import {
pull_latest_stable_release,
pull_releases,
setup_octokit
} from "./octokit-wrapper"
get_latest_nextflow_version,
get_nextflow_versions
} from "./nf-core-api-wrapper"
async function run(): Promise<void> {
// CAPSULE_LOG leads to a bunch of boilerplate being output to the logs: turn
@ -22,33 +21,29 @@ async function run(): Promise<void> {
core.exportVariable("CAPSULE_LOG", "none")
// Read in the arguments
const token = core.getInput("token")
const version = core.getInput("version")
const get_all = core.getBooleanInput("all")
const cooldown = Number(core.getInput("cooldown"))
const max_retries = Number(core.getInput("max-retries"))
// Check the cache for the Nextflow version that matched last time
if (check_cache(version)) {
return
}
// Setup the API
const octokit = await setup_octokit(token, cooldown, max_retries)
// Get the release info for the desired release
let release = {} as NextflowRelease
let resolved_version = ""
try {
if (version === "latest" || version === "latest-stable") {
release = await pull_latest_stable_release(octokit)
if (version.includes("latest")) {
let flavor = version.split("-")[1]
flavor = flavor ? flavor : "stable"
release = await get_latest_nextflow_version(flavor)
} else {
const release_iterator = pull_releases(octokit)
release = await get_nextflow_release(version, release_iterator)
const nextflow_releases = await get_nextflow_versions()
release = await get_nextflow_release(version, nextflow_releases)
}
resolved_version = release.versionNumber
resolved_version = release.version
core.info(
`Input version '${version}' resolved to Nextflow ${release["name"]}`
`Input version '${version}' resolved to Nextflow ${release.version}`
)
} catch (e: unknown) {
if (e instanceof Error) {

View file

@ -2,48 +2,9 @@
* Houses the pertinent data that GitHub exposes for each Nextflow release
*/
export type NextflowRelease = {
versionNumber: string
version: string
isEdge: boolean
binaryURL: string
allBinaryURL: string
}
/**
* Converts the raw OctoKit data into a structured NextflowRelease
* @param data A "release" data struct from OctoKit
* @returns `data` converted into a `NextflowRelease`
*/
export function nextflow_release(data: object): NextflowRelease {
const nf_release: NextflowRelease = {
versionNumber: data["tag_name"],
isEdge: data["prerelease"],
binaryURL: nextflow_bin_url(data, false),
allBinaryURL: nextflow_bin_url(data, true)
}
return nf_release
}
/**
* Gets the download URL of a Nextflow binary
* @param release A "release" data struct from OctoKit
* @param get_all Whether to return the url for the "all" variant of Nextflow
* @returns The URL of the Nextflow binary
*/
export function nextflow_bin_url(release: object, get_all: boolean): string {
const release_assets = release["assets"]
const all_asset = release_assets.filter((a: object) => {
return a["browser_download_url"].endsWith("-all")
})[0]
const regular_asset = release_assets.filter((a: object) => {
return a["name"] === "nextflow"
})[0]
const dl_asset = get_all ? all_asset : regular_asset
if (dl_asset) {
return dl_asset.browser_download_url
} else {
// Old pre-release versions of Nextflow didn't have an "all" variant. To
// avoid downstream errors, substitute the regular url here.
return regular_asset.browser_download_url
}
downloadUrl: string
downloadUrlAll: string
published_at?: string
}

View file

@ -0,0 +1,44 @@
import { info } from "@actions/core"
import { downloadTool } from "@actions/tool-cache"
import retry from "async-retry"
import { readFileSync } from "fs"
import { NextflowRelease } from "./nextflow-release"
async function fetch_nextflow_versions_data(): Promise<object> {
// Occasionally the connection is reset for unknown reasons
// In those cases, retry the download
const versionsFile = await retry(
async () => {
return await downloadTool("https://nf-co.re/nextflow_version")
},
{
retries: 5,
onRetry: (err: Error) => {
info(`Download of versions.json failed, trying again. Error: ${err}`)
}
}
)
return JSON.parse(readFileSync(versionsFile).toString())
}
export async function get_nextflow_versions(): Promise<NextflowRelease[]> {
const version_dataset = await fetch_nextflow_versions_data()
const versions = version_dataset["versions"]
const nextflow_releases: NextflowRelease[] = []
for (const element of versions) {
const release = element as NextflowRelease
nextflow_releases.push(release)
}
return nextflow_releases
}
export async function get_latest_nextflow_version(
flavor: string
): Promise<NextflowRelease> {
const version_dataset = await fetch_nextflow_versions_data()
const latest_versions = version_dataset["latest"]
const latest_version = latest_versions[flavor] as NextflowRelease
return latest_version
}

View file

@ -1,94 +0,0 @@
import * as core from "@actions/core"
import { getOctokitOptions, GitHub } from "@actions/github/lib/utils"
import { throttling } from "@octokit/plugin-throttling"
import { nextflow_release, NextflowRelease } from "./nextflow-release"
const NEXTFLOW_REPO = {
owner: "nextflow-io",
repo: "nextflow",
per_page: 100,
headers: {
"x-github-api-version": "2022-11-28"
}
}
export async function setup_octokit(
github_token: string,
cooldown = 60,
max_retries = 3
): Promise<InstanceType<typeof GitHub>> {
const throttledOctokit = GitHub.plugin(throttling)
let octokit = {} as InstanceType<typeof GitHub>
try {
octokit = new throttledOctokit(
getOctokitOptions(github_token, {
throttle: {
onRateLimit: (retryAfter, options, ok, retryCount) => {
ok.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`
)
if (retryCount < max_retries) {
ok.log.info(`Retrying after ${retryAfter} seconds!`)
return true
}
},
onSecondaryRateLimit: (retryAfter, options, ok, retryCount) => {
ok.log.warn(
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
)
if (retryCount < max_retries) {
octokit.log.info(`Retrying after ${retryAfter} seconds!`)
return true
}
},
fallbackSecondaryRateRetryAfter: cooldown
}
})
)
} catch (e: unknown) {
if (e instanceof Error) {
core.setFailed(
`Could not authenticate to GitHub Releases API with provided token\n${e.message}`
)
}
}
return octokit
}
export async function* pull_releases(
octokit: InstanceType<typeof GitHub>
): AsyncGenerator<NextflowRelease> {
const iterator = octokit.paginate.iterator(
octokit.rest.repos.listReleases,
NEXTFLOW_REPO
)
let item_index = 0
let release_items = []
/* eslint-disable-next-line @typescript-eslint/unbound-method */
const { next } = iterator[Symbol.asyncIterator]()
let request = await next()
release_items = request.value.data
while (true) {
if (item_index > release_items.length) {
request = await next()
release_items = request.value.data
item_index = 0
}
yield nextflow_release(release_items[item_index++])
}
}
export async function pull_latest_stable_release(
ok: InstanceType<typeof GitHub>
): Promise<NextflowRelease> {
const { data: stable_release } =
await ok.rest.repos.getLatestRelease(NEXTFLOW_REPO)
return nextflow_release(stable_release)
}

View file

@ -1,6 +1,7 @@
import test from "ava" // eslint-disable-line import/no-unresolved
import test from "ava" //eslint-disable-line import/no-unresolved
import { execSync } from "child_process"
import * as functions from "../src/functions"
import { get_nextflow_release, install_nextflow } from "../src/functions"
import { NextflowRelease } from "../src/nextflow-release"
// The Nextflow releases we are going to use for testing follow a regular
@ -9,10 +10,10 @@ import { NextflowRelease } from "../src/nextflow-release"
function nf_release_gen(version_number: string): NextflowRelease {
const is_edge = version_number.endsWith("-edge")
const release: NextflowRelease = {
versionNumber: version_number,
version: version_number,
isEdge: is_edge,
binaryURL: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow`,
allBinaryURL: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow-${version_number.replace(
downloadUrl: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow`,
downloadUrlAll: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow-${version_number.replace(
"v",
""
)}-all`
@ -20,95 +21,85 @@ function nf_release_gen(version_number: string): NextflowRelease {
return release
}
// A mock set of Nextflow releases
async function* edge_is_newer(): AsyncGenerator<NextflowRelease> {
yield nf_release_gen("v23.09.1-edge")
yield nf_release_gen("v23.04.3")
yield nf_release_gen("v23.04.2")
}
async function* edge_is_older(): AsyncGenerator<NextflowRelease> {
yield nf_release_gen("v23.04.3")
yield nf_release_gen("v23.04.2")
yield nf_release_gen("v23.03.0-edge")
}
/*
The whole reason this action exists is to handle the cases where a final
release is the "bleeding edge" release, rather than the "edge" release, even
though that's what the name would imply. Therefore, we need to test that the
'latest-everything' parameter can find the correct one regardless of whether
an "edge" release or a stable release is the true latest
*/
const release_filter_macro = test.macro(
const release_test_macro = test.macro(
async (
t,
input_version: string,
expected_version: string,
releases: AsyncGenerator<NextflowRelease>
is_edge_older: Boolean
) => {
const matched_release = await functions.get_nextflow_release(
const releases_set = [
nf_release_gen("v21.05.1-edge"),
nf_release_gen("v21.05.0-edge"),
nf_release_gen("v21.04.2"),
nf_release_gen("v21.04.1"),
nf_release_gen("v21.04.0"),
nf_release_gen("v21.03.0-edge")
]
const release_filtered = releases_set.splice(is_edge_older ? 2 : 0)
const matched_release = await get_nextflow_release(
input_version,
releases
release_filtered
)
t.is(matched_release.versionNumber, expected_version)
t.is(matched_release.version, expected_version)
}
)
test(
"Latest-everything install with newer edge release",
release_filter_macro,
"latest-everything",
"v23.09.1-edge",
edge_is_newer()
"Major and minor version only (edge newer)",
release_test_macro,
"v21.04",
"v21.04.2",
false
)
test(
"Latest-everything install with older edge release",
release_filter_macro,
"latest-everything",
"v23.04.3",
edge_is_older()
"Major and minor version only (edge older)",
release_test_macro,
"v21.04",
"v21.04.2",
true
)
test(
"Latest-edge install with newer edge release",
release_filter_macro,
"latest-edge",
"v23.09.1-edge",
edge_is_newer()
"Major, minor, and patch version: latest patch (edge newer)",
release_test_macro,
"v21.04.2",
"v21.04.2",
false
)
test(
"Latest-edge install with older edge release",
release_filter_macro,
"latest-edge",
"v23.03.0-edge",
edge_is_older()
"Major, minor, and patch version: latest patch (edge older)",
release_test_macro,
"v21.04.2",
"v21.04.2",
true
)
test(
"Latest-stable install with newer edge release",
release_filter_macro,
"latest",
"v23.04.3",
edge_is_newer()
"Major, minor, and patch version: older patch (edge newer)",
release_test_macro,
"v21.04.1",
"v21.04.1",
false
)
test(
"Latest-stable install with older edge release",
release_filter_macro,
"latest",
"v23.04.3",
edge_is_older()
"Major, minor, and patch version: older patch (edge older)",
release_test_macro,
"v21.04.1",
"v21.04.1",
true
)
test(
"Fully versioned tag release",
release_filter_macro,
"v23.04.2",
"v23.04.2",
edge_is_newer()
)
test(
"Partially versioned tag release",
release_filter_macro,
"v23.04",
"v23.04.3",
edge_is_newer()
"Edge release",
release_test_macro,
"v21.03.0-edge",
"v21.03.0-edge",
false
)
test.todo("install_nextflow")
test("Install Nextflow", async t => {
const release = nf_release_gen("v23.10.1")
const install_dir = await install_nextflow(release, false)
const version_output = execSync(`${install_dir}/nextflow -v`).toString()
const version_regex = /nextflow version 23\.10\.1.*/
t.regex(version_output, version_regex)
})

View file

@ -1,89 +0,0 @@
import * as github from "@actions/github"
import { GitHub } from "@actions/github/lib/utils"
import anyTest, { TestFn } from "ava" // eslint-disable-line import/no-unresolved
import { NextflowRelease } from "../src/nextflow-release"
import {
pull_latest_stable_release,
pull_releases
} from "../src/octokit-wrapper"
import { getToken } from "./utils"
const test = anyTest as TestFn<{
token: string
octokit: InstanceType<typeof GitHub>
}>
test.before(t => {
const first = true
const current_token = getToken(first)
t.context = {
token: current_token,
octokit: github.getOctokit(current_token)
}
})
async function get_latest_release(
octokit: InstanceType<typeof GitHub>,
use_latest_api: boolean
): Promise<NextflowRelease> {
if (use_latest_api) {
return await pull_latest_stable_release(octokit)
} else {
const all_releases = pull_releases(octokit)
const first_response = await all_releases.next()
const first_release = first_response.value
? first_response.value
: ({} as NextflowRelease)
return first_release
}
}
const version_macro = test.macro(
async (t, object_name: string, use_latest_api: boolean) => {
const latest_release = await get_latest_release(
t.context.octokit,
use_latest_api
)
t.assert(latest_release[object_name])
}
)
test(
"OctoKit iterator returns semver-parsable version number",
version_macro,
"versionNumber",
false
)
test(
"OctoKit latest API returns semver-parable version number",
version_macro,
"versionNumber",
true
)
const binary_url_macro = test.macro(
async (t, get_all: boolean, use_latest_api: boolean) => {
const latest_release = await get_latest_release(
t.context.octokit,
use_latest_api
)
const url = get_all ? latest_release.allBinaryURL : latest_release.binaryURL
t.notThrows(() => new URL(url))
}
)
test("Nextflow binary URL from iterator valid", binary_url_macro, false, false)
test("Nextflow binary URL from latest API valid", binary_url_macro, false, true)
test(
"Nextflow all binary URL from iterator valid",
binary_url_macro,
true,
false
)
test(
"Nextflow all binary URL from latest API valid",
binary_url_macro,
true,
true
)

View file

@ -1,12 +0,0 @@
export function getToken(first: boolean): string {
const token = process.env["GITHUB_TOKEN"] || ""
if (!token && first) {
/* eslint-disable-next-line no-console */
console.warn(
"Skipping GitHub tests. Set $GITHUB_TOKEN to run REST client and GraphQL client tests"
)
first = false
}
return token
}