Skip to content

Commit c0a0ca3

Browse files
authored
fix(providers): manifest-based version source system (#160)
1 parent e67fcfd commit c0a0ca3

36 files changed

Lines changed: 24028 additions & 401 deletions
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build Request
2+
description: Request a pre-built binary for a runtime version that is not currently available
3+
title: "build({runtime}): {version} {platform}"
4+
labels: ["build-request"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
**Thanks for requesting a build!** This form helps us provide pre-built binaries for runtime versions that aren't currently available.
10+
11+
**Tip:** You can also use `dtvem request <runtime> <version>` to open this form with pre-filled values.
12+
13+
- type: dropdown
14+
id: runtime
15+
attributes:
16+
label: Runtime
17+
description: Which runtime do you need?
18+
options:
19+
- python
20+
- node
21+
- ruby
22+
validations:
23+
required: true
24+
25+
- type: input
26+
id: version
27+
attributes:
28+
label: Version
29+
description: What version do you need?
30+
placeholder: "e.g., 3.6.15, 2.7.8, 18.0.0"
31+
validations:
32+
required: true
33+
34+
- type: dropdown
35+
id: platform
36+
attributes:
37+
label: Platform
38+
description: What platform do you need the build for?
39+
options:
40+
- windows-amd64
41+
- windows-arm64
42+
- darwin-amd64
43+
- darwin-arm64
44+
- linux-amd64
45+
- linux-arm64
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: use-case
51+
attributes:
52+
label: Use Case
53+
description: Why do you need this specific version? (optional, but helps us prioritize)
54+
placeholder: |
55+
e.g., "Legacy project requires Python 3.6 compatibility"
56+
e.g., "Testing backward compatibility with older Node.js versions"
57+
validations:
58+
required: false
59+
60+
- type: textarea
61+
id: context
62+
attributes:
63+
label: Additional Context
64+
description: Any other information that might be helpful
65+
validations:
66+
required: false
67+
68+
- type: checkboxes
69+
id: terms
70+
attributes:
71+
label: Code of Conduct
72+
description: By submitting this request, you agree to follow our [Code of Conduct](https://github.com/dtvem/dtvem/blob/main/CODE_OF_CONDUCT.md)
73+
options:
74+
- label: I agree to follow this project's Code of Conduct
75+
required: true
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Manifests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/internal/manifest/data/*.json'
9+
workflow_dispatch:
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Configure AWS CLI for R2
19+
run: |
20+
aws configure set aws_access_key_id ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
21+
aws configure set aws_secret_access_key ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
22+
aws configure set default.region auto
23+
24+
- name: Deploy manifests to R2
25+
env:
26+
R2_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
27+
R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_MANIFESTS_BUCKET }}
28+
run: |
29+
echo "Deploying manifests to Cloudflare R2..."
30+
31+
for file in src/internal/manifest/data/*.json; do
32+
filename=$(basename "$file")
33+
echo "Uploading $filename..."
34+
aws s3 cp "$file" "s3://${R2_BUCKET}/${filename}" \
35+
--endpoint-url "${R2_ENDPOINT}" \
36+
--content-type "application/json" \
37+
--cache-control "public, max-age=300"
38+
done
39+
40+
echo "Deployment complete!"
41+
42+
- name: Verify deployment
43+
env:
44+
R2_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
45+
R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_MANIFESTS_BUCKET }}
46+
run: |
47+
echo "Verifying deployed files..."
48+
aws s3 ls "s3://${R2_BUCKET}/" --endpoint-url "${R2_ENDPOINT}"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Update Manifests
2+
3+
on:
4+
schedule:
5+
# Run daily at 6 AM UTC
6+
- cron: '0 6 * * *'
7+
workflow_dispatch:
8+
inputs:
9+
runtime:
10+
description: 'Runtime to update (node, python, ruby, all)'
11+
required: false
12+
default: 'all'
13+
type: choice
14+
options:
15+
- all
16+
- node
17+
- python
18+
- ruby
19+
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
24+
jobs:
25+
update-manifests:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version-file: 'src/go.mod'
35+
36+
- name: Generate manifests
37+
run: |
38+
RUNTIME="${{ github.event.inputs.runtime || 'all' }}"
39+
echo "Generating manifests for: $RUNTIME"
40+
go run ./scripts/generate-manifests "$RUNTIME"
41+
42+
- name: Check for changes
43+
id: check-changes
44+
run: |
45+
git diff --quiet src/internal/manifest/data/ || echo "changed=true" >> $GITHUB_OUTPUT
46+
47+
- name: Create Pull Request
48+
if: steps.check-changes.outputs.changed == 'true'
49+
uses: peter-evans/create-pull-request@v7
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
commit-message: 'chore(manifest): update runtime manifests'
53+
title: 'chore(manifest): update runtime manifests'
54+
body: |
55+
Automated manifest update from upstream sources.
56+
57+
This PR was created by the [Update Manifests workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
58+
59+
Please review the changes to ensure the URLs and checksums are correct.
60+
branch: chore/update-manifests
61+
delete-branch: true
62+
labels: |
63+
automated
64+
manifest

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
"build:shim": "go build -v -ldflags=\"-s -w\" -o dist/dtvem-shim.exe ./src/cmd/shim",
1515
"deploy:local": "npm run build && copy dist\\dtvem.exe %USERPROFILE%\\.dtvem\\bin\\dtvem.exe && copy dist\\dtvem-shim.exe %USERPROFILE%\\.dtvem\\bin\\dtvem-shim.exe && echo Deploy complete. Run 'dtvem reshim' manually to update shims.",
1616
"clean": "rm -rf dist coverage.out coverage.html",
17-
"check": "npm run format && npm run lint && npm run test"
17+
"check": "npm run format && npm run lint && npm run test",
18+
"manifest:node": "go run ./scripts/generate-manifests node",
19+
"manifest:python": "go run ./scripts/generate-manifests python",
20+
"manifest:ruby": "go run ./scripts/generate-manifests ruby",
21+
"manifest:all": "go run ./scripts/generate-manifests all"
1822
},
1923
"devDependencies": {
2024
"@commitlint/cli": "^19.0.0",

schemas/manifest.schema.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://raw.githubusercontent.com/dtvem/dtvem/main/schemas/manifest.schema.json",
4+
"title": "dtvem Runtime Manifest",
5+
"description": "Manifest file containing available versions and download URLs for a runtime",
6+
"type": "object",
7+
"required": ["version", "versions"],
8+
"additionalProperties": false,
9+
"properties": {
10+
"version": {
11+
"type": "integer",
12+
"const": 1,
13+
"description": "Manifest format version (currently 1)"
14+
},
15+
"versions": {
16+
"type": "object",
17+
"description": "Map of version strings to platform availability",
18+
"additionalProperties": {
19+
"$ref": "#/$defs/platformMap"
20+
}
21+
}
22+
},
23+
"$defs": {
24+
"platformMap": {
25+
"type": "object",
26+
"description": "Map of platform keys to download info or null (unavailable)",
27+
"propertyNames": {
28+
"enum": [
29+
"windows-amd64",
30+
"windows-arm64",
31+
"windows-386",
32+
"darwin-amd64",
33+
"darwin-arm64",
34+
"linux-amd64",
35+
"linux-arm64",
36+
"linux-arm",
37+
"linux-386"
38+
]
39+
},
40+
"additionalProperties": {
41+
"oneOf": [
42+
{ "$ref": "#/$defs/download" },
43+
{ "type": "null" }
44+
]
45+
}
46+
},
47+
"download": {
48+
"type": "object",
49+
"description": "Download information for a pre-built binary",
50+
"required": ["url", "sha256"],
51+
"additionalProperties": false,
52+
"properties": {
53+
"url": {
54+
"type": "string",
55+
"format": "uri",
56+
"description": "Direct download URL for the binary archive"
57+
},
58+
"sha256": {
59+
"type": "string",
60+
"pattern": "^[a-fA-F0-9]{64}$",
61+
"description": "SHA256 checksum (64 hex characters)"
62+
}
63+
}
64+
}
65+
},
66+
"examples": [
67+
{
68+
"version": 1,
69+
"versions": {
70+
"3.13.1": {
71+
"windows-amd64": {
72+
"url": "https://www.python.org/ftp/python/3.13.1/python-3.13.1-embed-amd64.zip",
73+
"sha256": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
74+
},
75+
"darwin-arm64": null,
76+
"linux-amd64": {
77+
"url": "https://github.com/astral-sh/python-build-standalone/releases/download/20251209/cpython-3.13.1.tar.gz",
78+
"sha256": "b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3"
79+
}
80+
}
81+
}
82+
}
83+
]
84+
}

0 commit comments

Comments
 (0)