Skip to content

Commit e075c7e

Browse files
committed
just: add mechanism to update latest-release on publish
Closes #138.
1 parent ab10162 commit e075c7e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@ release-build-macos-remote tag:
3030
release-upload-distributions token datetime tag:
3131
cargo run --release -- upload-release-distributions --token {{token}} --datetime {{datetime}} --tag {{tag}} --dist dist
3232

33+
release-set-latest-release tag:
34+
#!/usr/bin/env bash
35+
set -euxo pipefail
36+
37+
git switch latest-release
38+
cat << EOF > latest-release.json
39+
{
40+
"version": 1,
41+
"tag": "{{tag}}",
42+
"release_url": "https://github.com/indygreg/python-build-standalone/releases/tag/{{tag}}",
43+
"asset_url_prefix": "https://github.com/indygreg/python-build-standalone/releases/download/{{tag}}"
44+
}
45+
EOF
46+
47+
git commit -a -m 'set latest release to {{tag}}'
48+
git switch main
49+
50+
git push origin latest-release
51+
3352
# Perform a release.
3453
release token commit tag:
3554
#!/bin/bash
@@ -40,3 +59,4 @@ release token commit tag:
4059
just release-build-macos-remote {{tag}}
4160
datetime=$(ls dist/cpython-3.10.*-x86_64-unknown-linux-gnu-install_only-*.tar.gz | awk -F- '{print $8}' | awk -F. '{print $1}')
4261
just release-upload-distributions {{token}} ${datetime} {{tag}}
62+
just release-set-latest-release {{tag}}

docs/running.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ https://github.com/indygreg/python-build-standalone/releases.
1212
Simply go to that page and find the latest release along with
1313
its release notes.
1414

15+
Machines can find the latest release by querying the GitHub releases
16+
API. Alternatively, a JSON file publishing metadata about the latest
17+
release can be fetched from
18+
https://raw.githubusercontent.com/indygreg/python-build-standalone/latest-release/latest-release.json.
19+
The JSON format is simple and hopefully self-descriptive.
20+
1521
Published distributions vary by their:
1622

1723
* Python version

0 commit comments

Comments
 (0)