Skip to content

Commit 8ace27c

Browse files
committed
tweaks
1 parent 4ad1f76 commit 8ace27c

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/workflows/python-build-pages.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ jobs:
6767
run: |
6868
./gradlew :python-build:buildSite
6969
- name: Publish
70-
uses: cloudflare/wrangler-action@v3
70+
uses: cloudflare/pages-action@v1
7171
with:
72-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
7372
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
7473
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
74+
projectName: datahub-wheels
7575
workingDirectory: python-build
76-
command: pages deploy ./site --project-name=datahub-wheels
76+
directory: site
77+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

python-build/build_site.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
for wheel_file in WHEEL_DIR.glob("*"):
1515
shutil.copy(wheel_file, SITE_ARTIFACT_WHEEL_DIR)
1616

17+
18+
def package_name(wheel_file: pathlib.Path) -> str:
19+
return wheel_file.name.split("-")[0].replace("_", "-")
20+
21+
1722
newline = "\n"
1823
(SITE_OUTPUT_DIR / "index.html").write_text(
1924
f"""
@@ -28,7 +33,10 @@
2833
<body>
2934
<div class="ui container">
3035
<h1 class="ui header" style="padding-top: 1.5em;">DataHub Python Builds</h1>
31-
<p>Built at {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}</p>
36+
<p>
37+
These prebuilt wheel files can be used to install our Python packages as of a specific commit.
38+
</p>
39+
<p>Built at {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}.</p>
3240
3341
<p>
3442
Current base URL: <span class="base-url">unknown</span>
@@ -47,9 +55,9 @@
4755
newline.join(
4856
f'''
4957
<tr>
50-
<td><code>{wheel_file.name.split('-')[0].replace('_', '-')}</code></td>
58+
<td><code>{package_name(wheel_file)}</code></td>
5159
<td>{wheel_file.stat().st_size / 1024 / 1024:.3f} MB</td>
52-
<td><code>pip install '<span class="base-url">&lt;base-url&gt;</span>/artifacts/wheels/{wheel_file.name}'</code></td>
60+
<td><code>pip install '{package_name(wheel_file)} @ <span class="base-url">&lt;base-url&gt;</span>/artifacts/wheels/{wheel_file.name}'</code></td>
5361
</tr>
5462
'''
5563
for wheel_file in sorted(WHEEL_DIR.glob("*.whl"))
@@ -60,12 +68,13 @@
6068
</div>
6169
</body>
6270
<script>
71+
const baseUrl = window.location.href.split('/').slice(0, -1).join('/');
6372
document.querySelectorAll(".base-url").forEach(el => {{
64-
el.textContent = window.location.href.split('/').slice(0, -1).join('/');
73+
el.textContent = baseUrl;
6574
}});
6675
</script>
6776
</html>
6877
"""
6978
)
7079

71-
print("Built site in", SITE_OUTPUT_DIR)
80+
print("DataHub Python wheel site built in", SITE_OUTPUT_DIR)

0 commit comments

Comments
 (0)