Debian Codegraph @

docs/en/how-to/internal/release.md

raw
1 # How to cut a Briefcase release
2
3 The release infrastructure for Briefcase is semi-automated, using GitHub Actions to formally publish releases.
4
5 This guide assumes that you have an `upstream` remote configured on your local clone of the Briefcase repository, pointing at the official repository. If all you have is a checkout of a personal fork of the Briefcase repository, you can configure that checkout by running:
6
7 ```console
8 $ git remote add upstream https://github.com/beeware/briefcase.git
9 ```
10
11 The procedure for cutting a new release is as follows:
12
13 1. Check the contents of the upstream repository's main branch:
14
15 ```console
16 $ git fetch upstream
17 $ git checkout --detach upstream/main
18 ```
19
20 Check that the HEAD of release now matches upstream/main.
21
22 2. Ensure that the release notes are up to date. Run:
23
24 ```console
25 $ tox -e towncrier -- --draft
26 ```
27
28 to review the release notes that will be included, and then:
29
30 ```console
31 $ tox -e towncrier
32 ```
33
34 to generate the updated release notes.
35
36 3. Build the documentation to ensure that the new release notes don't include any spelling errors or markup problems:
37
38 ```console
39 $ tox -e docs-lint,docs-all
40 ```
41
42 4. Ensure that there is a version branch for the new Briefcase version in every template that Briefcase will use at runtime:
43
44
45 - `briefcase-template`
46 - `briefcase-macOS-app-template`
47 - `briefcase-macOS-Xcode-template`
48 - `briefcase-windows-app-template`
49 - `briefcase-windows-VisualStudio-template`
50 - `briefcase-linux-appimage-template`
51 - `briefcase-linux-flatpak-template`
52 - `briefcase-linux-system-template`
53 - `briefcase-iOS-Xcode-template`
54 - `briefcase-android-gradle-template`
55 - `briefcase-web-static-template`
56
57 5. Tag the release, and push the branch and tag upstream:
58
59 ```console
60 $ git tag v1.2.3
61 $ git push upstream HEAD:main
62 $ git push upstream v1.2.3
63 ```
64
65 6. Pushing the tag will start a workflow to create a draft release on GitHub. You can [follow the progress of the workflow on GitHub](https://github.com/beeware/briefcase/actions?query=workflow%3A%22Create+Release%22); once the workflow completes, there should be a new [draft release](https://github.com/beeware/briefcase/releases), and an entry on the [Test PyPI server](https://test.pypi.org/project/briefcase/).
66
67 Confirm that this action successfully completes. If it fails,
68 there's a couple of possible causes:
69
70 a. The final upload to Test PyPI failed. Test PyPI is not have the
71 same service monitoring as PyPI-proper, so it sometimes has
72 problems. However, it's also not critical to the release
73 process; if this step fails, you can perform Step 6 by manually
74 downloading the "packages" artifact from the GitHub workflow
75 instead.
76
77 b. The test apps fail to build. This is likely because you forgot
78 to branch one (or more) of the templates mentioned in Step 3. If
79 this happens, you can correct the missing template, and re-run
80 the action through the GitHub Actions GUI.
81
82 c. Something else fails in the build process. If the problem can be
83 fixed without a code change to the Briefcase repository (e.g., a
84 transient problem with build machines not being available), you
85 can re-run the action that failed through the GitHub Actions
86 GUI. If the fix requires a code change, delete the old tag, make
87 the code change, and re-tag the release.
88
89 7. Create a clean virtual environment, install the new release from Test PyPI, and perform any pre-release testing that may be appropriate:
90
91 ```console
92 $ python3 -m venv testvenv
93 $ . ./testvenv/bin/activate
94 (testvenv) $ pip install --extra-index-url https://test.pypi.org/simple/ briefcase==1.2.3
95 (testvenv) $ briefcase --version
96 briefcase 1.2.3
97 (testvenv) $ #... any other manual checks you want to perform ...
98 ```
99
100 8. Log into Read The Docs, visit the [Versions tab](https://readthedocs.org/projects/briefcase/versions/), and activate the new version. Ensure that the build completes; if there's a problem, you may need to correct the build configuration, roll back and re-tag the release.
101
102 9. Edit the GitHub release to add release notes. You can use the text generated by towncrier, but you'll need to update the format to Markdown, rather than ReST. If necessary, check the pre-release checkbox.
103
104 10. Double check everything, then click Publish. This will trigger a [publication workflow on GitHub](https://github.com/beeware/briefcase/actions?query=workflow%3A%22Upload+Python+Package%22).
105
106 11. Wait for the [package to appear on PyPI](https://pypi.org/project/briefcase/).
107
108 Congratulations, you've just published a release!
109
110 If anything went wrong during steps 4-10, you will need to re-start from step 4 with a new version number. Once the release has successfully appeared on PyPI (or Test PyPI), it cannot be changed; if you spot a problem in a published package, you'll need to tag a completely new release.