Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependency-policy.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = 2
mode = "auto"
ci_workflow = "ci.yml"
required_checks = ["validate / Fast source checks / Make fast", "Documentation policy"]
required_checks = ["Build & Test", "Documentation policy"]
max_group_size = 10
managed_dependencies = ["aviorstudio/gdam-actions/*", "nicodes/komizo-actions/*", "nicodes/komizo/*", "nicodes/tools/*"]
sensitive_dependencies = ["*clerk*", "*pocketbase*", "*crypto*", "*jsonwebtoken*", "*jose*", "*oauth*", "*openid*", "*passport*", "*bcrypt*", "*argon2*", "@noble/*", "*prisma*", "*drizzle*", "*migrate*", "modernc.org/sqlite", "github.com/jackc/pgx/*", "github.com/go-sql-driver/mysql", "go.mongodb.org/mongo-driver/*"]
Expand Down
30 changes: 8 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated cookbook caller. Change recipe data and regenerate.
name: Build & Test
run-name: "Build & Test · ${{ github.event.pull_request.number && format('PR #{0}', github.event.pull_request.number) || inputs.source || github.ref_name }}"
'on':
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Expand All @@ -21,43 +22,28 @@ concurrency:
cancel-in-progress: true
jobs:
validate:
uses: nicodes/cookbook/.github/workflows/cookbook-ci.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
name: Checks
uses: nicodes/cookbook/.github/workflows/cookbook-native.yml@f1c6a5d224776bcee5128a8ce91392483af22566
permissions:
contents: read
actions: read
pull-requests: read
with:
cookbook-ref: ${{ inputs.cookbook || '77d7bfa24cf0ec35a2de7585d48797b64f41cbb3' }}
cookbook-ref: ${{ inputs.cookbook || 'f1c6a5d224776bcee5128a8ce91392483af22566' }}
source: ${{ inputs.source || github.sha }}
merge-gate: true
recipe: rust-cli
runner: ubuntu-24.04
timeout-minutes: 30
complete:
if: github.event_name == 'pull_request'
uses: nicodes/cookbook/.github/workflows/cookbook-ci.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
permissions:
contents: read
actions: read
pull-requests: read
with:
cookbook-ref: ${{ inputs.cookbook || '77d7bfa24cf0ec35a2de7585d48797b64f41cbb3' }}
source: ${{ inputs.source || github.sha }}
merge-gate: false
recipe: rust-cli
runner: ubuntu-24.04
timeout-minutes: 30
full-validation:
name: Full validation
build-test:
name: Build & Test
if: always()
needs: [validate, complete]
needs: [validate]
runs-on: ubuntu-24.04
timeout-minutes: 1
permissions: {}
steps:
- name: Require the complete current source validation
timeout-minutes: 1
uses: nicodes/cookbook/ci-result@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
uses: nicodes/cookbook/ci-result@f1c6a5d224776bcee5128a8ce91392483af22566
with:
event-name: ${{ github.event_name }}
needs: ${{ toJSON(needs) }}
4 changes: 2 additions & 2 deletions .github/workflows/dependency-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ name: Dependency Policy
permissions: {}
jobs:
request:
uses: nicodes/cookbook/.github/workflows/cookbook-dependencies.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
uses: nicodes/cookbook/.github/workflows/cookbook-dependencies.yml@f1c6a5d224776bcee5128a8ce91392483af22566
permissions:
contents: read
pull-requests: read
actions: write
checks: read
statuses: read
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
154 changes: 25 additions & 129 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated cookbook caller. Change recipe data and regenerate.
# Attestation stays in this source workflow to preserve published installer trust.
name: Release
run-name: "Release · ${{ inputs.bump }}"
'on':
workflow_dispatch:
inputs:
Expand All @@ -19,9 +20,9 @@ jobs:
name: Select immutable release identity
permissions:
contents: read
uses: nicodes/cookbook/.github/workflows/cookbook-cli-identity.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
uses: nicodes/cookbook/.github/workflows/cookbook-cli-identity.yml@f1c6a5d224776bcee5128a8ce91392483af22566
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
bump: ${{ inputs.bump }}
validate:
name: Validate release source and native archives
Expand All @@ -30,9 +31,9 @@ jobs:
contents: read
actions: read
pull-requests: read
uses: nicodes/cookbook/.github/workflows/cookbook-native.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
uses: nicodes/cookbook/.github/workflows/cookbook-native.yml@f1c6a5d224776bcee5128a8ce91392483af22566
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
source: ${{ github.sha }}
version: ${{ needs.identity.outputs.version }}
date: ${{ needs.identity.outputs.date }}
Expand All @@ -51,162 +52,57 @@ jobs:
outputs:
artifact: ${{ steps.accepted.outputs.artifact-id }}
env:
MISE_AUTO_INSTALL: 'false'
MISE_EXEC_AUTO_INSTALL: 'false'
MISE_TASK_RUN_AUTO_INSTALL: 'false'
SOURCE_SHA: ${{ github.sha }}
COOKBOOK_SHA: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
COOKBOOK_SHA: f1c6a5d224776bcee5128a8ce91392483af22566
RELEASE_TAG: ${{ needs.identity.outputs.tag }}
GH_TOKEN: ${{ github.token }}
steps:
- name: Check out exact source
- name: Require an accepted provider and explicit source dispatch
run: |
set -euo pipefail
[[ "$COOKBOOK_SHA" =~ ^[a-f0-9]{40}$ && "$GITHUB_REF" == refs/heads/main && "$GITHUB_EVENT_NAME" == workflow_dispatch ]]
relation="$(gh api "repos/nicodes/cookbook/compare/$COOKBOOK_SHA...main" --jq .status)"
[[ "$relation" == ahead || "$relation" == identical ]]
- name: Check out exact source data
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false
- name: Select an existing compatible Windows bootstrap host
if: runner.os == 'Windows'
id: sdk-private-host
timeout-minutes: 1
shell: pwsh
env:
MISE_AUTO_INSTALL: 'false'
MISE_EXEC_AUTO_INSTALL: 'false'
MISE_TASK_RUN_AUTO_INSTALL: 'false'
run: |
# Select a compatible runner-owned control-plane Python without installing one.
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($PSVersionTable.PSVersion -lt [Version]'7.3') { throw 'Native bootstrap argument transport requires PowerShell 7.3 or newer' }
$PSNativeCommandArgumentPassing = 'Standard'
if ($env:ubuntu-24.04_OS -ne 'Windows') { throw 'Windows bootstrap host selection requires the native Windows runner' }
$architecture = switch ($env:ubuntu-24.04_ARCH) {
'X64' { 'x64' }
'ARM64' { 'arm64' }
default { throw 'Unsupported native Windows bootstrap architecture' }
}
if ([string]::IsNullOrWhiteSpace($env:ubuntu-24.04_TOOL_CACHE) -or
-not [IO.Path]::IsPathFullyQualified($env:ubuntu-24.04_TOOL_CACHE)) {
throw 'Windows bootstrap requires the trusted absolute runner tool cache'
}
$cache = [IO.Path]::GetFullPath($env:ubuntu-24.04_TOOL_CACHE)
if ($cache -match '[\r\n\x00]') { throw 'Invalid runner tool cache path' }
if (-not [string]::IsNullOrWhiteSpace($env:GITHUB_WORKSPACE)) {
$workspace = [IO.Path]::GetFullPath($env:GITHUB_WORKSPACE).TrimEnd('\', '/')
if ($cache.Equals($workspace, [StringComparison]::OrdinalIgnoreCase) -or
$cache.StartsWith($workspace + '\', [StringComparison]::OrdinalIgnoreCase)) {
throw 'A project directory cannot provide the bootstrap host interpreter'
}
}
$probe = @'
import json,os,sys,sysconfig
expected=sys.argv[1]
print(json.dumps({"executable":sys.executable,"version":list(sys.version_info[:3]),
"implementation":sys.implementation.name,"platform":sys.platform,"target":sysconfig.get_platform(),"isolated":sys.flags.isolated,
"no_bytecode":sys.dont_write_bytecode,"same_file":os.path.samefile(sys.executable,expected)}))
'@
$selected = $null
$directory = Join-Path $cache 'Python'
if (Test-Path -LiteralPath $directory -PathType Container) {
if ((Get-Item -LiteralPath $directory -Force).Attributes -band [IO.FileAttributes]::ReparsePoint) {
throw 'Runner Python cache must not be an installation link'
}
$versions = @(Get-ChildItem -LiteralPath $directory -Directory)
if ($versions.Count -gt 64) { throw 'Runner Python cache inventory exceeds its bound' }
$candidates = @($versions | ForEach-Object {
$version = $null
if ([Version]::TryParse($_.Name, [ref]$version) -and $version -ge [Version]'3.13.0') {
[PSCustomObject]@{ directory = $_; version = $version }
}
} | Sort-Object -Property version -Descending)
foreach ($entry in $candidates) {
$installation = Join-Path $entry.directory.FullName $architecture
$marker = $installation + '.complete'
$candidate = Join-Path $installation 'python.exe'
if (-not (Test-Path -LiteralPath $marker -PathType Leaf) -or
-not (Test-Path -LiteralPath $candidate -PathType Leaf)) { continue }
foreach ($path in @($entry.directory.FullName, $installation, $marker, $candidate)) {
if ((Get-Item -LiteralPath $path -Force).Attributes -band [IO.FileAttributes]::ReparsePoint) {
throw 'Runner bootstrap interpreter must not traverse an installation link'
}
}
$raw = & $candidate '-I' '-B' '-c' $probe $candidate 2>&1
if ($LASTEXITCODE -ne 0) { throw 'Existing runner Python failed its isolated capability probe' }
$record = ($raw -join "`n") | ConvertFrom-Json
$expectedTarget = if ($architecture -eq 'arm64') { 'win-arm64' } else { 'win-amd64' }
if ($record.implementation -ne 'cpython' -or $record.platform -ne 'win32' -or $record.target -ne $expectedTarget -or
$record.isolated -ne 1 -or $record.no_bytecode -ne $true -or $record.same_file -ne $true -or
($record.version -join '.') -ne $entry.version.ToString(3)) {
throw 'Runner bootstrap interpreter identity, version, or native architecture differs'
}
$selected = [PSCustomObject]@{ found = $true; path = $candidate; native = $record }
break
}
}
if ($null -eq $selected) { $selected = [PSCustomObject]@{ found = $false; path = '' } }
$lines = @("found=$($selected.found.ToString().ToLowerInvariant())", "python-path=$($selected.path)")
if (-not [string]::IsNullOrWhiteSpace($env:GITHUB_OUTPUT)) {
[IO.File]::AppendAllText($env:GITHUB_OUTPUT, ($lines -join "`n") + "`n", [Text.UTF8Encoding]::new($false))
}
$selected | ConvertTo-Json -Depth 5 -Compress
- name: Bootstrap Python for protected SDK sources
if: runner.os == 'Windows' && steps.sdk-private-host.outputs.found != 'true'
id: sdk-private-python
timeout-minutes: 5
- name: Prepare the provider interpreter without caller configuration
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
env:
MISE_AUTO_INSTALL: 'false'
MISE_EXEC_AUTO_INSTALL: 'false'
MISE_TASK_RUN_AUTO_INSTALL: 'false'
with:
python-version: '3.13.11'
check-latest: false
- name: Prepare the private artifact parent with a verified direct Python
if: runner.os == 'Windows'
timeout-minutes: 1
shell: bash
env:
PRIVATE_PYTHON: ${{ steps.sdk-private-host.outputs.python-path || steps.sdk-private-python.outputs.python-path }}
MISE_AUTO_INSTALL: 'false'
MISE_EXEC_AUTO_INSTALL: 'false'
MISE_TASK_RUN_AUTO_INSTALL: 'false'
run: |
set -euo pipefail
"$PRIVATE_PYTHON" -I -B -c 'exec('"'"'import os\nfrom pathlib import Path\nimport stat\nimport sys\nif os.name == "nt" and sys.version_info < (3, 13):\n raise SystemExit("Windows private SDK directories require the selected Python 3.13 or newer")\nparent = Path.cwd() / ".artifacts"\nfor candidate in [parent, *parent.parents]:\n try:\n info = candidate.lstat()\n except FileNotFoundError:\n continue\n if stat.S_ISLNK(info.st_mode) or getattr(info, "st_file_attributes", 0) & 0x400:\n raise SystemExit("SDK artifact parent must not traverse links or reparse points")\nif parent.exists():\n if not parent.is_dir():\n raise SystemExit("SDK artifact parent must be a directory")\nelse:\n parent.mkdir(mode=0o700)\n'"'"')'
printf 'COOKBOOK_BOOTSTRAP_PYTHON=%s\n' "$PRIVATE_PYTHON" >> "$GITHUB_ENV"
printf '%s\n' 'MISE_AUTO_INSTALL=false' 'MISE_EXEC_AUTO_INSTALL=false' 'MISE_TASK_RUN_AUTO_INSTALL=false' >> "$GITHUB_ENV"
- name: Check out accepted cookbook
- name: Check out accepted Cookbook
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
repository: nicodes/cookbook
ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
ref: f1c6a5d224776bcee5128a8ce91392483af22566
path: .artifacts/recipe-sdks/_cookbook
persist-credentials: false
- name: Prepare separate immutable Cookbook and Tools sources
uses: ./.artifacts/recipe-sdks/_cookbook/sdk-dependencies
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
- name: Bootstrap caller-pinned Python
uses: ./.artifacts/recipe-sdks/_cookbook/sdk-setup
with:
tools: python
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
- name: Download this execution's complete source acceptance
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: cookbook-full-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
path: .
path: .artifacts/cli-input/full
- name: Stage only closed original archive and proof data
run: python3 -I -B -c 'import pathlib,runpy,sys;p=pathlib.Path(sys.argv[1]);sys.argv=sys.argv[1:];sys.path.insert(0,str(p.parent));runpy.run_path(str(p),run_name="__main__")' .artifacts/recipe-sdks/_cookbook/cookbook/cli_inputs.py --input full
- name: Recheck complete native and host proof and exact publication bytes
run: python3 .artifacts/recipe-sdks/_cookbook/cookbook/cli_release.py accept --source "$SOURCE_SHA" --cookbook-ref "$COOKBOOK_SHA" --tag "$RELEASE_TAG" --before-acceptance
run: python3 -I -B -c 'import pathlib,runpy,sys;p=pathlib.Path(sys.argv[1]);sys.argv=sys.argv[1:];sys.path.insert(0,str(p.parent));runpy.run_path(str(p),run_name="__main__")' .artifacts/recipe-sdks/_cookbook/cookbook/cli_release.py accept --source "$SOURCE_SHA" --cookbook-ref "$COOKBOOK_SHA" --tag "$RELEASE_TAG" --before-acceptance
- name: Attest build provenance under the published source workflow identity
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8
with:
subject-path: dist/*
- name: Preserve accepted publication payload and source proof
- name: Preserve original accepted archives and source proof
id: accepted
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: accepted-cli-${{ github.sha }}-${{ github.run_attempt }}
name: accepted-cli-archives-${{ github.sha }}-${{ github.run_attempt }}
path: |
dist/
.artifacts/cookbook-validation.json
Expand All @@ -220,8 +116,8 @@ jobs:
contents: write
actions: read
attestations: read
uses: nicodes/cookbook/.github/workflows/cookbook-cli-publish.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
uses: nicodes/cookbook/.github/workflows/cookbook-cli-publish.yml@f1c6a5d224776bcee5128a8ce91392483af22566
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
tag: ${{ needs.identity.outputs.tag }}
artifact-id: ${{ needs.accept.outputs.artifact }}
8 changes: 5 additions & 3 deletions .github/workflows/request-merge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated cookbook caller. Change recipe data and regenerate.
name: Request merge
name: Merge pull request
run-name: "Merge PR #${{ inputs.pull-request }}"
'on':
workflow_dispatch:
inputs:
Expand All @@ -21,14 +22,15 @@ concurrency:
cancel-in-progress: false
jobs:
request:
uses: nicodes/cookbook/.github/workflows/cookbook-request-merge.yml@77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
name: Merge
uses: nicodes/cookbook/.github/workflows/cookbook-request-merge.yml@f1c6a5d224776bcee5128a8ce91392483af22566
permissions:
contents: write
pull-requests: read
statuses: write
actions: write
with:
cookbook-ref: 77d7bfa24cf0ec35a2de7585d48797b64f41cbb3
cookbook-ref: f1c6a5d224776bcee5128a8ce91392483af22566
pull-request: ${{ inputs.pull-request }}
expected-head: ${{ inputs.expected-head }}
expected-base: ${{ inputs.expected-base }}
Loading
Loading