move to subdirectory

This commit is contained in:
2022-11-01 21:07:58 +01:00
parent 6af204ca70
commit 403c9ad0c6
5 changed files with 6 additions and 1 deletions

1
tags/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

37
tags/index.js Normal file
View File

@@ -0,0 +1,37 @@
import { info, setOutput } from '@actions/core'
import semver from 'semver'
// Fetch the current versions from the download page
const URL = `https://nginx.org/en/download.html`
const html = await fetch(URL).then((r) => r.text())
// Find all the downloadable versions
const re = /"\/download\/nginx-(\d+\.){3}tar\.gz"/g
const matches = html.match(re)
// Clean up the matches to semver format
const clean = (match) => match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '')
const versions = matches.map(clean)
// Filter
const MIN_VERSION = '1.20.0'
const filtered = versions.filter((v) => semver.gte(v, MIN_VERSION))
// Map the docker tags to the versions
const tagsMap = Object.fromEntries(filtered.map((v) => [v, v]))
// Add the mainline, stable and latests tags
tagsMap['latest'] = versions[0]
tagsMap['mainline'] = versions[0]
tagsMap['stable'] = versions[1]
// Export as github action matrix
// https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
const githubActionMatrix = {
include: Object.entries(tagsMap).map(([tag, version]) => ({ tag, version })),
}
const serialised = JSON.stringify(githubActionMatrix)
info(`Found ${versions.length} versions`)
info(`Exporting as github action matrix: ${serialised}`)
setOutput('matrix', serialised)

8
tags/package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"type": "module",
"main": "index.js",
"devDependencies": {
"@actions/core": "^1.10.0",
"semver": "^7.3.8"
}
}

53
tags/pnpm-lock.yaml generated Normal file
View File

@@ -0,0 +1,53 @@
lockfileVersion: 5.4
specifiers:
'@actions/core': ^1.10.0
semver: ^7.3.8
devDependencies:
'@actions/core': 1.10.0
semver: 7.3.8
packages:
/@actions/core/1.10.0:
resolution: {integrity: sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==}
dependencies:
'@actions/http-client': 2.0.1
uuid: 8.3.2
dev: true
/@actions/http-client/2.0.1:
resolution: {integrity: sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==}
dependencies:
tunnel: 0.0.6
dev: true
/lru-cache/6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
dev: true
/semver/7.3.8:
resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/tunnel/0.0.6:
resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'}
dev: true
/uuid/8.3.2:
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
hasBin: true
dev: true
/yallist/4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: true