mirror of
https://github.com/cupcakearmy/docker-static.git
synced 2024-12-22 00:06:31 +00:00
matrix build
This commit is contained in:
parent
b6f2e57965
commit
56f983a8e1
16
.github/workflows/trial.yml
vendored
16
.github/workflows/trial.yml
vendored
@ -8,12 +8,22 @@ on:
|
|||||||
# - "v*.*.*"
|
# - "v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
tags:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
- run: npm i
|
||||||
|
- run: node fetch.mjs
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
${{fromJson(needs.tags.outputs.matrix)}}
|
||||||
- tag: 1.20.2
|
# include:
|
||||||
version: 1.20.2
|
# - tag: 1.20.2
|
||||||
|
# version: 1.20.2
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
29
fetch.mjs
Normal file
29
fetch.mjs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { setOutput } from '@actions/core'
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
|
||||||
|
// Map the docker tags to the versions
|
||||||
|
const tagsMap = Object.fromEntries(versions.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 })),
|
||||||
|
}
|
||||||
|
|
||||||
|
setOutput('matrix', githubActionMatrix)
|
5
package.json
Normal file
5
package.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^1.10.0"
|
||||||
|
}
|
||||||
|
}
|
32
pnpm-lock.yaml
generated
Normal file
32
pnpm-lock.yaml
generated
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
lockfileVersion: 5.4
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
'@actions/core': ^1.10.0
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
'@actions/core': 1.10.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/@actions/core/1.10.0:
|
||||||
|
resolution: {integrity: sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==}
|
||||||
|
dependencies:
|
||||||
|
'@actions/http-client': 2.0.1
|
||||||
|
uuid: 8.3.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/@actions/http-client/2.0.1:
|
||||||
|
resolution: {integrity: sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==}
|
||||||
|
dependencies:
|
||||||
|
tunnel: 0.0.6
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/tunnel/0.0.6:
|
||||||
|
resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
|
||||||
|
engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/uuid/8.3.2:
|
||||||
|
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
|
||||||
|
hasBin: true
|
||||||
|
dev: false
|
Loading…
Reference in New Issue
Block a user