Skip to content

Commit 492e277

Browse files
committed
release: use commit SHA for [sources] instead of branch names
Previously, the [sources] entries in Project.toml referenced the releases/YYYY-MM-DD branch names, requiring these branches to be kept indefinitely. This change modifies the release process to reference commit SHAs directly, allowing release branches to be deleted after merging. The new release flow in prepare-release.sh: 1. Generate vendor/ with local path references 2. Commit and push to get a stable commit SHA 3. Re-run vendor-deps.jl with --rev=<SHA> to update [sources] 4. Commit the final release vendor-deps.jl now requires either --local or --rev=<sha> explicitly, making the source reference strategy clear at invocation time. Pinned installation now uses release tags (rev="YYYY-MM-DD") instead of branch names (rev="releases/YYYY-MM-DD"). Existing release branches will be kept until end of December 2025 for backward compatibility. Written by Claude
1 parent 0f0d2e7 commit 492e277

File tree

6 files changed

+157
-88
lines changed

6 files changed

+157
-88
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
99
> as it is not registered in General due to environment isolation requirements.
1010
>
1111
> Each dated section below corresponds to a release that can be installed via
12-
> `Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="releases/YYYY-MM-DD")`
12+
> `Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="YYYY-MM-DD")`
1313
1414
## Unreleased
1515

1616
- Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
1717
- Diff: [`6ec51e1...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/6ec51e1...HEAD)
1818

19+
### Changed
20+
21+
- Pinned installation now uses release tags (`rev="YYYY-MM-DD"`) instead of
22+
branch names (`rev="releases/YYYY-MM-DD"`). The `releases/YYYY-MM-DD` branches
23+
can now be deleted after merging since `[sources]` entries reference commit
24+
SHAs directly. Existing release branches (`releases/2025-11-24` through
25+
`releases/2025-11-27`) will be kept until the end of December 2025 for
26+
backward compatibility.
27+
1928
### Removed
2029

2130
- Removed the deprecated `runserver.jl` script. Users should use the `jetls`

DEVELOPMENT.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,18 @@ analyzing.
226226
packages.
227227
- `releases/YYYY-MM-DD`: Release preparation branches. These branches are
228228
created from `release`, merged with `master`, vendored, and then merged back
229-
into `release` via pull requests on GitHub. These branches must be kept
230-
(not deleted) because the `release` branch's `[sources]` entries reference
231-
them by name.
229+
into `release` via pull requests on GitHub. These branches can be deleted
230+
after merging because the `[sources]` entries reference specific commit SHAs,
231+
not branch names.
232+
233+
### Pinned installation
234+
235+
Users can install a specific release version using Julia's package manager with
236+
the release tag:
237+
```julia
238+
julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="YYYY-MM-DD")'
239+
```
240+
Replace `YYYY-MM-DD` with the desired release date (e.g., `2025-11-27`).
232241

233242
### Release procedure
234243

@@ -246,10 +255,8 @@ After the script completes:
246255
`master` commits are included in `release`. The CI will run tests on the
247256
vendored environment before merging.
248257

249-
2. **Do NOT delete the `releases/YYYY-MM-DD` branch after merging.** These
250-
branches must be kept because the `release` branch's `[sources]` entries
251-
reference them by name. Keeping them also allows users to install specific
252-
releases via the Julia package manager.
258+
2. The `releases/YYYY-MM-DD` branch can be deleted after merging. The `[sources]`
259+
entries reference specific commit SHAs, so the branch is no longer needed.
253260

254261
After the PR is merged, `CHANGELOG.md` on `master` will be automatically updated
255262
by the CI workflow.
@@ -267,36 +274,38 @@ The `prepare-release.sh` script automates the following steps:
267274
git merge master -X theirs
268275
```
269276

270-
2. Update the version file
277+
2. Vendor dependency packages with local paths
271278
```bash
272-
echo "$JETLS_VERSION" > JETLS_VERSION
279+
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master --local
280+
```
281+
This generates `vendor/` with local path references in `[sources]`.
282+
283+
3. Commit and push the vendor directory
284+
```bash
285+
git add -A
286+
git commit -m "release: update vendored dependencies ($JETLS_VERSION)"
287+
git push -u origin releases/$JETLS_VERSION
273288
```
274289

275-
3. Vendor dependency packages
290+
4. Update `[sources]` to reference the vendor commit SHA
276291
```bash
277-
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master
292+
VENDOR_COMMIT=$(git rev-parse HEAD)
293+
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master --rev="$VENDOR_COMMIT"
278294
```
279-
This script performs the following:
280-
- Fetches the latest `Project.toml` from the specified source branch (`master`)
281-
- Backs it up as `Project.toml.bak`
282-
- Cleans up `Manifest.toml` and runs `Pkg.update()`
283-
- Loads JETLS and collects dependency packages from `Base.loaded_modules`
284-
- Copies each package to `vendor/` and rewrites its UUID
285-
- Removes unused weakdeps and extensions from vendored packages
286-
- Updates `Project.toml` with vendored UUIDs and `[sources]` entries
287-
- Cleans up `Manifest.toml` and runs `Pkg.instantiate()`
288-
289-
4. Commit and push
295+
This updates `[sources]` entries to use the commit SHA instead of local paths.
296+
297+
5. Commit and push the release
290298
```bash
299+
echo "$JETLS_VERSION" > JETLS_VERSION
291300
git add -A
292301
git commit -m "release: $JETLS_VERSION"
293-
git push -u origin releases/$JETLS_VERSION
302+
git push origin releases/$JETLS_VERSION
294303
```
295304
**Important**: The commit message must follow the `release: YYYY-MM-DD` format
296305
exactly. The documentation CI extracts this date to display in the release
297306
documentation's index page.
298307

299-
5. Create a pull request from `releases/YYYY-MM-DD` to `release`.
308+
6. Create a pull request from `releases/YYYY-MM-DD` to `release`.
300309

301310
> [!note]
302311
> `vendor-deps.jl` generates UUIDs using `uuid5(original_uuid, "JETLS-vendor")`.

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ is properly added to your `PATH`.
5050
will fetch the most recent version since the `release` branch always
5151
points to the latest release.
5252

53-
To pin a specific version instead, use `rev="releases/YYYY-MM-DD"`:
53+
To pin a specific version instead, use the release tag `rev="YYYY-MM-DD"`:
5454
```bash
55-
julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="releases/2025-11-25")'
55+
julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="2025-11-25")'
5656
```
5757
Note that pinned versions will not be updated by `Pkg.Apps.update("JETLS")`.
5858

jetls-client/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ executable from your `PATH`.
6262
> will fetch the most recent version since the `release` branch always
6363
> points to the latest release.
6464
>
65-
> To pin a specific version instead, use `rev="releases/YYYY-MM-DD"`:
65+
> To pin a specific version instead, use the release tag `rev="YYYY-MM-DD"`:
6666
>
6767
> ```bash
68-
> julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="releases/2025-11-25")'
68+
> julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="2025-11-25")'
6969
> ```
7070
>
7171
> Note that pinned versions will not be updated by `Pkg.Apps.update("JETLS")`.

scripts/prepare-release.sh

Lines changed: 76 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
# Prepare a new JETLS release.
44
#
55
# Usage:
6-
# ./scripts/prepare-release.sh YYYY-MM-DD
6+
# ./scripts/prepare-release.sh YYYY-MM-DD [--local]
77
#
88
# Example:
99
# ./scripts/prepare-release.sh 2025-11-27
10+
# ./scripts/prepare-release.sh 2025-11-27 --local # skip push and PR creation
1011
#
1112
# This script automates the release procedure documented in DEVELOPMENT.md:
1213
# 1. Creates a release branch from `release` and merges `master`
@@ -16,14 +17,38 @@
1617

1718
set -euo pipefail
1819

19-
if [[ $# -ne 1 ]]; then
20-
echo "Usage: $0 YYYY-MM-DD"
20+
LOCAL_MODE=false
21+
22+
while [[ $# -gt 0 ]]; do
23+
case $1 in
24+
--local)
25+
LOCAL_MODE=true
26+
shift
27+
;;
28+
-*)
29+
echo "Unknown option: $1"
30+
echo "Usage: $0 YYYY-MM-DD [--local]"
31+
exit 1
32+
;;
33+
*)
34+
if [[ -z "${JETLS_VERSION:-}" ]]; then
35+
JETLS_VERSION="$1"
36+
else
37+
echo "Error: Unexpected argument: $1"
38+
echo "Usage: $0 YYYY-MM-DD [--local]"
39+
exit 1
40+
fi
41+
shift
42+
;;
43+
esac
44+
done
45+
46+
if [[ -z "${JETLS_VERSION:-}" ]]; then
47+
echo "Usage: $0 YYYY-MM-DD [--local]"
2148
echo "Example: $0 2025-11-27"
2249
exit 1
2350
fi
2451

25-
JETLS_VERSION="$1"
26-
2752
# Validate date format
2853
if ! [[ "$JETLS_VERSION" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
2954
echo "Error: Version must be in YYYY-MM-DD format"
@@ -57,38 +82,60 @@ git pull origin release
5782
git checkout -b "releases/$JETLS_VERSION"
5883
git merge origin/master -X theirs -m "Merge master into releases/$JETLS_VERSION"
5984

60-
# Step 2: Update JETLS_VERSION file
61-
echo "==> Step 2: Updating JETLS_VERSION"
62-
echo "$JETLS_VERSION" > JETLS_VERSION
85+
# Step 2: Vendor dependency packages with local paths
86+
echo "==> Step 2: Vendoring dependencies (local paths)"
87+
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master --local
88+
89+
# Step 3: Commit vendor/ directory
90+
echo "==> Step 3: Committing vendor/ directory"
91+
git add -A
92+
git commit -m "vendor: update vendored dependencies"
93+
if [[ "$LOCAL_MODE" == false ]]; then
94+
git push -u origin "releases/$JETLS_VERSION"
95+
fi
6396

64-
# Step 3: Vendor dependency packages
65-
echo "==> Step 3: Vendoring dependencies"
66-
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master
97+
# Step 4: Get the commit SHA and update [sources] to reference it
98+
echo "==> Step 4: Updating [sources] to reference commit SHA"
99+
VENDOR_COMMIT=$(git rev-parse HEAD)
100+
echo "Vendor commit SHA: $VENDOR_COMMIT"
101+
julia --startup-file=no --project=. scripts/vendor-deps.jl --source-branch=master --rev="$VENDOR_COMMIT"
67102

68-
# Step 4: Commit and push
69-
echo "==> Step 4: Committing and pushing"
103+
# Step 5: Commit the final release
104+
echo "==> Step 5: Committing release"
105+
echo "$JETLS_VERSION" > JETLS_VERSION
70106
git add -A
71107
git commit -m "release: $JETLS_VERSION"
72-
git push -u origin "releases/$JETLS_VERSION"
73108

74-
# Step 5: Create pull request
75-
echo "==> Step 5: Creating pull request"
76-
PR_URL=$(gh pr create \
77-
--base release \
78-
--head "releases/$JETLS_VERSION" \
79-
--title "release: $JETLS_VERSION" \
80-
--body "$(cat <<EOF
81-
This PR releases version `$JETLS_VERSION`.
109+
if [[ "$LOCAL_MODE" == true ]]; then
110+
echo ""
111+
echo "==> Local mode: skipping push and PR creation"
112+
echo ""
113+
echo "Release branch prepared locally: releases/$JETLS_VERSION"
114+
echo "To complete the release manually:"
115+
echo " 1. git push -u origin releases/$JETLS_VERSION"
116+
echo " 2. Create a PR from releases/$JETLS_VERSION to release"
117+
exit 0
118+
fi
119+
120+
git push origin "releases/$JETLS_VERSION"
121+
122+
# Step 6: Create pull request
123+
echo "==> Step 6: Creating pull request"
124+
PR_BODY="This PR releases version \`$JETLS_VERSION\`.
82125
83126
## Checklist
84-
- [ ] `release / Test JETLS.jl with release environment`
85-
- [ ] `release / Test jetls executable with release environment`
127+
- [ ] \`release / Test JETLS.jl with release environment\`
128+
- [ ] \`release / Test jetls executable with release environment\`
86129
87130
## Post-merge
88-
- Do NOT delete the \`releases/$JETLS_VERSION\` branch after merging
89-
- CHANGELOG.md will be automatically updated on master
90-
EOF
91-
)")
131+
- The \`releases/$JETLS_VERSION\` branch can be deleted after merging
132+
- CHANGELOG.md will be automatically updated on master"
133+
134+
PR_URL=$(gh pr create \
135+
--base release \
136+
--head "releases/$JETLS_VERSION" \
137+
--title "release: $JETLS_VERSION" \
138+
--body "$PR_BODY")
92139

93140
echo ""
94141
echo "==> Release preparation complete!"
@@ -98,4 +145,4 @@ echo ""
98145
echo "Next steps:"
99146
echo " 1. Wait for CI to pass"
100147
echo " 2. Merge the PR using 'Create a merge commit' (not squash or rebase)"
101-
echo " 3. Do NOT delete the releases/$JETLS_VERSION branch"
148+
echo " 3. The releases/$JETLS_VERSION branch can be deleted after merging"

0 commit comments

Comments
 (0)