Compare commits

..

No commits in common. "cf34f14778dd36c796ec3c9a4e7f9410a021528d" and "68c487857debb285b28d7f1524aa6037a7bd318d" have entirely different histories.

8 changed files with 77 additions and 72 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,11 +14,13 @@ jobs:
run: run:
working-directory: tags working-directory: tags
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v3
- run: bun i with:
node-version: 18
- run: npm i
- id: fetcher - id: fetcher
run: bun . run: node .
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -26,7 +28,7 @@ jobs:
strategy: strategy:
matrix: ${{fromJson(needs.tags.outputs.matrix)}} matrix: ${{fromJson(needs.tags.outputs.matrix)}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- 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
@ -35,12 +37,12 @@ jobs:
install: true install: true
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v2
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@v3 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -48,7 +50,7 @@ jobs:
- name: Docker Labels - name: Docker Labels
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v4
with: with:
images: | images: |
cupcakearmy/static cupcakearmy/static
@ -57,7 +59,7 @@ jobs:
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v2
with: with:
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64

View File

@ -1,11 +1,12 @@
# BUILDER # BUILDER
FROM alpine:3 AS builder FROM alpine AS builder
ARG DEP_DEV="alpine-sdk zlib-dev pcre-dev openssl-dev gd-dev curl" ARG DEP_DEV="alpine-sdk zlib-dev pcre-dev openssl-dev gd-dev"
RUN apk add --no-cache ${DEP_DEV} RUN apk add --no-cache ${DEP_DEV}
WORKDIR /build WORKDIR /build
ARG NGINX ARG NGINX=1.21.6
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

View File

@ -1,15 +0,0 @@
# 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.

Binary file not shown.

View File

@ -1,4 +1,4 @@
import { info, setOutput, setFailed } from '@actions/core' import { info, setOutput } 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,27 +9,17 @@ 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) {
setFailed(`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: string): string { function clean(match) {
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)
// Filter // Filter
// Get the two most up to date versions, mainline and stable // Get the two most up to date versions, mainline and stable
const [mainline, stable] = versions.sort(semver.rcompare).slice(0, 2) const filtered = versions.sort(semver.rcompare).slice(0, 2)
if (!mainline || !stable) { function convert(version, additional = []) {
setFailed(`Could not find mainline and stable versions`)
process.exit(1)
}
function convert(version: string, additional: string[] = []) {
return { return {
version, version,
// https://github.com/docker/metadata-action#typeraw // https://github.com/docker/metadata-action#typeraw
@ -40,7 +30,7 @@ function convert(version: string, additional: string[] = []) {
// Export as github action matrix // Export as github action matrix
// https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations // https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
const githubActionMatrix = { const githubActionMatrix = {
include: [convert(mainline, ['latest', 'mainline']), convert(stable, ['stable'])], include: [convert(filtered[0], ['latest', 'mainline']), convert(filtered[1], ['stable'])],
} }
const serialised = JSON.stringify(githubActionMatrix) const serialised = JSON.stringify(githubActionMatrix)

View File

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

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

View File

@ -1,18 +0,0 @@
{
"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
}
}