mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 08:25:07 +03:00
restock: rebuilds all vx & platforms for a project
This commit is contained in:
parent
7f110f2627
commit
b00f951397
2 changed files with 51 additions and 0 deletions
17
.github/scripts/inventory.ts
vendored
Executable file
17
.github/scripts/inventory.ts
vendored
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env -S pkgx deno run --allow-net
|
||||||
|
|
||||||
|
const [project] = Deno.args
|
||||||
|
|
||||||
|
let versions: string[] = []
|
||||||
|
|
||||||
|
for (const platform of ["linux", "darwin"]) {
|
||||||
|
for (const arch of ["x86-64", "aarch64"]) {
|
||||||
|
const url = `https://dist.pkgx.dev/${project}/${platform}/${arch}/versions.txt`
|
||||||
|
const txt = await (await fetch(url)).text()
|
||||||
|
versions.push(...txt.split("\n"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
versions = [...new Set(versions.filter(x => x.trim()))]
|
||||||
|
|
||||||
|
console.log(JSON.stringify(versions))
|
34
.github/workflows/restock.yml
vendored
Normal file
34
.github/workflows/restock.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: restock project inventory
|
||||||
|
run-name: rebuilding ${{ inputs.project }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
project:
|
||||||
|
description: a single project, eg. `foo.com`
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ingest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.fetch.outputs.plan }}
|
||||||
|
steps:
|
||||||
|
- uses: pkgxdev/setup@v2
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: ./.github/actions/inventory.ts ${{ inputs.project }}
|
||||||
|
id: fetch
|
||||||
|
|
||||||
|
pkg:
|
||||||
|
needs: ingest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: ${{ fromJSON(needs.ingest.outputs.versions) }}
|
||||||
|
uses: ./.github/workflows/pkg.yml
|
||||||
|
permissions:
|
||||||
|
issues: write #FIXME we don’t want this but I don’t think we can alter the way permissions are inherited
|
||||||
|
with:
|
||||||
|
pkg: ${{inputs.project}}=${{ matrix.version }}
|
||||||
|
secrets: inherit
|
Loading…
Reference in a new issue