Debian Codegraph @

docs/howto/release-git-lfs.md

raw symbols SCIP
1 # Releasing Git LFS
2
3 The core team of Git LFS maintainers publishes releases on a cadence of their
4 determining.
5
6 ## Release Naming
7
8 We follow Semantic Versioning standards as follows:
9
10 * `MAJOR` releases are done on a scale of 2-4 years. These encompass breaking,
11 incompatible API changes, or command-line interface changes that would
12 cause existing programs or use-cases scripted against Git LFS to break.
13
14 * `MINOR` releases are done on a scale of 2-6 months. These encompass new
15 features, bug fixes, and other "medium"-sized changes into a semi-regular
16 release schedule.
17
18 * `PATCH` releases are done on the scale of weeks to months. These encompass
19 critical bug fixes, but lack new features. They are amended to a `MINOR`
20 release "series", or, if serious enough (e.g., security vulnerabilities,
21 etc.) are backported to previous versions.
22
23 ## Release Artifacts
24
25 We package several artifacts for each tagged release. They are:
26
27 1. `git-lfs-@{os}-v@{release}-@{arch}.tar.gz` for the following values:
28
29 | | operating system | architecture |
30 | --- | ---------------- | ------------ |
31 | git-lfs-darwin-amd64-v@{version}.tar.gz | darwin | amd64 |
32 | git-lfs-darwin-arm64-v@{version}.tar.gz | darwin | arm64 |
33 | git-lfs-freebsd-386-v@{version}.tar.gz | freebsd | 386 |
34 | git-lfs-freebsd-amd64-v@{version}.tar.gz | freebsd | amd64 |
35 | git-lfs-linux-386-v@{version}.tar.gz | linux (generic) | 386 |
36 | git-lfs-linux-amd64-v@{version}.tar.gz | linux (generic) | amd64 |
37 | git-lfs-linux-arm-v@{version}.tar.gz | linux (generic) | arm |
38 | git-lfs-linux-arm64-v@{version}.tar.gz | linux (generic) | arm64 |
39 | git-lfs-linux-loong64-v@{version}.tar.gz | linux (generic) | loong64 |
40 | git-lfs-linux-ppc64le-v@{version}.tar.gz | linux (generic) | ppc64le |
41 | git-lfs-linux-riscv64-v@{version}.tar.gz | linux (generic) | riscv64 |
42 | git-lfs-linux-s390x-v@{version}.tar.gz | linux (generic) | s390x |
43
44 2. `git-lfs-windows-v@{release}-@{arch}.zip` for the following values:
45
46 | | operating system | architecture |
47 | --- | ---------------- | ------------ |
48 | git-lfs-windows-386-v@{version}.zip | windows | 386 |
49 | git-lfs-windows-amd64-v@{version}.zip | windows | amd64 |
50 | git-lfs-windows-arm64-v@{version}.zip | windows | arm64 |
51
52 3. `git-lfs-windows-v@{release}.exe`, a signed Windows installer that contains
53 copies of both `-x86` and `-x64` copies of Git LFS.
54
55 4. `*.deb`, and `*.rpm` packages for all of the distributions named in
56 `script/packagegcloud.rb`.
57
58 ## Development Philosophy
59
60 We do all major development on the `main` branch, and assume it to be passing
61 tests at all times. New features are added via the feature-branch workflow, or
62 (optionally) from a contributor's fork.
63
64 This is done so that `main` can progress and grow new features, while
65 historical releases such as `vM.N.0` can receive bug fixes as they are applied
66 to `main`, eventually culminating in a `vM.N.1` (and so on) release.
67
68 ## Building a release
69
70 Let release `vM.N.P` denote the version that we are _releasing_.
71
72 When `P` is equal to zero, we say that we are releasing a MINOR version of
73 Git LFS in the `vM.N`-series, unless `N` is also equal to zero, in which
74 case we are releasing a MAJOR version. Conversely, if `P` is not equal
75 to zero, we are releasing a PATCH version.
76
77 1. Upgrade the Go version used in the `git-lfs/build-dockers` repository
78 to the latest available PATCH release with the same major and minor
79 version numbers as the Go version used in this repository's GitHub
80 Actions workflows.
81
82 2. Write the release notes and do the housekeeping required to
83 indicate a new version. For a MAJOR or MINOR version, we start with
84 a `main` branch which is up to date with the latest changes from the
85 remote and then checkout a new `release-next` branch from that base.
86
87 If we are releasing a PATCH version, we create a `release-M.N` branch
88 with cherry-picked merges from the `main` branch, as described in
89 the [instructions](#building-patch-versions) below, and then checkout
90 the `release-next` branch from that base.
91
92 We next perform the following steps to prepare the `release-next` branch:
93
94 * Run `script/changelog` and categorize each merge commit as a feature,
95 bug fix, miscellaneous change, or a change to be skipped and ignored.
96 Ensure that your `~/.netrc` credentials are up-to-date in order to
97 make requests to the GitHub API, or use a `GITHUB_TOKEN` environment
98 variable.
99
100 The `changelog` script will write a portion of the new CHANGELOG to
101 stdout, which you should copy and paste into `CHANGELOG.md`, along with
102 an H2-level heading containing the new version and the expected release
103 date. This heading should be consistent with the existing style in the
104 document.
105
106 For a MAJOR release, use `script/changelog v(M-1).L.0...HEAD`, where
107 `(M-1)` is the previous MAJOR release number and `L` is the final
108 MINOR release number in that series. For a MINOR release, use
109 `script/changelog vM.(N-1).0...HEAD`, where `(N-1)` is the previous
110 MINOR release number, and for a PATCH release, use
111 `script/changelog --patch vM.N.(P-1)...HEAD`, where `(P-1)` is the
112 previous PATCH release number.
113
114 * Optionally write 1-2 paragraphs summarizing the release and calling
115 out community contributions.
116
117 * Call out any changes in the operating system versions required
118 by the new release, as well as any differences in the set of Linux
119 platforms for which we build release packages. Check for any
120 new platform requirements from the version of Go in use.
121
122 * If we are releasing a MAJOR or MINOR version and not a PATCH, and
123 if the most recent non-PATCH release was followed by a series of one
124 or more PATCH releases, include any changes listed in the CHANGELOG
125 of that series' release branch in the new release's CHANGELOG.
126 (For a new MAJOR version, the prior release branch would be named
127 `release-(M-1).L`, following the terminology defined above, while
128 for a new MINOR version the prior release branch would be named
129 `release-M.(N-1)`.)
130
131 * Run `script/update-version vM.N.P` to update the version number in all
132 of the relevant files. Note that this script requires a version of
133 `sed(1)` compatible with the GNU implementation.
134
135 * Adjust the date in the `debian/changelog` entry to reflect the
136 expected release date rather than the current date.
137
138 * Commit all the files changed in the steps above in a single new commit:
139 ```ShellSession
140 $ git commit -m 'release: vM.N.P'
141 ```
142
143 3. Push the `release-next` branch and create a pull request with your
144 changes from the branch. If you're building a MAJOR or MINOR release,
145 set the base to the `main` branch. Otherwise, set the base to the
146 `release-M.N` branch.
147
148 * Add the `release` label to the PR.
149
150 * In the PR description, consider uploading builds for implementers to
151 use in testing. These can be generated from a local tag, which
152 does not need to be signed (but must be annotated). Check that the
153 local version of Go is equivalent to the most recent one used by the
154 GitHub Actions workflows for the release branch, which may be different
155 from that used on the `main` branch. For a PATCH release in particular
156 you may need to downgrade your local Go version. The build artifacts
157 will be placed in the `bin/releases` directory and may be uploaded
158 into the PR from there:
159
160 ```ShellSession
161 $ git tag -m vM.N.P-pre vM.N.P-pre
162 $ make release
163 $ ls bin/releases
164 ```
165
166 * Notify the `@git-lfs/releases` and `@git-lfs/implementers` teams,
167 collections of humans who are interested in Git LFS releases.
168
169 * Ensure that the normal Continuous Integration workflow for PRs
170 that runs automatically in GitHub Actions succeeds fully.
171
172 * As the GitHub Actions release workflow will not run for PRs, consider
173 creating an annotated tag with the `-pre` suffix and pushing the tag,
174 which will trigger a run of the release workflow that does not upload
175 artifacts to Packagecloud. Alternatively, in a private clone of
176 the repository, create such a tag from the `release-next` branch plus
177 one commit to change the repository name in `script/upload`, and
178 push the tag so Actions will run the release workflow. Ensure that
179 the workflow succeeds (excepting the Packagecloud upload step, which
180 will be skipped).
181
182 4. Once approved and verified, merge the pull request you created in the
183 previous step. Locally, create a GPG-signed tag on the merge commit called
184 `vM.N.P`:
185
186 ```ShellSession
187 $ git show -q --pretty=%s%n%b HEAD
188 Merge pull request #xxxx from git-lfs/release-next
189 release: vM.N.P
190
191 $ git tag -s vM.N.P -m vM.N.P
192
193 $ git describe HEAD
194 vM.N.P
195
196 $ git show -q --pretty=%s%d%n%b vM.N.P
197 tag vM.N.P
198 Tagger: ...
199
200 vM.N.P
201 -----BEGIN PGP SIGNATURE-----
202 ...
203 -----END PGP SIGNATURE-----
204 Merge pull request #xxxx from git-lfs/release-next (tag: vM.N.P)
205 release: vM.N.P
206 ```
207
208 5. Push the tag, via:
209
210 ```ShellSession
211 $ git push origin vM.N.P
212 ```
213
214 Validate the pending `production` environment deployment rule in the UI
215 of the GitHub management application for macOS Developer ID certificates.
216
217 This will kick off the process of building the release artifacts. This
218 process will take somewhere between 45 minutes and an hour. When it's
219 done, you'll end up with a set of release assets available for download,
220 and Linux RPM and Debian packages for the new release will be available
221 on Packagecloud.
222
223 6. Download the `release-assets` archive file from the "Artifacts" section
224 of the "Summary" page for the most recent run of the release GitHub
225 Actions
226 [workflow](https://github.com/git-lfs/git-lfs/actions/workflows/release.yml),
227 and then unpack the file at the top level of the repository:
228
229 ```ShellSession
230 $ rm -rf bin/releases
231 $ unzip /path/to/release-assets.zip
232 ```
233
234 The release assets should now be present in the `bin/releases` directory.
235 The `script/upload` utility will create a new draft release announcement
236 and then upload the release assets and attach them to the announcement:
237
238 ```ShellSession
239 $ script/upload --skip-verify vM.N.P
240 ```
241
242 Note that this script requires GnuPG, with your signing key configured,
243 as well as Ruby 3.x, the OpenSSL Ruby gem, and several other tools,
244 including the GNU coreutils version of `b2sum(1)`. You will need to
245 provide your GitHub credentials in your `~/.netrc` file or via a
246 `GITHUB_TOKEN` environment variable.
247
248 7. Finalize the release process using the same `script/upload` utility but
249 with the `--finalize` option. The script will add GPG signatures to the
250 `hashes` and `sha256sums` files and then upload the signed files:
251
252 ```ShellSession
253 $ script/upload --finalize vM.N.P
254 ```
255
256 If you want to inspect the data before approving it, pass the `--inspect`
257 option, which will drop you to a shell and let you look at things. If the
258 shell exits successfully, the build will be signed; otherwise, the process
259 will be aborted.
260
261 8. Publish the release on GitHub, assuming it looks correct.
262
263 9. Move any remaining items out of the milestone for the current release to a
264 future release and close the milestone.
265
266 10. Update the `_config.yml` file in
267 [`git-lfs/git-lfs.github.com`](https://github.com/git-lfs/git-lfs.github.com),
268 similar to the following:
269
270 ```diff
271 --- _config.yml
272 +++ _config.yml
273 @@ -1,7 +1,7 @@
274 # Site settings
275 title: "Git Large File Storage"
276 description: "Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise."
277 -git-lfs-release: M.(N-1).0
278 +git-lfs-release: M.N.0
279
280 url: "https://git-lfs.com"
281 ```
282
283 11. If Homebrew does not automatically update within a few hours,
284 create a GitHub PR to update the Homebrew formula for Git LFS with
285 the `brew bump-formula-pr` command on a macOS system. The SHA-256 value
286 should correspond with the packaged artifact containing the new
287 release's source files which is available at the given URL:
288
289 ```ShellSession
290 $ brew tap homebrew/core
291 $ brew bump-formula-pr \
292 --url https://github.com/git-lfs/git-lfs/releases/download/vM.N.P/git-lfs-vM.N.P.tar.gz \
293 --sha256 <SHA-256> \
294 git-lfs
295 ```
296
297 ### Building PATCH versions
298
299 When building a PATCH release, we cherry-pick merges from `main` to the
300 `vM.N` release branch, creating the branch first if it does not exist,
301 and then use that branch as the base for the PATCH release.
302
303 1. Upgrade or downgrade the Go version used in the `git-lfs/build-dockers`
304 repository to the latest available PATCH release with the same major
305 and minor version numbers as the Go version used to build the Git LFS
306 `vM.N.(P-1)` release.
307
308 2. If the `release-M.N` branch does not already exist, create it from
309 the corresponding MINOR release tag (or MAJOR release tag, if no
310 MINOR releases have been made since the last MAJOR release):
311
312 ```ShellSession
313 $ git checkout -b release-M.N vM.N.0
314 ```
315
316 If the release branch already exists because this is not the first
317 PATCH release for the given MINOR (or MAJOR) release, simply checkout
318 the `release-M.N` branch, and ensure that you have the latest changes
319 from the remote.
320
321 3. Gather a set of potential candidates to backport to the `release-M.N`
322 branch with:
323
324 ```ShellSession
325 $ git log --merges --first-parent vM.N.(P-1)...main
326 ```
327
328 4. For each merge that you want to backport, run:
329
330 ```ShellSession
331 $ git cherry-pick -m1 <SHA-1>
332 ```
333
334 This will cherry-pick the merge onto your release branch, using
335 the `-m1` option to specify that the first parent of the merge
336 corresponds to the mainline.
337
338 5. Then follow the [guidelines](#building-a-release) above, using the
339 `release-M.N` branch as the base for the new PATCH release.
340
341 ### Building security PATCH versions
342
343 In our public security [policy](../../SECURITY.md) we request that
344 potential vulnerabilities in the Git LFS client be reported to us
345 via email. Users sometimes also choose to open draft GitHub security
346 advisories, although we do not encourage that option.
347
348 If we determine that such a report is valid, we develop a PATCH release
349 version of the client with a remediation for the security issue,
350 following the steps below.
351
352 1. Open a new draft security advisory, fill out the relevant
353 details in the
354 [template](https://github.com/git-lfs/git-lfs/security/advisories/new),
355 and request a CVE identifier.
356
357 2. Create a temporary private fork of this repository from the draft
358 security advisory page, and use the fork to develop a resolution
359 of the vulnerability.
360
361 3. Create two PRs in the private fork, one to remediate the vulnerability
362 in the `main` development branch of the public `git-lfs/git-lfs`
363 repository, and one to do so in the appropriate `release-M.N` branch.
364
365 The PR which targets the release branch should have a final, extra
366 commit which adds an entry for the new PATCH release version in the
367 `CHANGELOG.md` file, describing the release and the security fix it
368 contains. This commit should also include the changes generated
369 by the `script/update-version vM.N.P` command, as per the second step
370 in our standard release process.
371
372 If the `release-M.N` branch does not exist in the public repository,
373 create it as per our regular PATCH release process, and then create
374 the second PR in the private fork against the new branch. Be prepared
375 to proceed relatively quickly, since the appearance of the new branch
376 serves as a public notice that we may be publishing a PATCH release
377 shortly.
378
379 4. From the draft security advisory page, use the "Merge pull requests"
380 option to merge both PRs simultaneously.
381
382 Note that both the release branch and the `main` branch in the private
383 fork must be up-to-date with the corresponding branches in the public
384 repository in order for the GitHub UI to determine whether the PRs have
385 no merge conflicts.
386
387 5. Publish the security advisory.
388
389 6. Follow our standard release process, starting with the step in which
390 we create a GPG-signed tag named `vM.N.P` on the merge commit to the
391 `release-M.N` branch.
392
393 7. After publication of the new release, update the `git-lfs.com` home
394 page with a banner message regarding the security PATCH release.
395 Place the banner at the top of the `_includes/home/secondary.html`
396 file in the `git-lfs/git-lfs.github.com` repository. Use the GHSA
397 identifier from the security advisory, and remove any previous
398 security message banners.
399
400 ```html
401 <div class="column">
402 <a class="dot-com-announcement" data-ga-params="banner"
403 href="https://github.com/git-lfs/git-lfs/security/advisories/GHSA-abcd-1234-wxyz">
404 Git LFS security update: <span>All users should update to M.N.P or newer</span>.</a>
405 </a>
406 </div>
407 ```
408
409 8. Create a new discussion in the "Announcements" section of the GitHub
410 discussion [forum](https://github.com/git-lfs/git-lfs/discussions)
411 describing the security PATCH release, and pin the discussion for
412 all categories in the forum.
413
414 ### Building security PATCH versions under embargo
415
416 When coordinating the release of a security patch with one or more
417 other projects, we must not follow the processes described above as
418 they depend on the GitHub Actions release workflow in our public
419 `git-lfs/git-lfs` repository. Instead, we use a private repository
420 with a modified release workflow to build the binaries and packages
421 for our new version so that we can share them with the other projects
422 in advance of the coordinated release date.
423
424 1. Open a draft security advisory, apply for a CVE identifier, and
425 create a temporary private fork from the advisory page. Develop a
426 resolution of the vulnerability in the private fork. These initial
427 steps are the same as those of our non-embargoed security PATCH
428 release process.
429
430 2. Create one PR in the private fork to remediate the vulnerability
431 in the `main` development branch of the public repository.
432
433 3. Create a branch in the private fork from the appropriate
434 `release-M.N` branch, or if that does not yet exist, from the
435 appropriate `vM.N.0` tag, and add the necessary changes to remediate
436 the vulnerability.
437
438 This branch should have one extra, final commit which adds an entry
439 for the new PATCH release version in the `CHANGELOG.md` file,
440 describing the release and the security fix it contains. This
441 commit should also include the changes generated by the
442 `script/update-version vM.N.P` command, as per the second step
443 in our standard release process.
444
445 4. Pull this branch from the private fork of the public repository
446 and push it into a separate private repository which has a fresh copy
447 of the public `git-lfs/git-lfs` repository, and for which our full
448 CI and release GitHub Actions workflows are configured and enabled.
449
450 Note that the private fork created from the draft security advisory
451 will not execute GitHub Actions jobs, and so we require the use of
452 a separate private repository to run a modified release workflow.
453
454 5. If the `release-M.N` branch does not exist, create it in the
455 separate private repository from the `vM.N.0` tag, as described
456 in the second step of our regular PATCH release process.
457
458 6. Merge the branch containing the security fix and the commit with the
459 new `CHANGELOG.md` entry (and `script/update-version vM.N.P` changes)
460 into the `release-M.N` branch, and sign the merge commit with your
461 GPG key:
462
463 ```ShellSession
464 $ git checkout release-M.N
465 $ git merge --no-ff -S \
466 -m "Merge pull request from GHSA-abcd-1234-wxyz" \
467 -m "release: M.N.P" \
468 branch-with-fix-and-changelog
469 ```
470
471 Use the GHSA identifier from the draft security advisory in the
472 merge commit's description.
473
474 7. Create a GPG-signed tag named `vM.N.P` on the merge commit, using
475 the same command from the equivalent step of our standard release
476 process:
477
478 ```ShellSession
479 $ git tag -s vM.N.P -m vM.N.P
480 ```
481
482 8. Check out the `main` branch of the private repository and make
483 the following revisions to the `.github/workflows/release.yml` file,
484 and then push these changes back to the private repository's `main`
485 branch.
486
487 First, change the `on` value to `workflow_dispatch`:
488
489 ```diff
490 -on:
491 - push:
492 - tags: '*'
493 +on: workflow_dispatch
494 ```
495
496 Set the version of Go in each `matrix` context to the same version
497 used in the Dockerfiles from our `git-lfs/build-dockers` repository.
498
499 Replace the `${{ github.ref }}` context wherever it appears with the
500 `vM.N.P` tag:
501
502 ```diff
503 - ref: ${{ github.ref }}
504 + ref: vM.N.P
505 ```
506
507 Revise the `build-docker` and `build-docker-arm` jobs so they do not
508 upload the Linux packages generated by the `docker/run_dockers.bsh`
509 script to Packagecloud by running the `script/packagecloud.rb` utility.
510 Change the jobs to instead upload the Linux packages as job artifacts;
511 for instance, for the `build-docker` job:
512
513 ```yaml
514 - uses: actions/upload-artifact@v4
515 with:
516 name: docker-assets
517 path: |
518 repos/**/*.deb
519 repos/**/*.rpm
520 ```
521
522 Make sure to use distinct artifact `name`s for each of these jobs,
523 i.e., `docker-assets` and `docker-arm-assets`.
524
525 9. Push the `vM.N.P` tag to the private repository, and then cancel
526 the GitHub Actions job which runs from the release workflow.
527
528 (This workflow will run because the tag includes our normal
529 GitHub Actions workflow definitions without the changes made in
530 the previous step, since those exist only on the `main` branch,
531 and we do not want to include these temporary workflow changes in
532 the security release itself.)
533
534 Confirm that the CI workflow job succeeds.
535
536 10. From the private repository's GitHub Actions page, manually dispatch
537 the release workflow.
538
539 11. When the manually-dispatched job is complete, download the
540 `release-assets`, `docker-assets`, and `docker-arm-assets` archive
541 files from the "Artifacts" section of the job's "Summary" page.
542
543 Share the relevant binaries from the archive files with the other
544 collaborating projects during the embargo period.
545
546 12. Before the embargo is due to the lifted, unpack the `release-assets`
547 archive file at the top level of this repository and use the
548 `script/upload` utility to create a draft release announcement and
549 attach the release assets to it, just as for a standard release:
550
551 ```ShellSession
552 $ rm -rf bin/releases
553 $ unzip /path/to/release-assets.zip
554
555 $ script/upload --skip-verify vM.N.P
556 ```
557
558 13. When the embargo is lifted, use the "Merge pull requests" option
559 on the draft security advisory page to merge the PR with the security
560 fix into the `main` branch of the public repository.
561
562 Note that the `main` branch in the private fork must be up-to-date
563 with the corresponding branch in the public repository in order for
564 the GitHub UI to determine whether the PR has no merge conflicts.
565
566 14. Publish the security advisory.
567
568 15. Pull the `release-M.N` branch and `vM.N.P` tag from the private
569 repository where the release workflow was run manually, and push
570 them into the public `git-lfs/git-lfs` repository.
571
572 Immediately cancel the GitHub Actions job which runs from the
573 release workflow in the public repository.
574
575 Note that cancelling the release workflow job is important, since
576 it will otherwise build new versions of the RPM and Debian Linux
577 packages and publish them to Packagecloud.
578
579 16. Upload to Packagecloud the RPM and Debian Linux packages in the
580 `docker-assets` and `docker-arm-assets` archive files created earlier
581 by the manual release workflow job.
582
583 Note that the `script/packagecloud.rb` utility requires the
584 `PACKAGECLOUD_TOKEN` environment variable to contain the current
585 Packagecloud account credential token.
586
587 ```ShellSession
588 $ mkdir repos
589 $ unzip -d repos /path/to/docker-assets.zip
590 $ unzip -d repos /path/to/docker-arm-assets.zip
591
592 $ gem install packagecloud-ruby
593 $ PACKAGECLOUD_TOKEN="<token>" script/packagecloud.rb
594 ```
595
596 17. Finalize the release process using the `script/upload` utility with
597 the `--finalize` option. The script will add GPG signatures to the
598 `hashes` and `sha256sums` files and then upload the signed files:
599
600 ```ShellSession
601 $ script/upload --finalize vM.N.P
602 ```
603
604 18. Publish the release announcement.
605
606 19. Update the `_config.yml` file in the `git-lfs/git-lfs.github.com`
607 repository with the new `M.N.P` release version and push the change,
608 as described in the final steps of our standard release process.
609
610 In addition, update the `_includes/home/secondary.html` file with
611 a banner message regarding the security PATCH release, and push
612 the change.
613
614 20. Create a new discussion in the "Announcements" section of the GitHub
615 discussion [forum](https://github.com/git-lfs/git-lfs/discussions)
616 describing the security PATCH release, and pin the discussion for
617 all categories in the forum.