This commit is contained in:
Niccolo Borgioli 2024-07-31 21:10:01 +02:00
parent 68c487857d
commit a033f712a1
8 changed files with 65 additions and 75 deletions

View File

@ -3,7 +3,7 @@ name: Matrix Cron Build
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: "0 3 * * 1" - cron: '0 3 * * 1'
jobs: jobs:
tags: tags:
@ -14,13 +14,11 @@ jobs:
run: run:
working-directory: tags working-directory: tags
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: oven-sh/setup-bun@v2
with: - run: bun i
node-version: 18
- run: npm i
- id: fetcher - id: fetcher
run: node . run: bun .
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -28,7 +26,7 @@ jobs:
strategy: strategy:
matrix: ${{fromJson(needs.tags.outputs.matrix)}} matrix: ${{fromJson(needs.tags.outputs.matrix)}}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
@ -37,12 +35,12 @@ jobs:
install: true install: true
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -50,7 +48,7 @@ jobs:
- name: Docker Labels - name: Docker Labels
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: | images: |
cupcakearmy/static cupcakearmy/static
@ -59,7 +57,7 @@ jobs:
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v6
with: with:
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64

View File

@ -1,12 +1,11 @@
# BUILDER # BUILDER
FROM alpine AS builder FROM alpine:3 AS builder
ARG DEP_DEV="alpine-sdk zlib-dev pcre-dev openssl-dev gd-dev" ARG DEP_DEV="alpine-sdk zlib-dev pcre-dev openssl-dev gd-dev curl"
RUN apk add --no-cache ${DEP_DEV} RUN apk add --no-cache ${DEP_DEV}
WORKDIR /build WORKDIR /build
ARG NGINX=1.21.6 ARG NGINX
RUN curl https://nginx.org/download/nginx-${NGINX}.tar.gz | tar xz RUN curl https://nginx.org/download/nginx-${NGINX}.tar.gz | tar xz
RUN mv nginx-${NGINX} nginx RUN mv nginx-${NGINX} nginx
RUN git clone --recursive https://github.com/google/ngx_brotli.git RUN git clone --recursive https://github.com/google/ngx_brotli.git

15
tags/README.md Normal file
View File

@ -0,0 +1,15 @@
# tags
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.js
```
This project was created using `bun init` in bun v1.1.20. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

BIN
tags/bun.lockb Executable file

Binary file not shown.

View File

@ -1,4 +1,4 @@
import { info, setOutput } from '@actions/core' import { info, setOutput, error } from '@actions/core'
import semver from 'semver' import semver from 'semver'
// Fetch the current versions from the download page // Fetch the current versions from the download page
@ -9,8 +9,13 @@ const html = await fetch(URL).then((r) => r.text())
const re = /"\/download\/nginx-(\d+\.){3}tar\.gz"/g const re = /"\/download\/nginx-(\d+\.){3}tar\.gz"/g
const matches = html.match(re) const matches = html.match(re)
if (!matches) {
error(`No versions found at ${URL}`)
process.exit(1)
}
// Clean up the matches to semver format // Clean up the matches to semver format
function clean(match) { function clean(match: string): string {
return match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '') return match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '')
} }
const versions = matches.map(clean) const versions = matches.map(clean)
@ -19,7 +24,7 @@ const versions = matches.map(clean)
// Get the two most up to date versions, mainline and stable // Get the two most up to date versions, mainline and stable
const filtered = versions.sort(semver.rcompare).slice(0, 2) const filtered = versions.sort(semver.rcompare).slice(0, 2)
function convert(version, additional = []) { function convert(version: string, additional: string[] = []) {
return { return {
version, version,
// https://github.com/docker/metadata-action#typeraw // https://github.com/docker/metadata-action#typeraw

View File

@ -1,8 +1,16 @@
{ {
"type": "module", "type": "module",
"main": "index.js", "main": "index.ts",
"dependencies": {
"@actions/core": "^1.10.1",
"semver": "^7.6.3"
},
"devDependencies": { "devDependencies": {
"@actions/core": "^1.10.0", "@tsconfig/strictest": "^2.0.5",
"semver": "^7.3.8" "@types/bun": "latest",
"@types/semver": "^7.5.8"
},
"peerDependencies": {
"typescript": "^5.5.4"
} }
} }

View File

@ -1,53 +0,0 @@
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

18
tags/tsconfig.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": "@tsconfig/strictest",
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true
}
}