Skip to content

Commit 5a57e6c

Browse files
committed
Add full release docs
1 parent d31163a commit 5a57e6c

File tree

1 file changed

+249
-0
lines changed

1 file changed

+249
-0
lines changed

docs/NaN_Full_release_docs.md

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
### Preliminary steps
2+
3+
#### Permissions
4+
5+
- have admin rights on Weblate
6+
- you should be able to access [Weblate's Maintenance page](https://hosted.weblate.org/projects/newpipe/#repository)
7+
- have at least maintainer rights on the NewPipe and NewPipeExtractor repos
8+
9+
#### Repositories
10+
11+
- have a cloned NewPipe local repository (for the rest of the page `origin` is assumed to be the remote at `github.com/TeamNewPipe/NewPipe`)
12+
- add the `weblate` remote to the same local repository (the URL used below can be found in the Maintenance page on Weblate)
13+
- `git remote add weblate https://hosted.weblate.org/git/newpipe/strings/`
14+
- make sure there are no pending changes
15+
- `git clean -fdx` to **discard** them all (**CAUTION**)
16+
- go on the `dev` branch and make sure is up-to-date with remote:
17+
- `git checkout dev`
18+
- `git pull origin dev`
19+
20+
#### Version name and conventions
21+
22+
- find the version code of the next release by looking for `versionCode` into [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle): that value plus one (from now on called `NEW_VERSION_CODE`) will be the new value (but do not edit the file yet)
23+
- choose the version number of the next release according to [semantic versioning](http://semver.org/) (from now on called `X.X.X`)
24+
25+
#### Identification
26+
27+
- have `gpg` installed and usable on your PC
28+
- have a GPG key to be used to make sure it is actually you
29+
30+
### Pull changes from Weblate
31+
32+
- go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository)
33+
- press the *Lock* button to prevent translators from translating while you are creating commits; remember to *Unlock* later!
34+
- press the *Update* button to update Weblate with the latest changes on NewPipe's `dev` branch
35+
- press the *Commit* button, if needed, to make sure Weblate creates a commit for translations which had not been committed yet
36+
- now go back to the local git repository
37+
- in case you followed these steps before, delete the `weblate-dev` branch
38+
- `git branch -D weblate-dev`
39+
- fetch new changes from the `weblate` remote
40+
- `git fetch weblate`
41+
- create a new branch starting from `weblate/dev`, named `weblate-dev`, and switch to it
42+
- `git checkout -b weblate-dev weblate/dev`
43+
- if you run `git log --oneline --graph` you should see a Weblate commit on top, and then all of the commits currently on the `dev` branch:
44+
```
45+
* cmt12hash (HEAD -> weblate-dev, weblate/dev) Translated using Weblate (...)
46+
* cmt89hash (origin/dev, dev) Commit message ...
47+
```
48+
- switch back to the `dev` branch
49+
- `git checkout dev`
50+
- merge `weblate-dev` into `dev`:
51+
- `git merge weblate-dev`
52+
53+
### Create a changelog
54+
55+
- finalize the draft changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases), in case there are still some things to fill in
56+
- remove temporary instructions and numbers before `-`, that keep track in which order the PRs were merged, but which is useful information only for blogpost writers
57+
- before removing that information, you may want to send the original changelog to the blogpost writers
58+
- create a new English changelog in the [`fastlane/metadata/android/en-US/changelogs/`](https://github.com/TeamNewPipe/NewPipe/blob/dev/fastlane/metadata/android/en-US/changelogs/) folder
59+
- the file should be named `NEW_VERSION_CODE.txt`, using the new version code found in [Preliminary steps](#preliminary-steps)
60+
- the file should have this structure (sections with no points can be removed):
61+
```
62+
New
63+
• ...
64+
65+
Improved
66+
• ...
67+
68+
Fixed
69+
• ...
70+
```
71+
- make sure you use the `•` for points (it looks nicer than `-`)
72+
- capitalize the first letter in each point
73+
- use English verbs as if you were asking someone to do something, so for example use "Fix abc" and not "Fixed abc"; this allows saving a few characters and using a consistent style
74+
- prepend `[SERVICE]` to service-only changes (e.g. "• \[YouTube\] Add mixes")
75+
- summarize only the most important changes from the draft release [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases) (it contains all merged pull requests)
76+
- make sure the file size is **at most 500 bytes**, in order to **fit [F-Droid's changelog size limit](https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#fastlane-structure) (!)**
77+
- commit the file on the `dev` branch (try to stick to the provided commit message template)
78+
- `git add fastlane/metadata/android/en-US/changelogs/NEW_VERSION_CODE.txt`
79+
- `git commit -m "Add changelog for vX.X.X (NEW_VERSION_CODE)"`
80+
81+
### Push the changelog to Weblate
82+
83+
Now there shuold be two new commits (the Weblate and changelog ones) on your local `dev` branch which are not on NewPipe's remote `dev` branch.
84+
- if you are an admin of the NewPipe repo, just push the changes to the remote `dev`
85+
- `git push origin dev`
86+
- if you are not an admin, create a pull request normally and ask someone with maintainer access to merge it
87+
- go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository)
88+
- press the *Update* button to update Weblate with the commit you just pushed on NewPipe's `dev` branch
89+
- **press the *Unlock*** button to allow translators to translate the changelog and possibly other components (**do not forget this step!**)
90+
- note that we had to do this process on NewPipe's `dev` branch because:
91+
- Weblate's components are connected to NewPipe's `dev` branch and will update changes from there
92+
- Weblate's git repo is not writable, so there is no way to push commits there manually
93+
94+
### Creating the release branch
95+
96+
- create a new branch starting from `dev`, named `release-X.X.X`, and switch to it
97+
- `git checkout -b release-X.X.X`
98+
- edit the [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle) file to update the extractor
99+
- set the NewPipeExtractor dependency version to a suitable one (usually [the last commit in the NewPipeExtractor repo](https://github.com/TeamNewPipe/NewPipeExtractor/commits/dev))
100+
- commit the extractor update (if you used a specific version, specify `to VERSION` in the commit message)
101+
- `git add app/build.gradle`
102+
- `git commit -m "Update NewPipeExtractor"`
103+
- edit the [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle) file to bump the release
104+
- set `versionCode` to `NEW_VERSION_CODE`, i.e. increment the value by one as described in [Preliminary steps](#preliminary-steps)
105+
- set `versionName` to `"X.X.X"`
106+
- commit the version bump (try to stick to the provided commit message template)
107+
- `git add app/build.gradle`
108+
- `git commit -m "Release vX.X.X (NEW_VERSION_CODE)"`
109+
- push the newly created branch to the NewPipe repo
110+
- `git push upstream release-X.X.X`
111+
112+
### Creating the Pull Request
113+
114+
- create a Pull Request (PR) from the new branch you just pushed
115+
- if you used the correct branch name you should be able to use this url, after changing the X.X.X: https://github.com/TeamNewPipe/NewPipe/pull/new/release-X.X.X
116+
- make sure the PR has `master` as the *base* branch and `release-X.X.X` as the *compare* branch
117+
- the PR title should be "Release vX.X.X (NEW_VERSION_CODE)"
118+
- remove all of the PR template and instead put these two lines in the description (the `ISSUE_NUMBER` will be replaced later):
119+
```
120+
Do not report regressions here, but rather in the corresponding issue: #ISSUE_NUMBER
121+
The changelog is also there.
122+
```
123+
- once you created the PR, note down its number (from now on called `PR_NUMBER`)
124+
- in case some issue should be closed when the release PR is merged, link them using the "Development" tab on the right, or add a "Fixes #...." in the PR description
125+
- *for example check out [#8231](https://github.com/TeamNewPipe/NewPipe/pull/8231) as a reference*
126+
127+
### Creating the issue
128+
129+
- create an issue
130+
- click [here](https://github.com/TeamNewPipe/NewPipe/issues/new) to open one without a template
131+
- the issue title should be "Release vX.X.X (please TEST!)"
132+
- the issue should have some sections, in the same order as provided below, with `##` before titles
133+
- the `## Testing for regressions` section should contain the following lines; more information about how to obtain the APK are given at [Testing APKs](testing-apks)
134+
```
135+
Debug APK (built by our CI in #PR_NUMBER): ...
136+
Please report **only regressions** (i.e. new issues) here, not issues that were already present in the previous release!
137+
```
138+
- the `## TODO` section should contain a list of things that still need to be done before releasing, for example regressions that need to be fixed, or a reminder to merge the Weblate changelogs before releasing (use `- [ ]` to create checkbox lists)
139+
- the `## NewPipeExtractor version` should contain a link to the NewPipeExtractor release this new NewPipe version will ship with (i.e. the one set in [Creating the release branch](#creating-the-release-branch))
140+
- copy-paste the draft Markdown changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases) (you finalized it earlier in [Create a changelog](#create-a-changelog)) and put it under the `## App changelog` section
141+
- once you created the issue, pin it using the "Pin issue" button on the right
142+
- *for example check out [#8230](https://github.com/TeamNewPipe/NewPipe/pull/8230) as a reference*
143+
144+
### Testing APKs
145+
146+
The first time you open the release issue and then each time some changes are made to the release PR, you should provide a debug APK in the `## Testing for regressions` section.
147+
- wait for the Continuous Integration (CI) to finish in the PR, then download from the "Checks" tab the debug APK it has built
148+
- rename it to `NewPipe_vX.X.X_RC1_debug.apk` where `RC1` should be incremented to `RC2`, ... each time a new APK is provided
149+
- zip it and make sure the `.zip` file has the same name as the `.apk` it contains
150+
- upload it in the issue description, replacing the `...` placeholder used above
151+
152+
Sometimes it might be needed to also provide a release APK. In this case follow the same steps as above, with these differences:
153+
- make sure you are on the `release-X.X.X` branch
154+
- build the **release** APK yourself in Android Studio and sign it with your keys
155+
- make sure it installs correctly on your device
156+
- use this naming scheme: `NewPipe_vX.X.X_RC1_release.apk`
157+
- add a line to the `## Testing for regressions` section, of this form: `Debug APK (built and signed by @YOUR_GITHUB_USERNAME): ...`
158+
159+
### Taking care of regressions
160+
161+
The release issue and pull request should stay open for **roughly one week**, so that people can test the provided APKs and give feedback. If a *regression* is reported by some user, it should possibly be solved before releasing, otherwise the app would become more broken after each release. A *regression* is a bug now present in some code that used to run well in the last release, but was then modified in this release (supposedly to fix something else) and is now broken. So the following do not classify as regressions: some videos stop working because YouTube made some changes; the newly introduced big feature XYZ is still not perfect and has some bugs; a random crash reproducible also on previous versions... You get the point. Before releasing, try to fix any regression that come out, but avoid fixing non-regressions, since those should be treated with the same care and attention as all other issues.
162+
163+
Pull requests fixing regressions should target the `release-X.X.X` branch, not the `dev` branch! When merging those PRs, also provide a new RC APK.
164+
165+
### Finally merging the pull request
166+
167+
Once enough time has passed and all regressions and TODOs have been solved, you can proceed with the actual release. The following points include merging weblate changes again.
168+
- in the local repository, check out the release branch and make sure it is up-to-date with the remote
169+
- `git checkout release-X.X.X`
170+
- `git pull origin release-X.X.X`
171+
- go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository)
172+
- press *Lock*; remember to *Unlock* later!
173+
- press *Update*
174+
- press *Commit*, if needed
175+
- now go back to the local git repository
176+
- delete the `weblate-dev` branch, just in case
177+
- `git branch -D weblate-dev`
178+
- fetch changes from Weblate (in particular you should see the `weblate/dev` remote branch being updated)
179+
- `git fetch weblate`
180+
- obtain the hash of the last commit on the `weblate/dev` remote branch
181+
- `git log -n 1 --pretty="format:%H" weblate/dev`
182+
- cherry pick the has you obtained above into the release branch (the one you are currently on)
183+
- `git cherry-pick HASH`
184+
- push the changes to the remote branch
185+
- `git push origin release-X.X.X`
186+
- merge the PR you created before
187+
- delete the GitHub remote branch associated with the PR, i.e. `release-X.X.X` (there should be a button in the PR)
188+
- close the issue you created before
189+
- merge `dev` back into `master` (since the PR merged changes onto `master`)
190+
- `git checkout master`
191+
- `git pull origin master`
192+
- `git checkout dev`
193+
- `git pull origin dev`
194+
- `git merge master`
195+
- `git push origin dev` or create another temporary PR and merge it immediately
196+
- go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository)
197+
- press *Unlock*
198+
199+
### Creating the APK
200+
201+
Now on the remote `master` branch there is the release code which you need to turn into an APK.
202+
- in the local repository, check out the `master` branch and make sure it is up-to-date with the remote
203+
- `git checkout master`
204+
- `git pull origin master`
205+
- open the local project in Android Studio
206+
- run the Gradle `clean` task using Android Studio's interface, in order to cleanup temporary/cache files that may interfere with reproducible builds
207+
- double press Ctrl, type `gradle clean`, press Enter
208+
- make sure leftover files from building RC releases are actually removed, in order to avoid confusion
209+
- `rm -rf ./app/release`
210+
- run the Gradle `assembleRelease` task using Android Studio's interface: it will start the process of building an unsigned APK
211+
- double press Ctrl, type `gradle assembleRelease`, press Enter
212+
- after a while you should find the APK under `./app/build/outputs/apk/release/app-release-unsigned.apk`
213+
214+
### Having the APK signed by @TheAssassin
215+
216+
Currently @TheAssassin is the only holder of NewPipe's APK signing keys. Therefore you should send the unsigned APK to him and he will send a signed one back. He will also then publish the signed APK in NewPipe's F-Droid repo.
217+
- rename `app-release-unsigned.apk` to `NewPipe_vX.X.X.apk`
218+
- generate a signature for the APK file
219+
- `gpg -b NewPipe_vX.X.X.apk` will generate `NewPipe_vX.X.X.apk.sig`
220+
- it will also output 'using "FINGERPRINT" as default secret key for signing'; keep track of the `FINGERPRINT` part
221+
- send an email to @TheAssassin and attach both `NewPipe_vX.X.X.apk` and `NewPipe_vX.X.X.apk.sig`
222+
- if @TheAssassin does not already know it, send him your PGP key `FINGERPRINT` you obtained before
223+
- you should send it not using email this time, but another service on which @TheAssassin can be almost sure it is really you (something like 2FA)
224+
- for example, either just send it on the IRC group, or create a GitHub gist with the fingerprint and then give that link to @TheAssassin
225+
- notify him on IRC that you have sent him an email
226+
- he will send you back the signed APK
227+
- make sure its name is still `NewPipe_vX.X.X.apk` (rename if it's not the case)
228+
- install it on your device to see if everything went well (note that installation will work only if your currently installed version of newpipe comes from NewPipe's F-Droid repo or GitHub)
229+
- tell @TheAssassin to "push the buttons", i.e. publish the signed APK in NewPipe's F-Droid repo.
230+
231+
### Publishing the release
232+
233+
- go to the draft changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases)
234+
- set `vX.X.X` as the tag name
235+
- set `vX.X.X` as the release title
236+
- set `dev` as the "Target:" branch
237+
- attach the signed APK @TheAssassin sent you
238+
- publish the release
239+
- profit :-D
240+
241+
### Blog post
242+
243+
> I do not know enough about blog post writing and publishing to fill in this section, I'll leave it to @opusforlife2 and @Poolitzer.
244+
245+
- in order for the blog post to be published, ask @TheAssassin to "press the buttons" again
246+
- once the blog post is ready (which, in optimal cases, should happen before the release is published, but that's not a must), add this block of text on top of the release notes on GitHub:
247+
```
248+
[:arrow_right: :arrow_right: :arrow_right: Read the blog post :arrow_left: :arrow_left: :arrow_left:](LINK_TO_BLOG_POST)
249+
```

0 commit comments

Comments
 (0)